GitLab CI builds remains pending
Asked Answered
C

8

44

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 !

Cabriolet answered 6/1, 2016 at 4:55 Comment(3)
would github.com/gitlabhq/gitlab-ci/issues/64#issuecomment-75379083 help?Hemeralopia
We don't use a self-hosted gitlab, we're using the one provided by gitlab.comCabriolet
@PascalBoutin I think it's important you update your question to add that extra bit of info from your commentLydia
M
26

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 
Metsky answered 30/6, 2020 at 18:15 Comment(3)
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 :)Emperor
as soon as your gitlab-runner become started jobs runs automatically.Metsky
Thank you!, I was stuck to this on mac, sudo gitlab-runner run worked for meSwoon
P
13

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
    
Pullen answered 2/10, 2021 at 16:51 Comment(0)
I
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.

Innominate answered 7/8, 2019 at 10:44 Comment(0)
L
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.

Loutitia answered 6/1, 2016 at 21:32 Comment(3)
FYI We currently have 18 shared runners.Loutitia
@JoseTorres do you work for GitLab? otherwise your answer is confusing; would be great if you could clarify thatLydia
@Lydia yes, good point. I've edited the answer so it can stand on it's own.Loutitia
T
2

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

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

Tradeswoman answered 7/4, 2021 at 14:55 Comment(0)
C
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

Copeck answered 4/5, 2022 at 18:14 Comment(0)
B
0

Nothing worked for me other than restarting the Runner:

Linux:

sudo systemctl restart gitlab-runner

Windows:

sc stop "GitLab Runner"
sc start "GitLab Runner"

MacOS:

sudo gitlab-runner restart

BUT if you get the error:

FATAL: Failed to start gitlab-runner: "launchctl" failed with stderr: Load failed: 5: Input/output error

You can refer to this answer to re-install the Runner completely (or any other answer in that SO link that suits you):

gitlab-runner uninstall
gitlab-runner install
gitlab-runner start
Baptist answered 9/11, 2023 at 8:37 Comment(0)
D
-2

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

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

Diaghilev answered 20/1, 2023 at 15:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.