Gitlab-runner 17.5 fails on Debian

Issue After Updating GitLab Runner to 17.5

After upgrading to GitLab Runner version 17.5, we encountered the following error in journald:

Oct 18 10:34:57 supergitlab systemd[1]: Started gitlab-runner.service - GitLab Runner.
Oct 18 10:34:57 supergitlab gitlab-runner[1002832]: FATAL: failed to get user home dir: $HOME is not defined
Oct 18 10:34:57 supergitlab systemd[1]: gitlab-runner.service: Main process exited, code=exited, status=1/FAILURE
Oct 18 10:34:57 supergitlab systemd[1]: gitlab-runner.service: Failed with result 'exit-code'.

Environment Details

The GitLab Runner was installed with the following package configuration:

# apt info gitlab-runner
Package: gitlab-runner
Version: 17.5.0-1
Priority: optional
Section: admin
Maintainer: GitLab Inc. <support@gitlab.com>
Installed-Size: 611 MB
Provides: gitlab-ci-multi-runner
Depends: ca-certificates, git, curl, tar
Suggests: docker-engine
Conflicts: gitlab-runner-beta, gitlab-ci-multi-runner, gitlab-ci-multi-runner-beta
Replaces: gitlab-ci-multi-runner
Homepage: https://gitlab.com/gitlab-org/gitlab-runner
Download-Size: 533 MB
APT-Manual-Installed: yes
APT-Sources: https://packages.gitlab.com/runner/gitlab-runner/debian bookworm/main amd64 Packages
Description: GitLab Runner

Solution

We resolved the issue by creating a systemd service override to define the $HOME environment variable for the GitLab Runner. Here are the steps taken:

  1. Open the systemd override configuration for GitLab Runner:

    sudo systemctl edit gitlab-runner
    
  2. Add the following configuration to /etc/systemd/system/gitlab-runner.service.d/override.conf:

    [Service]
    Environment="HOME=/home/gitlab-runner"
    

This configuration explicitly sets the HOME environment variable, allowing GitLab Runner to locate the user’s home directory and start correctly.


Is this a known bug or is our system behaving oddly?

2 Likes

Same issue here after the update. More than dozen GitLab instances all affected. All running on Debian 11. This fix worked.

1 Like

Same issue on Oracle Linux 9.x. Similar workaround applied. Seems like it is a bug in the 17.5.0.

1 Like

Thanks for this, it has also solved this issue for me on Debian Bookworm, has anyone raised this as an issue for the project?

I have not, I am on the road currently :slight_smile:

Hey all, thanks for your reports! Our on call engineers have identified the issue with the 17.5 runners and are currently working on getting a patch released with the fix. The status page will get updated when that’s ready for you:

In the meantime you can downgrade your runner to 17.4, or wait for the patch and upgrade once it’s out, whichever is your preference.

Thanks for your patience, we’re on it! :slight_smile:

3 Likes

Runner 17.5.1 is now released with a fix for this, so if you were having trouble please give that new version a try.

Have a great weekend!

1 Like