Reputation: 325
My job is pending and get below message:
This job is stuck, because you don't have any active runners that can run this job.
But I do have an activated runner available for this project:
The runner is installed as docker in one of my vps:
Below is the config for this runner:
concurrent = 1 check_interval = 0
[[runners]]
name = "ansible"
url = "https://gitlab.com/"
token = "xxx"
executor = "docker"
[runners.docker]
tls_verify = false
image = "registry.cn-hangzhou.aliyuncs.com/artwater/ansible:latest"
privileged = false
disable_cache = false
volumes = ["/cache"]
[runners.cache]
below is my gitlab-ci.yml:
stages:
- build
- production
job_build:
stage: build
script:
- ansible-playbook -i ./ansible/hosts/production.yml --extra-vars "version=$CI_BUILD_TAG" ./ansible/build.yml
only:
- tags
job_production:
stage: production
script:
- ansible-playbook -i ./ansible/hosts/production.yml --extra-vars "version=$CI_BUILD_TAG" ./ansible/deploy.yml
only:
- tags
when: on_success
Can anyone please let me know how can I make this runner working? Thanks a lot!
Upvotes: 8
Views: 14365
Reputation: 43
If you have any issues with gitlab-runner try the following command to debug. You'll get more information about where things are going wrong.
sudo gitlab-runner -debug run
Mention tags in pipeline stage, if runner is not untagged type and you can edit runner configuration in gitlab runner edit form.
Specifically, runner checks for jobs; sometime runner's job will be in pending because it fails to detect job.
After running the debug command runner job starts quickly if the configuration is correct.
Upvotes: 0
Reputation: 31
Try the untagged run. Go to the specific runner configuration in GitLab instance and check "Run untagged jobs" and resubmit the pipeline.
Upvotes: 2
Reputation: 3116
It seems that you need to either specify for the project which uses your runner the respective tag (e.g. ansible in your example) or enable the runner to not check tags: Run untagged jobs (at least for shared runners)
Upvotes: 7