Registering runner… failed runner (400 Bad Request)

Dipesh Majumdar
2 min readJan 3, 2023

--

Background:

There is a very irritating error while configuring custom gitlab runner (k8s executor) which might occur if you set the maximumTimeout to a value less than 10 minutes.

Error message:

Registering runner… failed runner=GR1348941od8v7GFW status=POST https://gitlab.com/api/v4/runners: 400 Bad Request (maximum_timeout: needs to be at least 10 minutes)

Registration attempt 21 of 30
Runtime platform arch=amd64 os=linux pid=262 revision=133d7e76 version=15.6.1
WARNING: The 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with a 'deploy' command. For more information, see https://gitlab.com/gitlab-org/gitlab/-/issues/380872
Running in system-mode.

Merging configuration from template file "/configmaps/config.template.toml"
ERROR: Registering runner... failed runner=GR1348941od8v7GFW status=POST https://gitlab.com/api/v4/runners: 400 Bad Request (maximum_timeout: needs to be at least 10 minutes)
PANIC: Failed to register the runner.
Registration attempt 22 of 30
Runtime platform arch=amd64 os=linux pid=269 revision=133d7e76 version=15.6.1
WARNING: The 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with a 'deploy' command. For more information, see https://gitlab.com/gitlab-org/gitlab/-/issues/380872
Running in system-mode.

Merging configuration from template file "/configmaps/config.template.toml"
ERROR: Registering runner... failed runner=GR1348941od8v7GFW status=POST https://gitlab.com/api/v4/runners: 400 Bad Request (maximum_timeout: needs to be at least 10 minutes)
PANIC: Failed to register the runner.
Registration attempt 23 of 30
Runtime platform arch=amd64 os=linux pid=291 revision=133d7e76 version=15.6.1
WARNING: The 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with a 'deploy' command. For more information, see https://gitlab.com/gitlab-org/gitlab/-/issues/380872
Running in system-mode.
......
........
...........
.............

Remedy:

Don’t set the below maximumTimeout in values.yaml for the gitlab chart (https://docs.gitlab.com/runner/install/kubernetes.html)

  ## Specify the maximum timeout (in seconds) that will be set for job when using this Runner
##
maximumTimeout: ""

Let that maximumTimeout remain blank. So that the chart will use a default value.

If you set the maximumTimeout to say for example 180 seconds or something then the runner pod will not start and will continuously throw the above mentioned error.

--

--