Own-VPS gateway deploy races ourcloud-control-plane.service's post-supply restart, failing on a transient the unit already self-heals from #462
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#462
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?
Failure
Rehearsal drive
20260812T024144Z(rehearsal.idss.nz / droplet 134.199.163.178) red at legcontrol-plane(mislabeledsupplyinartifacts/legs.json— see below).error-context.md:journey leg "control-plane" went red: (no fault line rendered). App-level cause perlogs/founding-state.log:deploying/deploy: gateway deploy failed — The gateway deploy failed.(full-install headline,internal/founding/deploy.go:616).Evidence with file:line cites
test-results/drive-droplet/20260812T024144Z/artifacts/legs.json: legsupplymarked red, but its own founding-state.log messages ("fleet software seeded onto the server — the control plane and dashboard are at their unit paths") show it succeeded. The label is an artifact ofwaitForLegpolling legsupplywhen the fault actually landed on the later legcontrol-plane(race comment atapp/tests/e2e/fixtures/journey.ts:99-105).logs/droplet-journal.txt:1143-1146: at boot (02:49:35),ourcloud-control-plane.servicestarts and immediately fails:ourcloud-control-plane-start: line 26: /srv/ourcloud/bin/control-plane: No such file or directory(exit 127) — the binary hasn't been scp'd in yet byfleetwire.Supply.Seed(internal/fleetwire/supply.go:53-96, run over a separate SSH channel, out-of-band from NixOS activation).logs/droplet-journal.txt:1154-1236: the unit'sRestart=on-failure/RestartSec=5s(declared atinternal/clan/vmguest.go:344-345) retries and fails 6 times, 02:49:35→02:50:07 — this loop is the unit's designed tolerance for the race (see the ADR-0107 comment atinternal/clan/vmguest.go:347-348: "the composition goes WHOLE only once seeding has pushed... before that it rests honestly").logs/droplet-journal.txt:1238-1327: the app's gateway-deploy step invokesswitch-to-configurationat 02:50:08-09, landing squarely inside that restart-loop window. It force-restarts the still-binary-less unit (droplet-journal.txt:1298-1304, same "No such file or directory"), and NixOS's switch-to-configuration treats a failed unit during activation as fatal: both switch attempts exitstatus 4/NOPERMISSION(droplet-journal.txt:1286-1287,1326-1327) — this is what fails the whole deploy.logs/droplet-journal.txt:1411-1436: the unit's own next scheduled restart succeeds cleanly just 4 seconds after the second failed switch attempt (02:50:17 vs 02:50:13) — full control-plane startup logs, no error. The deploy failed on a transient the unit already self-heals from moments later.Suspected layer
Orchestration/timing between
fleetwire.Supply.Seed(out-of-band scp of the control-plane binary, no systemd-visible completion signal) and the own-VPS full-install gateway-deploy trigger (switch-to-configuration, invoked frominternal/founding/deploy.go's deploy flow), racing againstourcloud-control-plane.service's boot-time restart loop (internal/clan/vmguest.go:315-372,gatewayControlPlaneUnit). Not a rendering bug and not a wrong constant — it's a real infra-timing race on the droplet, not reproducible/verifiable from a Go/vitest unit test in this checkout.What plugging it needs
A design decision among (at least):
switch-to-configuration, instead of racing supply's scp.ourcloud-control-plane.service's start withConditionPathExists=/srv/ourcloud/bin/control-plane(skip cleanly pre-supply instead of failing) plus an explicitsystemctl start ourcloud-control-planeissued at the end ofSupply.Seedonce the binary lands — so switch-to-configuration never observes a failed unit.Secondary, non-blocking gap (do not let this substitute for the fix above)
readFault()(app/tests/e2e/fixtures/journey.ts:84-87) only reads[data-field="fault-line"], present only on thejourney-faultpanel. The deploy-failed panel (app/src/components/founding/FoundingDeployOutcome.vue:44-50,data-status="deploy-failed") rendersdata-field="failure-headline"instead, so every future deploy-stage failure will keep showing(no fault line rendered)in drive evidence and error-context.md, even though the droplet journal carries the real reason as shown above. Worth teaching the harness to also readfailure-headlineunder[data-status="deploy-failed"], but that's cosmetic next to the race itself.Note on recurrence
This run's signature (
404124947736) previously resisted a heal on20260811T183121Z(self-fixed via commit99393f9d, an unrelatedOWN_VPS_ORDERshape mismatch). That fix is confirmed present onmain(commit99393f9d27f12bf42244e90d51cb9cc15dacd504). This is a distinct, deeper root cause exposed only after that earlier bug stopped masking it.drive
20260812T024144Zred atsupply:journey leg "control-plane" went red: (no fault line rendered)evidence:
test-results/…/20260812T024144Z/on matou-workstation (legs.json, droplet-journal.txt, trace)CORRECTION — this is NOT a transient race; it is a deterministic bogus-revision bug. Do not add a retry/wait — fix deployRevision.
The title framing (transient the unit self-heals from) is wrong: the deploy-time eval fails the SAME way every attempt, and #461 already added transient-retry to readinessAt which did not help — because this is a deterministic nix parse error, not a race. Reproduced below.
The own-VPS gateway deploy has never actually run — it is preflight-skipped every drive on a bogus revision
Surfaced by #461's
Strict: truefix (drive20260812T024144Z): the gateway deploy now fails loud with the real reason instead of silently succeeding —Root cause
deployRevision(internal/founding/deploy.go:681) returns a placeholder that is not a git SHA:applyControlPlanepasses it asDeployRequest.Revision, andflakeRef(internal/clan/adapter.go:442) turns a non-empty revision into a git flake ref:So
readinessAt's eval (adapter.go:348) runs againstgit+file://<clan-config>?rev=founding-gateway-gateway, and nix parsesfounding-…as an SRI hash<algo>-<rest>→ algorithm"founding"→ error.readinessAttreats the non-zero exit as "node does not evaluate", and the deploy skips the node.Proof (against this run's captured flake, no droplet)
<cfg>=test-results/drive-droplet/20260812T024144Z/state/clan-config.The config is valid; the revision is garbage. This means every own-VPS drive to date has preflight-skipped the deploy (before #461, silently; now, loudly). The control plane is present on the droplet only because the earlier nixos-anywhere install bakes it (
droplet-journal.txtshowsourcloud-control-planeserving the OpenAPI API) — the deploy/reconcile step has been a no-op.Fix
deployRevisionshould return""for the founding/own-VPS deploy, soflakeRefusespath:<dir>— the correct reference for the locally-assembled clan-config (a path tree, not a git checkout at that rev), and the form proven to evaluate cleanly above. (A real committed git SHA would also be valid, but the assembled config isn't a git tree at that rev, sopath:is the right choice.)Confirm nothing else relies on the
founding-gateway-<node>string (it appears to be a placeholder that never resolved).Rollback's revision-scope path is separate and unaffected.Test
deployRevisionreturns""(or a resolvable rev), andflakeRef(dir, deployRevision(n))yields apath:/valid ref, nevergit+file://…?rev=founding-….readinessAtover the assembled clan-config for the single gateway node returnsOK(reuses the eval-the-captured-seed harness from #401) — this would have red-lit the bogus rev without a droplet.clan machines update(the reconcile step runs), rather than landing in the skip path.Advances #378. The next drive is the real reconcile — and if the deploy now runs, control-plane→dashboard→brand→admin→finish are the remaining legs.
swarm-claim host=matou-dev-server-01 run=4920
(automated multi-host claim — lowest live claim id works this ticket)
Implemented ben's ruling (the correction above: deterministic bogus-revision bug, not a transient race — fix
deployRevision, no retry/wait).Commit
327b968dd3235e0bcee28fe13d8443ed7b0c5d29onmain:deployRevision()now returns""soclan.flakeRefresolves the founding gateway deploy topath:<dir>(the locally-assembled clan-config is a path tree, not a git checkout at a rev), instead ofgit+file://…?rev=founding-gateway-<node>which nix rejected asunknown hash algorithm 'founding'— the eval failurereadinessAtwas reading as "node does not evaluate", preflight-skipping the only gateway node every own-VPS drive.RepoHandover.Refin the seeding push, is decoupled ontopushHandoverRef = "HEAD"(PushConfigRepo force-pushes HEAD and never reads the ref — HEAD is the honest provenance).Rollback's revision-scope path is separate and unaffected, as noted.TestDeployRevision_EmptyForPathFlakeRef(revision empty, never thefounding-placeholder) andTestStory26_…updated to the HEAD ref.go test ./internal/founding/... ./internal/fleetwire/... ./internal/clan/...green; golangci-lint/go vet/go build ./...clean.The secondary
readFault()/failure-headlineharness gap is left as-is per the note (cosmetic, explicitly not a substitute for this fix). Advances #378 — the next own-VPS drive is the real reconcile.close-report for #462 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope