Better messages when a the versions of gitlab and gitlab-runner are incompatible
Summary
I have updated a gitlab runner from 1.11.1 to 9.0.0 it lost its connection to gitlab version 8.17.3. The message from journalctl -u gitlab-runner
does not provide enough information to detect what goes wrong:
Mar 23 11:24:23 Runner2 gitlab-ci-multi-runner[1404]: time="2017-03-23T11:24:23+01:00" level=warning msg="Checking for jobs... failed" runner=xxx status="404 Not Found"
Mar 23 11:24:26 Runner2 gitlab-runner[1404]: time="2017-03-23T11:24:26+01:00" level=warning msg="Checking for jobs... failed" runner=xxx status="404 Not Found"
When I unregister the runner and tried to register it again, I got
ERROR: Registering runner... failed runner=XXXXXXX status=401 Unauthorized
PANIC: Failed to register this runner. Perhaps you are having network problems
None of them help me in finding out the two instances are not compatible and what has happened. I suppose gitlab-runner can check the gitlab version and if the versions are incompatible shows a relevant message. Also in gitlab admin/runners and settings/ci_cd pages the runner is listed as a normal. Here is my gitlab instance:
GitLab 8.17.3
GitLab Shell 4.1.1
GitLab Workhorse v1.3.0
GitLab API v4
Git 2.10.2
Ruby 2.3.3p222
Rails 4.2.7.1
postgresql 9.2.18
and my gitlab runner is on ubuntu 9.0.0 (08a9e6f7)
I was able to fix the problem by downgrading gitlab-runner to 1.11.1 (a67a225c) by sudo apt install gitlab-ci-multi-runner=1.11.1
and unregister/register the runner again