Skip to content

Improve runner register errors

What does this MR do?

Helps users to solve their problem when the token is valid, but the GitLab instance fails to save a new Runner.

Before

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

The 404 Not Found is the red herring that I'm improving here. The "Perhaps you are having network problems" is also a red herring which I hope to fix in https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/merge_requests/583.

After

ERROR: Registering runner... failed runner=XXXXXXXX status=400 Bad Request
PANIC: Failed to register this runner. Perhaps you are having network problems

Additionally, in the same gitlab-ci-multi-runner MR mentioned above, I print the validation error in the response body.

After with GitLab Runner changes

(with example fictional validation error)

ERROR: Registering runner... failed runner=XXXXXXXX status=400 Bad Request
ERROR: Tags list can not be empty when runner is not allowed to pick untagged jobs.
PANIC: Failed to register this runner.

Why was this MR needed?

From my post in the Gitlab forum:

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.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Edited by username-removed-1144264

Merge request reports