This job is stuck, because the project doesn't have any runners online assigned to it. Go to Runners page [closed]
Asked Answered
K

8

223

I am learning GitLab CI/CD.

I installed GitLab and GitLab Runner from Officials. Whenever I run the pipeline during Maven build, the job gets stuck. I have a registered runner and it is available to my project, but jobs get stuck.

.gitlab-ci.yml

image: docker:latest
services:
- docker:dind

variables:
 DOCKER_DRIVER: overlay
 SPRING_PROFILES_ACTIVE: gitlab-ci

stages:
- build
- package
- deploy

maven-build:
 image: maven:3-jdk-8
 stage: build
 script: "mvn package -B"
 artifacts:
 paths:
  - target/*.jar

docker-build:
stage: package
script:
 - docker build -t registry.com/ci-cd-demo .
 - docker push registry.com/ci-cd-demo

k8s-deploy:
 image: google/cloud-sdk
 stage: deploy
 script:
  - echo "$GOOGLE_KEY" > key.json
  - gcloud container clusters get-credentials standard-cluster-demo -- 
  zone us-east1-c --project ascendant-study-222206
   - kubectl apply -f deployment.yml

My runner settings

My shared runner

My project runner

Error message when runner is already associated with project:

Job error message

Can you help me?

Kao answered 19/11, 2018 at 8:28 Comment(0)
R
506

The job is stuck because your runners have tags and your jobs don't. Follow these 4 steps to enable your runner to run without tags:

enter image description here enter image description here

Or set tags to your jobs. For more info: Configuration of your jobs with .gitlab-ci.yml - Tags

Rita answered 19/11, 2018 at 8:44 Comment(8)
This runner setting was little bit hard to recognize (^_-)-☆Alpinist
@JakubZáruba Where do I find the screen with the option "Run untagged jobs" ?Semele
@frakman1good point, thanks! I just updated my response - check it out ;-)Rita
i'm loving you right now... I wonder why they don't just tell you that instead of that message :(Defenestration
Also, if the runner you are going to use is registered by you, bear in mind that even when the runner is listed and shown as active in the UI. It can still not work because the gitlab-runner service is not started. I also had to run gitlab-runner install && gitlab-runner start to make it work (on this scenario)Rustication
@JakubZáruba Can you please help me in one doubt that How can i create the Shared runner in the Gitlab.. Right now i have created the custom runner and it runs well but my problem is that it depends on my system to create the build(apk) otherwise it becomes fail to runs. Is it possible from the Shared Runner which does not depend on my system to run. Please help me on it..ThanksGreek
There should be a warning about setting tagsHaste
I had some difficulties finding the illustrated runner settings, they were not under the CI/CD settings of a repository. Instead, I could find them in the root GitLab account at: https://<mygitlabserver>/admin/runners/.Implement
B
11

It was quite simple on my side, I just run gitlab-runner run on my computer

Backstop answered 2/6, 2021 at 11:35 Comment(2)
This works for me, but I shouldn't have to run this command every time I make some changes. Do you know what I can do to automate this process?Mandler
@AmirShabani Same question, did you find a way for it?Valance
L
8

Also you can tag your jobs using the following syntax in file .gitlab-ci.yml:

stages:
  - check
  - build
  - test
  - analyze
  - package
  - release
  - deploy
nohttp:
  stage: check
  tags:
    - dev

Besides not to forget to add tag "dev" to your project's specefic/shared runner.

Lesotho answered 27/7, 2020 at 15:11 Comment(1)
Can you please help me in one doubt that How can i create the Shared runner in the Gitlab.. Right now i have created the custom runner and it runs well but my problem is that it depends on my system to create the build(apk) otherwise it becomes fail to runs. Is it possible from the Shared Runner which does not depend on my system to run. Please help me on it..ThanksGreek
P
7

Make sure you are using the correct tag i.e. whatever present corresponding to the configured runner for your project.

In your case it would be like :

maven-build:
 image: maven:3-jdk-8
 stage: build
 tags: my project ci-cd
 script: "mvn package -B"
 artifacts:
 paths:
  - target/*.jar
Patchy answered 10/12, 2019 at 9:46 Comment(1)
Can you please help me in one doubt that How can i create the Shared runner in the Gitlab.. Right now i have created the custom runner and it runs well but my problem is that it depends on my system to create the build(apk) otherwise it becomes fail to runs. Is it possible from the Shared Runner which does not depend on my system to run. Please help me on it..ThanksGreek
H
1

In my case i had to modify the tags in the admin area from 'Tag1, Tag2' to 'Tag1,Tag2'. Spaces caused my issue.

Hailstone answered 12/3, 2022 at 12:17 Comment(0)
S
0

As far as I know, it is not possible for a normal user to check if the shared runners available on a gitlab server are set to only run tagged jobs or not.

I suggest that gitlab add this to information about runners in the CI/CD settings page for projects, i.e. which runners are available, which tags they run AND whether they only run tagged jobs.

Symphonize answered 28/3, 2022 at 11:56 Comment(0)
L
0

The job is stuck because you don't have assigned tags to the runner.

What you can do is go to Settings and edit the Runner and make it able to run jobs tagless.

Lawana answered 13/10, 2022 at 10:28 Comment(0)
B
0

please, double check your service is running

brew services start gitlab-runner // quivalent to gitlab-runner run

Bannon answered 12/12, 2022 at 13:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.