From 7cc19900d80a3d35e83200d15f00d07f60001618 Mon Sep 17 00:00:00 2001 From: oqyude Date: Wed, 14 Oct 2026 19:34:40 +0300 Subject: [PATCH] fix(gitea-runner): move workspace off /mnt/services bind mount to rootfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Workflow runs at 16:04 and 16:11 failed at: mkdir /mnt/services/gitea-runner-work/: read-only file system The bind mount /mnt/services occasionally flips RO during nixos-rebuild activation (transient window while systemd re-creates .mount units). It's back to RW a few seconds later (verified manually at 19:11 as uid 973), but act_runner fails fast — by the time the unit retries the mount is still in its intermittent state, and the job's mkdir dies. Move workspace to /var/lib/gitea-runner/work (rootfs, always RW). 4 GiB eMMC has plenty of room for short-lived job scratch dirs. --- modules/server/gitea-runner.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/server/gitea-runner.nix b/modules/server/gitea-runner.nix index 43c95c5..9df7092 100644 --- a/modules/server/gitea-runner.nix +++ b/modules/server/gitea-runner.nix @@ -67,9 +67,12 @@ in health_check.interval = "5m"; health_check.timeout = "30s"; - # Workspace on external disk — storage guard (above) keeps the - # daemon off an empty bind mount on first boot. - host.workdir_parent = "${xlib.dirs.services-mnt-folder}/gitea-runner-work"; + # Workspace on rootfs (not on the /mnt/services bind mount) — observed + # in 2026-10-14 16:04/16:11 runs that a transient RO remount of the + # bind during nixos-rebuild activation surfaces as + # mkdir …: read-only file system + # to act_runner. Workdir on /var/lib survives activation cycles. + host.workdir_parent = "/var/lib/gitea-runner/work"; # Defence in depth even though host labels never pull images. container.docker_host = ""; @@ -88,11 +91,12 @@ in ]; }; - # ----- Workspace directory on external disk ------------------------------ - # `d` creates if missing; `z` resets ownership if missing — guards the - # race where the external disk is detached mid-rebuild. + # ----- Workspace directory on rootfs -------------------------------------- + # `d` creates if missing; `z` resets ownership if missing. Path is + # /var/lib/gitea-runner/work (rootfs), not on the external bind mount — + # see comment on `host.workdir_parent` above for why. systemd.tmpfiles.rules = xlib.helpers.mkTmpDirs { - dir = "${xlib.dirs.services-mnt-folder}/gitea-runner-work"; + dir = "/var/lib/gitea-runner/work"; mode = "0755"; user = "gitea-runner"; group = "gitea-runner";