41

We recently started to use GitLab-CI on the gitlab.com free service. At first everything went fine, but now, seems like we can't build our project anymore. The builds are shown as pending and doesn't do anything.

Here's what we have in our builds list:

builds

And if we check the details of a build:

details

As you might notice, in the list, each build is assigned to a runner id, but in the details page, the runner section is blank.

At first, we thought it was just latency caused by gitlab.com ingrastructure, but it's really just stuck there...

EDIT

It's more than 1 year ago but I keep having notifications about this question. If I recall properly, the problem was due to GitLab itself. Follow the GitLab docs and make sure your setup is valid, and hope for the best !

Pascal Boutin
  • 1,220
  • 2
  • 9
  • 22

7 Answers7

25

If you are working with local gitlab-runner, like macOS or custom runner that you have been made, you should start running jobs manually.

Based on this topic on gitlab documentation you should start manually in user-mode or system-mode based on where you executing this command

Run in terminal

If you did not started gitlab-runner yet

gitlab-runner start 

system-mode execution

sudo gitlab-runner run 

user-mode execution

gitlab-runner run 
Mohammad Reza Koohkan
  • 1,656
  • 1
  • 16
  • 36
  • 1
    Thank you! I have my own gitlab-runner on a Linux server and I didnt understand why my jobs were stuck on pending. Starting the runner and actually RUNNING the jobs on the server was my solution. Now to find a way to make it run any job automatically :) – Maarten Apr 28 '21 at 11:36
  • 1
    as soon as your gitlab-runner become started jobs runs automatically. – Mohammad Reza Koohkan Jun 06 '21 at 14:58
  • 1
    Thank you!, I was stuck to this on mac, sudo gitlab-runner run worked for me – Abhinay Gupta Nov 12 '21 at 19:31
11

I was stuck into same issue on my windows machine. I went to event viewer to get some logs of the service and found the error "listen_address not defined".

I followed below steps to fix it.

  1. Go to gitlab repository and edit the runner settings.
  2. You will find checkbox named "Indicates whether this runner can pick jobs without tags"
  3. Make sure the option is checked.

It works for me now.

Chandan Kumar
  • 1,066
  • 10
  • 16
7

My problem was solved after doing the following steps:

  1. Go to your project repository, click on CI/CD and then select pipelines. Try removing the runner cache by clicking on clear runner caches.

    clear runner caches

  2. Verify, start and run your local runners by the doing the following steps on the server you have registered your runners:

    sudo gitlab-runner verify
    sudo gitlab-runner start
    sudo gitlab-runner run
    
Mostafa Ghadimi
  • 5,883
  • 8
  • 64
  • 102
5

GitLab maxed out their shared runners but they have just finished adding more of them. Now GitLab has 12 shared runners. Take a look at this issue: https://gitlab.com/gitlab-org/gitlab-foss/issues/5543#note_3130561

Update

GitLab has moved to auto scaling Runners. If you're still hitting any issues it might be due to a different cause.

Avior
  • 481
  • 6
  • 18
Jose Torres
  • 1,025
  • 11
  • 21
1

Try to clear the Runner cache if you have set it up.

Goto CI/CD>>Pipelines>>on top side >> clear Runner Caches

1

For me, this workaround worked: Pausing and unpausing the runner triggers the pending job to run.

Reference: https://gitlab.com/gitlab-org/gitlab/-/issues/23401

leodotcloud
  • 1,830
  • 14
  • 15
-2

I had the same issue because there were no active runners.

Go to settings > CI CD > Enable shared runners for this project

Sidney Sousa
  • 3,378
  • 11
  • 48
  • 99