Skip to content

Allow runner to start when config directory is not writeable

Pedro Pombeiro requested to merge pedropombeiro/29525/add-log-message into main

What does this MR do?

This MR does the following:

  • adds a warning message with next steps if the runner is not able to persist a .runner_system_id file in the config directory (for example if the runner is running on a Docker container and the volume where the config directory lives is read-only).
  • allows the runner to complete startup (until %16.0) even if the file could not be created, to avoid a breaking change.

Why was this MR needed?

Some customers could not upgrade to %15.7 since the runner failed to start due to lack of permissions.

What's the best way to test this MR?

rm -f ~/.gitlab-runner/.runner_system_id
chmod -w ~/.gitlab-runner/
gitlab-runner run -config ~/.gitlab-runner/config.toml # Should trigger the error message
chmod u+w ~/.gitlab-runner/
echo "s_c2d22f638c26" > ~/.gitlab-runner/.runner_system_id # Run the command suggested in the error message
chmod -w ~/.gitlab-runner/
gitlab-runner run -config ~/.gitlab-runner/config.toml # Should no longer trigger the error message
chmod u+w ~/.gitlab-runner

image

What are the relevant issue numbers?

#29525 (closed)

Edited by Pedro Pombeiro

Merge request reports