How I solved “New runner. Has not connected yet” in GitLab CI

gitlab-brown-triangle-of-doomI 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

Shares

Published by

Code Review

Code Review

CodeReviewVideos is a video training site helping software developers learn Symfony faster and easier.

6 thoughts on “How I solved “New runner. Has not connected yet” in GitLab CI”

  1. 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!

    1. 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

Leave a Reply

Your email address will not be published. Required fields are marked *