Validation error for custom_build_dir parameter in runner 17.9
Summary
After upgrading to 17.9, I am getting validation errors about custom_build_dir:
There might be a problem with your config based on jsonschema annotations in common/config.go (experimental feature):
Feb 28 15:02:32 perception-ci3 gitlab-runner[1643839]: jsonschema: '/runners/0/custom_build_dir/enabled' does not validate with https://gitlab.com/gitlab-org/gitlab-runner/common/config#/$ref/properties/runners/items/$ref/properties/custom_build_dir/$ref/properties/enabled/type: expected boolean, but got null
My config contained:
# ...
executor = "shell"
[runners.custom_build_dir]
[runners.cache]
# ...
As far as I know this is what was generated for me, I did not add this empty runners.custom_build_dir section. I get the validation error even if I omit the section entirely:
# ...
executor = "shell"
[runners.cache]
# ...
The only way I can stop the validation error is by defining a value for enabled:
# ...
executor = "shell"
[runners.custom_build_dir]
enabled = false
[runners.cache]
# ...
Steps to reproduce
Edit config.toml to include an empty runners.custom_build_dir section or omit it entirely. Tail gitlab-runner systemd service logs and check for validation errors.
Actual behavior
Validation error when my config.toml contains an empty runners.custom_build_dir section or does not contain a runners.custom_build_dir section.
Expected behavior
No validation error unless I've passed an incorrect value for enabled.
Relevant logs and/or screenshots
job log
There might be a problem with your config based on jsonschema annotations in common/config.go (experimental feature):
Feb 28 15:02:32 perception-ci3 gitlab-runner[1643839]: jsonschema: '/runners/0/custom_build_dir/enabled' does not validate with https://gitlab.com/gitlab-org/gitlab-runner/common/config#/$ref/properties/runners/items/$ref/properties/custom_build_dir/$ref/properties/enabled/type: expected boolean, but got null
Environment description
Custom shell executor installation on Ubuntu 22.04.
config.toml contents
concurrent = 1
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "***"
url = "https://gitlab.com"
id = ***
token = "glrt-****"
pre_build_script = "source hil pre-build-script"
post_build_script = "hil post-build-script"
token_obtained_at = 2024-12-11T16:53:25Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "shell"
shell = "bash"
output_limit = 102401
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
Used GitLab Runner version
Version: 17.9.0
Git revision: c4cbe9dd
Git branch: 17-9-stable
GO version: go1.23.2 X:cacheprog
Built: 2025-02-20T00:52:34Z
OS/Arch: linux/amd64