own-VPS finish: gateway never creates /var/lib/ourcloud before the ledger scp — authority handover fails on the last leg #441
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#441
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?
The last leg of a full own-VPS founding
Run
20260811T185108Z(and183121Zbefore it) drove the ENTIRE own-VPS journey on a real droplet — spec-gate passed, deploy complete, control plane live — and faulted only at the authority handover:The helper scps the enroll ledger to
/var/lib/ourcloud/enroll.jsonon the now-live gateway, but the gateway's NixOS config never creates/var/lib/ourcloud/, so scp fails opening the destination.Fix
Ensure
/var/lib/ourcloud/exists on the gateway before the ledger lands — the durable way is a NixOS declaration in the gateway render (asystemd.tmpfiles.rulesd /var/lib/ourcloud 0700 root root -entry, or the owning service'sStateDirectory=ourcloud), so the dir is present the moment the box is up. (mkdir -p in the scp path just before is the lesser fix; the config declaration is the honest one — the ledger's home is part of the gateway's shape.) Match ownership/mode to what the control plane reads the ledger as.Seam/eval test: the rendered gateway carries the ledger dir (tmpfiles rule or StateDirectory), so a founding that lands the ledger finds its parent.
This is the genuine final tooth: with it (and the false-green harness fix that must not mask it), the next drive completes a founding end to end. Blocks #378.
Fixed in
d765cf6(on origin/main).Root cause: the finish leg's fleet-seeding (
Fleet.SeedLedger) scps the enroll ledger to/var/lib/ourcloud/enroll.jsonon the live gateway and only THEN restarts the control-plane. The render created that dir solely through the control-plane unit'sStateDirectory— which systemd creates on the unit's FIRST start — and the seeding scp precedes that restart, so it died onscp: dest open "/var/lib/ourcloud/enroll.json": No such file or directory. StateDirectory was there all along; it just fires too late for the scp.Fix (the durable one):
renderGatewayGuest(internal/clan/vmguest.go) now declares a boot-timesystemd.tmpfiles.rulesd /var/lib/ourcloud 0700 root root -so the ledger's home exists the moment the box is up, independent of the service; and pins the control-planeStateDirectoryMode = "0700"so the unit's first start does not re-widen the dir the tmpfiles rule created. Root 0700: the control-plane reads the ledger as root (no User=) and the ledger carries identity grants.Seam test:
TestRenderGatewayGuest_LedgerDirExistsAtBoot(internal/clan/vmguest_test.go) pins both the tmpfiles rule and the mode — a founding that lands the ledger finds its parent. Fullgo build/vet+internal/clan,internal/fleetwire,internal/foundingtests green; the pre-push gate ran the whole suite green.Blocks #378; pairs with #440 (false-green harness fix) so a faulted finish cannot read green.