rig-installed Forgejo runners have their cache server disabled — ProtectHome=read-only vs $HOME/.cache #135
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:bootstrap
scope:coolify
scope:db
scope:docs
scope:drill
scope:installer
scope:labels
scope:platform
scope:runner
scope:users
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/rig#135
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Every runner
rig forgejo-runner installcreates has its cache server disabled, silently. Measured on a live install on 2026-07-31:The cause is rig's own unit hardening,
commands/forgejo-runner-install.sh:ProtectHome=read-onlymakes the whole home read-only, and onlyRUNNER_DIRis punched back through. forgejo-runner's cache server wants$HOME/.cache, which is not underRUNNER_DIR, so it cannot create it and disables itself.Consequence:
actions/cachedoes not work on any rig-installed Forgejo runner. Every workflow that caches silently re-downloads on every run. The only evidence is onelevel=errorline in the journal — andrig forgejo-runner statusreports the runner as healthy, so nothing surfaces it. (That is #133's shape, one layer down: the service is up, the work it is supposed to do is not happening.)Spec
Create the cache directory at install time and punch it through the hardening. Both halves are required — measured, not assumed:
ReadWritePathsalone is not enough. With the path listed but absent, systemd refuses to start the unit at all:Failed to set up mount namespacing: /home/forgejo-runner/.cache: No such file or directory, three restart attempts, service down. That is strictly worse than the current bug.0755, owned by the runner user) and listed inReadWritePaths, the daemon starts clean, the cache-server error is gone, and it binds its listeners:So:
install -d -m 0755 -o "$RUNNER_USER" -g "$RUNNER_GROUP" "$USER_HOME/.cache"beside the existingRUNNER_DIRcreation, andReadWritePaths=${RUNNER_DIR} ${USER_HOME}/.cachein the unit.Keep
ProtectHome=read-only. The point of the hardening is that the runner supervises job containers on this box's docker socket; widening it toProtectHome=tmpfsor dropping it would give back more than the cache needs.Tasks
$USER_HOME/.cacheat install, owned by the runner user, beside the existingRUNNER_DIRinstallReadWritePathstest/cli.sh: the unit carries both paths; the install creates the directorychangelog.d/<n>.mdAcceptance criteria
Could not start the cache serverlineRUNNER_DIRand the cache directory inReadWritePathsProtectHome=read-onlyis unchanged.cacheunder aUser=unit fails the same waybash test/cli.shpasses; CI'sshellcheck -xstep is cleanTest plan
test/cli.shasserts the unit text and theinstall -dcall, in the file's existing grep-the-shipped-bytes idiom.ReadWritePathswithout creating it → the unit does not start (Failed to set up mount namespacing). This is the trap; a test that only greps the unit would call the broken shape correct, so the ordering matters and belongs in a comment.Dependencies
@andres — filed under your standing instruction to file findings. Verified live on this box before writing, including the failure mode of the obvious one-line version.
Post-merge verification of
ce43c02— clean@andres — verified the merge rather than assuming it, since a merge is a new artifact:
git diff a45d848 ce43c02is empty — the merged tree is byte-identical to the head the panel approved; nothing slipped in.main:ReadWritePaths=${RUNNER_DIR} ${USER_HOME}/.cacheat:472, and theinstall -dfor the cache directory at:407.shellcheck -xstep on mergedmain: 34 files, exit 0.main— checked withgit merge-tree, and Forgejo agrees.test/cli.shreads 776/13 on mergedmain, and all 13 are the environmental failures of #136 — this box has a real Forgejo runner installed, soci-box's installer correctly early-exits andbootstrap --undocorrectly refuses. Unmodifiedmainscored the same 13 before this merge. !137 is the fix.Every rig-installed Forgejo runner from this commit forward can start its cache server. Existing runners need one
rig forgejo-runner install --instance <url>to converge — the unit is rewritten only when it differs, and the directory creation is idempotent.