10

So our GitLab Runner was running fine for a few weeks now. I had to do some upgrades that required a reboot on the machine where it is installed.

After rebooting it no longer picks up jobs automatically. All my pipelines say they're stuck because there are no runners that could pick the jobs up.

I SSH'd into the machine and ran

sudo gitlab-runner run

and the jobs get picked up as I expect them to be. However when I press CTRL + C it stops any picked up jobs and stops picking up any other jobs again. How do I fix this so that it's back to how it was before the reboot?

Additional Info

When I ran

sudo gitlab-runner start

I got an error saying: FATAL: Failed to start gitlab-runner: "systemctl" failed: exit status 5, Failed to start gitlab-runner.service: Unit gitlab-runner.service not found.

A similar error also popped up when I ran

sudo gitlab-runner restart
dokgu
  • 4,957
  • 3
  • 39
  • 77

1 Answers1

23

So from the error message above it's saying the service isn't installed yet (not sure why). Running

gitlab-runner status

does say gitlab-runner: Service is not installed.

So I did

gitlab-runner install -u gitlab-runner

I'm not sure whether gitlab-runner is the default user that was used before this issue came up but I'll just use that here for now at least.

After installing the service I just issued

gitlab-runner start

And the jobs are getting picked up automatically again.


My only guess as to why this happened is because I ran apt-get upgrade which tried to upgrade all components with an update available which of course updated our version of GitLab Runner. Somehow that uninstalls the service? I'm not sure.

dokgu
  • 4,957
  • 3
  • 39
  • 77
  • I've tried to install it and it gives me: ``` # gitlab-runner install -u gitlab-runner Runtime platform arch=amd64 os=linux pid=170 revision=8925d9a0 version=14.1.0 FATAL: Failed to install gitlab-runner: Init already exists: /etc/init.d/gitlab-runner ``` – Rodolfo Jul 27 '21 at 20:12
  • @Rodolfo I'm not overly familiar with Linux so I'm just guessing here: perhaps gitlab-runner is already installed, just not running yet.. what does `gitlab-runner status` tell you? Maybe just do `gitlab-runner start` and see if that works for you. – dokgu Jul 28 '21 at 13:47
  • 3
    I'm running it in a docker container, when I run `gitlab-runner status` it gives me `gitlab-runner: Service is not installed` – Rodolfo Jul 28 '21 at 17:43
  • for more detail, you can check on the documentation https://docs.gitlab.com/runner/install/linux-manually.html#using-binary-file – Arian Saputra Jan 14 '22 at 03:20