ERROR: Registering runner... failed
Summary
Cannot register gitlab-runner with self-hosted GitLab EE, HTTP 500 code.
However gitlab-runner register does work with gitlab.com accounts.
Steps to reproduce
Direct API Method:
Call the API of the self-hosted GitLab server directly with curl.
curl --request POST "https://gitlab2.example.com/api/v4/runners" --form "token=3K9F7yWu" --form "description=test-1-20150125-test" --form "tag_list=ruby,mysql,tag1,tag2"
Manual Method:
Gitlab host must be self-hosted v11.8.1-ee
On gitlab runner attempt to register with URL and gitlab-ci token.
Fatal Error is thrown.
Verify nginx access logs on GitLab host to confirm HTTP 500 server error.
[ON RUNNER]
$ gitlab-runner register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://gitlab2.example.com/
Please enter the gitlab-ci token for this runner:
3K9F7yWu
Please enter the gitlab-ci description for this runner:
[ubuntu-gitlab-runner01]:
Please enter the gitlab-ci tags for this runner (comma separated):
ERROR: Registering runner... failed runner=3K9F7yWu status=500 Internal Server Error
PANIC: Failed to register this runner. Perhaps you are having network problems
[ON GITLAB HOST]
$ gitlab-ctl tail nginx
==> /var/log/gitlab/nginx/gitlab_access.log <==
[12/Mar/2019:02:00:57 +0000] "POST /api/v4/runners HTTP/1.1" 500 39 "" "gitlab-runner 11.8.0 (11-8-stable; go1.8.7; linux/amd64)"
What is the current bug behavior?
gitlab-runner register does not complete with self-hosted GitLab EE.
What is the expected correct behavior?
gitlab-runner register should complete.
Results of GitLab environment info
GitLab runner environment info. Ubuntu 18 host.
gitlab-runner: Version: 11.8.0 Git revision: 4745a6f3 Git branch: 11-8-stable GO version: go1.8.7 Built: 2019-02-22T08:01:16+0000 OS/Arch: linux/amd64
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.4 ? ... OK (8.4.4) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 1/1 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 1 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
Not sure yet. Need to investigate what is going on at the web API level.