GitLab Runner “New runner. Has not connected yet”

Issue: after Runner registration with the correct URL & token, the runner shows the error (see in the subject). I cannot make it n connected.
Gitlab usage mode: GitLab Offline Instance
Gitlab Runner Installation: docker

Hi,

The runner needs to be able to talk to your Gitlab server, most likely on HTTPS port 443 if you have HTTPS configured.

Sounds to me that the runner cannot talk to the Gitlab server, so either there is some sort of firewall between the two servers, or some local firewall (iptables maybe on Linux) where Gitlab or the Gitlab runner is installed which doesn’t allow inbound or outbound connections.

Hi iwalker, great input.

TELNET tested - no firewall.
Used telnet to connect to GilLab server on port 443 and it replied OK.

Docker command
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /srv/certs/.cer:/srv/certs/.cer <registery_url>/docker/gitlab/gitlab-runner:ubuntu-v12.9.1 --debug run 2>&1

Runner debug prints
INFO[0000] listen_address not defined, metrics & debug endpoints disabled builds=0
INFO[0000] [session_server].listen_address not defined, session endpoints disabled builds=0
DEBU[0000] Feeding runners to channel builds=0
DEBU[0000] Starting worker builds=0 worker=0
DEBU[0000] Starting worker builds=0 worker=1
DEBU[0000] Starting worker builds=0 worker=4
DEBU[0000] Starting worker builds=0 worker=2
DEBU[0000] Starting worker builds=0 worker=3
DEBU[0000] Trying to load /srv/certs/.cer …
DEBU[0000] Dialing: tcp <gitlab_url>:443 …
ERRO[0000] Checking for jobs… forbidden runner=5YU-HSpR
DEBU[0003] Feeding runners to channel builds=0
ERRO[0003] Checking for jobs… forbidden runner=5YU-HSpR
DEBU[0006] Feeding runners to channel builds=0
ERRO[0006] Checking for jobs… forbidden runner=5YU-HSpR
ERRO[0006] Runner https://<gitlab_url> 5YU-HSpR4VyE4zuemvxD is not healthy and will be disabled!
DEBU[0009] Feeding runners to channel builds=0
DEBU[0012] Feeding runners to channel builds=0

SOLVED

  1. I corrupted my config.toml, the token entryf. When viewing the token, I noticed that the one on the Gitlab website (same I registered with) and the one in config.toml are different. so I fixed the one in config.toml…
    This should’nt be done, as written by Maxim Geerinck here: Runner on kubernetes returns forbidden, even though token is correct (#2760) · Issues · GitLab.org / gitlab-runner · GitLab

  2. I ran the runner without mounting -v /srv/gitlab-runner/config:/etc/gitlab-runner.
    I thought the runner has an access to the config, somehow.

After doing the registration again and running with the config mount the connection works perfectly.