This job is stuck, because the project doesn't have any runners online assigned to it. Go to Runners page

Continuous IntegrationGitlabGitlab Ci-Runner

Continuous Integration Problem Overview


I am learning CI/CD.

I have installed Gitlab And Gitlab Runner From Officicals. But whenever running the pipeline during maven-build, the job gets stuck. I have registred runner and 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 Share Runner

My project runner

Error message while runner already associated with project

Jo error message

Please help?

Continuous Integration Solutions


Solution 1 - Continuous Integration

The job is stuck because your runners have tags but 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

Solution 2 - Continuous Integration

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

Solution 3 - Continuous Integration

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.

Solution 4 - Continuous Integration

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

Solution 5 - Continuous Integration

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

Solution 6 - Continuous Integration

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNavigatorView Question on Stackoverflow
Solution 1 - Continuous IntegrationJakub ZárubaView Answer on Stackoverflow
Solution 2 - Continuous Integrationanu guptaView Answer on Stackoverflow
Solution 3 - Continuous IntegrationMohsen AbasiView Answer on Stackoverflow
Solution 4 - Continuous IntegrationMohamed DernounView Answer on Stackoverflow
Solution 5 - Continuous Integrationuser480355View Answer on Stackoverflow
Solution 6 - Continuous IntegrationKári HarðarsonView Answer on Stackoverflow