Rollback leaves endo.rev owned by root, wedging every later agent deploy #6
Loading…
Add table
Add a link
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?
After an apply fails its health check, the applier rewinds the NixOS config
checkout as root. The rewind recreates
endo.revas a ROOT-owned file inside acheckout that is otherwise owned by the endo daemon user, and the daemon can
never write it again.
Every subsequent deploy then dies at its very first step:
Observed
Run
r-6f886ae6d099rolled back at 16:40:00 (+09:00). Immediately after:Only
endo.revchanged hands, and its mtime is the exact second of the rewind.The next run,
r-4dfaca4613b8, failed atpinwith the EACCES above.Why it matters
This is self-inflicted and permanent. The rollback exists to leave the host in a
working state, and it does — for the running system. But it silently disables the
agent deploy path, so the recovery mechanism guarantees the next attempt cannot
even start. It needs a human with root to unwedge.
Same shape as the spool jam fixed earlier: a root-run recovery path leaving a
daemon-owned artifact behind as root's.
Expected
After any root-run rewind, the config checkout is owned by the daemon user, so
the next
stageRevworks.Fix
Restore ownership at the end of the rewind, alongside the existing rollback
bookkeeping, rather than leaving it to whoever notices next.
Fixed and applied — generation 14, run
r-75f2f77ad259.rewind_checkoutnow hands the tree back after a successful rewind:The already-broken
endo.revwas repaired separately (unlink + recreate as thedaemon user; content unchanged at
23f9b698…), since the running system stillcarried the root-owned file from the earlier rollback.
Note this fixes the ownership leak, not the rollback itself — the rollback
behaved correctly. The remaining deploy gaps are floot/endo#3 (approval form has
no boolean control) and floot/endo#4 (release built during activation rather
than before approval).