Since upgrading to GitLab Runner 16.6 jobs fail with:
Explicit --user argument required to run as user manager.
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1
Does anyone know what configuration needs to be updated to fix this, I couldn’t find mention of this change in the CHANGELOG.
The runner server is Debian:
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
GitLab runner is installed using the .deb
package:
dpkg -l gitlab-runner
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii gitlab-runner 16.6.0 amd64 GitLab Runner
The systemd unit file at /etc/systemd/system/gitlab-runner.service
contains:
[Unit]
Description=GitLab Runner
ConditionFileIsExecutable=/usr/bin/gitlab-runner
After=syslog.target network.target
[Service]
StartLimitInterval=5
StartLimitBurst=10
ExecStart=/usr/bin/gitlab-runner "run" "--working-directory" "/home/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--user" "gitlab-runner"
Restart=always
RestartSec=120
EnvironmentFile=-/etc/sysconfig/gitlab-runner
[Install]
WantedBy=multi-user.target
The service appears to be running without any problems:
service gitlab-runner status
* gitlab-runner.service - GitLab Runner
Loaded: loaded (/etc/systemd/system/gitlab-runner.service; enabled; preset: enabled)
Active: active (running) since Sun 2023-11-19 15:47:37 UTC; 6s ago
Main PID: 2432321 (gitlab-runner)
Tasks: 13 (limit: 4630)
Memory: 14.8M
CPU: 625ms
CGroup: /system.slice/gitlab-runner.service
`-2432321 /usr/bin/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --user gitlab-runner
gitlab-runner status
Runtime platform arch=amd64 os=linux pid=2434067 revision=3046fee8 version=16.6.0
gitlab-runner: Service is running
And the /etc/gitlab-runner/config.toml
contains:
concurrent = 8
check_interval = 1
user = "gitlab-runner"
shutdown_timeout = 0
[session_server]
session_timeout = 21600
[[runners]]
name = "runner.example.org"
output_limit = 204800
url = "https://gitlab.example.org/"
id = 0
token = "XXX"
token_obtained_at = 0001-01-01T00:00:00Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
environment = ["DOCKER_DRIVER=overlay2"]
[runners.docker]
tls_verify = true
image = "docker:stable"
memory = "8192m"
memory_swap = "8192m"
memory_reservation = "8192m"
cpus = "8"
dns = ["9.9.9.9", "1.1.1.1"]
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache", "/certs/client"]
shm_size = 536870912
This server needs to run containers in privileged mode for systemd, in fact I think the error message might be from systemctl
?
systemctl --help | grep "user service manager"
--user Connect to user service manager