enroll-activate calls the switch finished off /run/current-system, so the deploy's switch-to-configuration boot collides with the still-running switch and exits 11 #1009
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#1009
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
Drive
20260830T002134Z(targetdevice) red at legstanding(and its inneractivationleg), signature25304f657c24, commitd1870664. Operator-facing text: the gateway deploy failed — The gateway deploy failed.15 of 17 legs green.
enroll-activatereturned green, then the very nextdeploy/activationwork died.What actually killed it
The deploy's remote
switch-to-configuration bootnever ran — it could not take the NixOS switch lock, because the previous leg's switch was still running on the box.From
logs/founding-state.log(standup.deploy.failure.tail), the CLI's own transcript:The box's own journal,
logs/gateway-journal.txt, gives the collision precisely::1202-1203—00:34:21clan-switch-gateway-15495c5e.servicestartsswitch-to-configuration switch(this is the enroll-activate leg's switch).:1258,:1274—00:34:22-00:34:23PID 1885 (.switch-to-conf) requests systemd reexec + reload — i.e. the activation script phase, which is where/run/current-systemis flipped.:1347-1351—00:37:18the deploy'sclan-boot-gateway-834da81d.servicestarts andMain process exited, code=exited, status=11/n/ain the same second.:1854,:1891—00:37:28, i.e. ten seconds after the deploy already failed, PID 1885's switch is still in its unit-start phase, startingidss-mesh-self-admit.service.And
logs/gateway-stall.txt(captured00:37:41) still lists both the wrapper and the switch alive:So the switch from
enroll-activateheld/run/nixos/switch-to-configuration.lockfor at least 3m20s, spanning the whole deploy attempt.Suspected layer — the completion signal is false
internal/clan/enrollment.gotreats/run/current-system == s.Toplevelas proof the switch finished. It is not: that symlink is written by the activation script, which runs before the stop/start unit phase. Two sites share the bad signal, both fed byprobeCurrentSystem(internal/clan/enrollment.go:1263-1283):internal/clan/enrollment.go:1181-1188— the #714 post-interrupt completion probe. Onerr == nil && current == s.Toplevelit emits "the switch finished on the box after the interrupted activate — /run/current-system matches the built system; the node is a clan member" and returns green.internal/clan/enrollment.go:1234-1250— the #992 watchdog. Comment at:1240states "The switch is DONE on the box", then afteractivateWatchdogGrace(90s,:108) it cancels the CLI and emits the reap message at:1248.Both fired this run —
founding-state.logstandup.eventscarries the reap sentence and the completion sentence back to back. The leg then reported the node a clan member while the box's switch had minutes of unit-starting left, and the pipeline immediately ran a secondclan machines updateinto the held lock.Note also that the switch was genuinely slow, not merely un-awaited:
gateway-journal.txt:1310shows the user-sessiondbus-broker.service: Reload operation timed out. Killing reload process.burning ~90s at00:35:54, with another ~83s of silence before the unit-start phase resumed at00:37:18.Second, smaller defect — the failure is labelled as the wrong hazard
switchDeathNote(internal/clan/adapter.go:485-489) hard-codes one sentence for every non-zero switch exit found byswitchExitFromLog(:461-482):Exit 11 here is a lock collision, not a panic; GOTCHAS #86's panic is exit 101 (
docs/GOTCHAS.md, #86). The operator — and the next healer — are pointed at the wrong hazard by a message that asserts a cause it did not establish.What plugging it needs
/run/current-systemmatching is necessary but not sufficient. The switch is done only when the remote activation unit has exited — probeclan-switch-*/clan-boot-*(Adapter.UnitActive,internal/clan/adapter.go:210, already speaks the right ssh/host-key discipline) or check the switch lock directly. Both call sites atenrollment.go:1183and:1237need it; the watchdog must not reap on the symlink alone.enroll-activatemust either wait it out under a named bound or block resumable naming the in-flight switch — rather than returning green. This is the one judgement call; existing ceilings inenrollment.go(activateWatchdogInterval/activateWatchdogGrace,:107-108, andactivateCeiling()) are the reference points.Could not acquire lock→ exit 11 should be classified as a collision (retry once the lock frees), not routed throughswitchDeathNote. GateswitchDeathNoteon the panic code it actually describes, or have it name the observed exit without asserting GOTCHAS #86.Why this was not self-healed
artifacts/host.jsonrecords"qemu": "exit ENOENT: spawn qemu-system-x86_64 ENOENT"— there is no box here. A Go test would assert against a fake ssh, i.e. against my own account of whenswitch-to-configurationwrites/run/current-system, not against the real thing.25304f657c24already resisted a heal one drive ago (20260829T213942Z, commit9ef8509a). That heal gaveidss-mesh-self-admita bounded wait for the netbird plane — visible working as intended here atgateway-journal.txt:1891-1997— but it lengthens the unit-start phase that holds this lock, so it plausibly widened this collision window rather than causing it.drive
20260830T002134Zred atstanding:the gateway deploy failed — The gateway deploy failed. [There is no old operating system to roll back to — this server was rented fresh for the community, so nothing of yours was overwritten.]evidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260830T002134Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedswarm-claim host=elitebook-distributed-server-03 run=14200
(automated multi-host claim — lowest live claim id works this ticket)
Ruled by agent under ADR 0174 — veto anytime.
Item 2 of the ticket ("decide the budget for a still-running switch") is the one judgement call. Ruling: when the completion probe finds
/run/current-systemmatching the built toplevel but aclan-switch-*/clan-boot-*activation unit STILL running, enroll-activate blocks resumable naming the in-flight switch — it never returns green on the symlink alone. The#992watchdog waits the switch out under the existingactivateCeiling()(it keeps the ceiling as arbiter while the switch is in flight and reaps only once the unit has exited), so no new wait-budget constant is introduced. An unreadable in-flight probe also blocks resumable rather than greening (a symlink match is not completion).Why a two-way door: the choice is entirely a behaviour policy inside
internal/clan— revertible by a later commit (e.g. to switch to an in-process bounded wait, or to add a dedicated budget constant) with no external residue. It touches no personal credential, no security-posture widening, no member-facing trust accept, no data destruction, and no spend. It only ever downgrades a previously-green leg to an honest resumable block — strictly safer than the false green it replaces.What proves it: offline seam tests against a scripted ssh double —
TestEnroll_InterruptedActivateBlocksWhileSwitchStillRunningUnits,TestEnroll_InterruptedActivateBlocksWhenInflightProbeUnreadable,TestEnroll_ActivateWatchdogNeverReapsWhileSwitchStillStartingUnits(all red before the fix). LIVE confirmation (a generation-apart switch that greens only after the box's activation unit exits) rides the next paiddrive-devicepaststanding, recorded as named residue.close-report for #1009 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope