I hit on an issue with GitLab CI whereby newly added GitLab CI Runners would register successfully, but never start a build.
The error message was shown on the Projects > Settings
as a brown triangle with the runner’s ID hash next to it.
The runner itself seemed to be active, but it had the message: “New runner. Has not connected yet” next to it.
Frustrated, I re-installed, re-installed again, tried doing a gitlab-ci-multi-runner register
AND a sudo gitlab-ci-multi-runner register
which only exacerbated the problem.
The Problem
Firstly, note that running a :
gitlab-ci-multi-runner register
does something different to:
sudo gitlab-ci-multi-runner register
Both will create a config.toml
file which may not be immediately obvious.
Normally when you run a command without sudo and it doesn’t work, you would expect it to fail and give a helpful error message.
This is a case of GitLab being flexible, but confusing.
gitlab-ci-multi-runner register
will create a file in your home directory called config.toml
.
sudo gitlab-ci-multi-runner register
will create the file: /etc/gitlab-runner/config.toml
.
My Solution to “New runner. Has not connected yet”
In my case, the solution was to delete the config.toml
in my home directory. That’s the home directory of the user who I was ssh
‘d into the GitLab CI Runner instance.
As soon as I did this, the GitLab runner immediately started – no further intervention required.
If your’s doesn’t, my next course of action would be to delete both config.toml
files, remove any references to that runner from GitLab CI Runner dashboard, and then re-run the command:
sudo gitlab-ci-multi-runner register
thank you
you’re very welcome, I found GitLab CI to be amazing, but not the easiest thing to initially set up. GitLab is flippin’ awesome.
Thank you!
“gitlab-runner register” without the sudo left me in a “New runner. Has not connected yet” state.
Hi, thanks for the post.
I removed the config.toml file from both the home and /etc/gitlab-runner/ directories and it did not resolve this issue.
In addition to that, there is an available specific runner of an old project of mine being shown. (Which I think is not influencing on it)
Would you have any other suggestions? I tried to run gitlab-ci-multi-runner register again, but it did not work.
Thanks a lot!
Hi Joao,
Try the command:
gitlab-ci-multi-runner --debug run
It should give you further output.
It’s a while since I was doing this – if memory serves this video: https://codereviewvideos.com/course/your-own-private-github/video/how-to-use-virtualbox-as-a-gitlab-ci-test-runner documents the process that ultimately worked for me.
In truth I spent at least 4 nights (I remember 4 nights, probably more) fighting GitLab to get this to work. I did *many* things, I can’t remember them all.
Hope that helps in some way,
Chris
Thanks a lot ..
you have solve my problem this command is gr8
“gitlab-ci-multi-runner –debug run”
Glad to hear it, happy to help 🙂
Thanks, this worked for me.
Thanks a lot ..You saved my time. This below commands works for me
“gitlab-ci-multi-runner –debug run”
Yeah, it’s not obvious (in fact, it caught me out again this week) but the –debug flag has to come before the run command. Glad I saved you some time anyway 🙂
Thanks for the blog. I had the same issue. I had run the command without sudo first and that messed up things. But I uninstalled the runner and reinstalled it only using sudo. That solved the issue.
Life saver
Thanks
Ubuntu, this have helped for me
sudo chown -R gitlab-runner:gitlab-runner /home/gitlab-runner
sudo systemctl restart gitlab-runner.service
Thank you for your help. “gitlab-ci-multi-runner –debug run” works well for me.
Thank you, it works!
Thank you so much! it works for me!.
Regards from chile!
Jeez, this took me so much time to figure out. Thanks for this.
Glad I could help. Imagine how many hours collectively are wasted each year as we independently keep re-solving the same problems 🙁
You have saved lots of time mate.. Thank you.. It did worked for me
six years passed…and yet it’s actual