Gitlab runner .runner_system_id doesn't play with cloning - even if nic and hostname are different

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

I have a gitlab-runner as a VM and cloned this so I could have 2 identical runners in our cluster.

The new VM has different NIC settings and different hostname, but otherwise identical filesystem, cleared the runner cache and pruned the images.

However the problem seems to be that gitlab doesn't realise these are separate VM's, runner only lists one machine and the system ID is identical on both machines - even if I stop the service and delete the ./etc/gitlab-runner/.runner_system_id file - restarting it it seems that however gitlab calculates this, it is this and this alone that one identifies runner from another - even if in the same pool... what happens is the last restarted runner gets the rest of the jobs and the other is invisible to gitlab, the runner count for this token always stays at 1... which makes no sense

I've fixed it by manually amending /etc/gitlab-runner/.runner_system_id and then the runner realises it is not part of the same personality and shows your runners discrete again under the same token which is what is expected.

So the issue is the runners method of generating a system_id should really take into account the hostname or MAC address, or the option to generate a new unique one should be possible - what if you wanted dozens of identical runners for instance.

Now I appreciate that k8s runners are better for scaling, and indeed we are using those too, however sometimes a shell based executor in a dedicated VM is helpful for building out images and other heavy tasks - this is our current use case.

[root@runner-03 ~]# cat /etc/gitlab-runner/config.toml
concurrent = 1
check_interval = 0
connection_max_age = "15m0s"
shutdown_timeout = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "runner-03"
  url = "http://XXX.YYY.XXX.ZZZ"
  id = NN
  token = "glrt-abcdefg"
  token_obtained_at = 2024-08-21T11:05:05Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    MaxUploadedArchiveSize = 0
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

OS - Rocky linux 9, latest patch.

[root@runner-03 ~]# gitlab-runner -v
Version:      18.0.1
Git revision: 3e653c4e
Git branch:   18-0-stable
GO version:   go1.23.6 X:cacheprog
Built:        2025-05-16T17:25:38Z
OS/Arch:      linux/amd64

Matching gitlab instance version

Edited by 🤖 GitLab Bot 🤖