NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.34k stars 14.3k forks source link

gitlab-runner configure blows up on config file on nixos-unstable #356717

Open scd31 opened 1 week ago

scd31 commented 1 week ago

Describe the bug

Gitlab runner 7.2 has updated its config to use datetime TOML values instead of strings. The gitlab-runner-configure bash script tries to convert this TOML config into a JSON config so it can manipulate it. This fails because there's no datetime equivalent in JSON.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Be running nixos-unstable (24.05 works fine because it uses Gitlab runner 7.1)
  2. Install/configure gitlab-runner and enable the systemd service
  3. Restart your system
  4. Gitlab-runner has failed to start: Error: Cannot convert data to JSON (Object of type datetime is not JSON serializable)

Expected behavior

Gitlab-runner starts consistently on every reboot

Screenshots

Additional context

The problematic code appears to be here: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/continuous-integration/gitlab-runner.nix#L81

Instead of converting to JSON and back again, I think we want to manipulate the TOML directly

Metadata

NOTE - this is from after I downgraded to 24.05. I could only reproduce the issue on nixos-unstable

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.61, NixOS, 24.05 (Uakari), 24.05.20241115.c21b779`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.8`
 - nixpkgs: `/nix/store/6c854cx4cj43mpdm65yfgkcn8b259hvb-source`

Notify maintainers

@zimbatm @globin @krav @talyz @yayayayaka


Note for maintainers: Please tag this issue in your PR.


Add a :+1: reaction to issues you find important.

Fuuzetsu commented 1 week ago

FWIW I can confirm with newest gitlab-runner (17.6).

Very annoying.