ERROR: Registering runner... failed runner=38BUk9-k status=404 Not Found


#1

Hi all!

I’m trying to register a gitlab runner on a new installation of gitlab (based on the omnibus rpm for centos7)
but registration fails like this:

[root@ec2-x.y.z.w ~]#
[root@ec2-x.y.z.w ~]# sudo gitlab-ci-multi-runner register
Running in system-mode.

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://ec2-x-y-z-w.compute-1.amazonaws.com/
Please enter the gitlab-ci token for this runner:
38BUk9-kgZkmmPHz-hsb
Please enter the gitlab-ci description for this runner:
[ec2-x-y-z-w.compute-1.amazonaws.com]: dcos runner 1
Please enter the gitlab-ci tags for this runner (comma separated):
dcos
Whether to run untagged builds [true/false]:
[false]:
ERROR: Registering runner… failed runner=38BUk9-k status=404 Not Found
PANIC: Failed to register this runner. Perhaps you are having network problems
[root@ec2-x-y-z-w ~]#


#2

The error message kinda says it all; your runner cant contaxt your gitlab instance.

Can you ping or wget the gitlab server or gitlab ci endpoint from your runner server / instance?


#3

It certainly seems like an obvious error message, however, I can browse to the URL from the box using a text browser like lynx, for example. I can also curl the URL, here is sanitised output for that:

[root@ec2-x.y.z.w ~]# curl -v http://ec2-x.y.z.w.compute-1.amazonaws.com

GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: ec2-x.y.z.w.compute-1.amazonaws.com
Accept: /

< HTTP/1.1 302 Found
< Server: nginx
< Date: Sun, 26 Feb 2017 20:38:20 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Status: 302 Found
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Location: http://ec2-x.y.z.w.compute-1.amazonaws.com/users/sign_in
< Cache-Control: no-cache
< Set-Cookie: _gitlab_session=328dc71a5ab9c476f7dc6845cf1fbe0c; path=/; expires=Sun, 05 Mar 2017 20:38:20 -0000; HttpOnly
< Set-Cookie: request_method=GET; path=/
< X-Request-Id: 4c938755-52c4-443f-be06-70a5fed07942
< X-Runtime: 0.009606
<

You are being redirected.[root@ec2-x.y.z.w ~]#

#4

FYI, I get the same result when doing the configuration using localhost as the reference URL:

[root@ip-x-y-z-w ~]# gitlab-ci-multi-runner register
Running in system-mode.

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://127.0.0.1:8080/ci
Please enter the gitlab-ci token for this runner:
38BUk9-kgZkmmPHz-hsb
Please enter the gitlab-ci description for this runner:
[ip-x-y-z-w.ec2.internal]:
Please enter the gitlab-ci tags for this runner (comma separated):

ERROR: Registering runner… failed runner=38BUk9-k status=404 Not Found
PANIC: Failed to register this runner. Perhaps you are having network problems


#5

I’ve just installed gitlab-runner on a separate server, in the same security group and VPC - same issue. Definitely not a network issue.


#6

Anyone have any idea ?


#7

I am running into the same error message. I can access the site but I am getting redirected to the sign in page. Is there somewhere I can save my authentication credentials so the runner can access the site?


#8

Same thing for me, using gitlab omnibus docker image, and gitlab/gitlab-runner:latest for the runner : get a :
ERROR: Registering runner… failed runner=XXXXXXXX status=404 Not Found
PANIC: Failed to register this runner. Perhaps you are having network problems

I can curl to the gitlab server url from another container and do get a redirect to login page.


#9

It looks like 404 Not Found is an inaccurately chosen error code coming from this endpoint. In this case it actually means that the GitLab instance attempted and failed to save a new runner.

In fact, for the moment, a 404 indirectly indicates a successful connection to the instance, as well as a valid token.

If you are running a GitLab instance yourself, perhaps it might help to check the production.log at the time of registration to find out why the runner wasn’t saved.


#10

Runners don’t need any credentials other than the token that you enter during the register command.

If the runner connected to the instance but the token is not valid, the error message should look like:
ERROR: Registering runner... forbidden (check registration token)


#11

For people stumbling onto this issue from Google.

I was using gitlab-ci-multi-runner@1.10.0 with the latest EE GDK (10.0) and running into the same 404 error

ERROR: Registering runner... failed                 runner=xxx status=404 Not Found
PANIC: Failed to register this runner. Perhaps you are having network problems

After some pain, I figured out the compatibility chart no longer shows gitlab-ci-multi-runner@1.10.0 compatible with GitLab 10.0. My guess is the API endpoint moved from POST /ci/api/v1/builds/register.json which seems confirmed by https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/merge_requests/517

I had to update gitlab-ci-multi-runner@9.5.0, https://docs.gitlab.com/runner/install/osx.html#update