a deploy whose remote switch dies reports only the downstream 502 — nothing harvests the switch unit's journal, so exit 101 arrives with no cause attached #862
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.
Dependencies
No dependencies set.
Reference
Matou/idss#862
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?
Follow-up from #858 (secondary half — the primary fix landed; this is the fail-loud gap it exposed, with one correction to how #858 framed it).
The gap
When the gateway's self-deploy switch died, nothing in the run recorded WHY. The deploy fault carried
deploy failed (setup-error): control plane responded 502and the journal carried a bareclan-switch-gateway-e1e73dab.service: Main process exited, code=exited, status=101. Diagnosing it took hand-reading three drives' journals side by side. A deploy fault should name its own cause (ADR 0027, fail-loud).Correction to #858's proposed shape
#858 suggested "fold the transient unit's own journal (
journalctl -u 'clan-switch-gateway-*') into the deploy fault so the next recurrence names the panic instead of a bare exit code."It will not name the panic. clan-core wraps the remote activation in
systemd-run --pipe --wait --collect(seeinternal/clan/enrollment.go:1083), soswitch-to-configuration's stdout/stderr go to the pipe, not the journal. When the panic is itself caused by that pipe breaking, the panic text is written to the broken pipe and lost. That is whygrep -i panicover all three drives' journals (20260825T071850Z,20260825T164507Z,20260825T212849Z) returns nothing but an unrelated DRM message.What the journal DOES carry is still the whole diagnosis, and is worth harvesting:
— the stop and the death, one second apart, with no
finished switching. Naming that in the fault would have made #858 a five-minute read.Why it did not land with #858
The harvest needs a per-operation SSH target for the node being deployed.
deploy.updateNode(internal/clan/adapter.go:318) has no target —clan machines updateresolves its own — and the target resolver is the ADR 0039 / #163 deferral the deploy seam already declines to fabricate (adapter.go:285-292says exactly this for explicit unit restarts). So this is a real seam extension, not a quick add, and #858 chose not to smuggle it in.What it needs
journalctl -u 'clan-switch-gateway-*' --since <deploy start>harvest over the node's own ssh door, attached to theFailurea deploy update returns when the switch dies non-zero.Adapter.probeCurrentSystem/UnitActivealready use (internal/clan/enrollment.go:1122), rather than a new one.excerptdoes, and keep secrets out — a gateway journal carries unit env.Lower bound, if the above is too big
Even with no remote harvest, the classifier could recognise a
switch-to-configurationexit 101 and say so in words — "the remote switch died at 101 (a switch-to-configuration panic), which on the self-deploy path means it was killed with the unit it stopped — see GOTCHAS #86" — instead of surfacing only the downstream 502. Cheap, no new transport, and it points the next reader at the right entry.deploy-files' switch stopsidss-control-plane, whose cgroup holds theclanCLI, andswitch-to-configurationdies at 101 before it ever restarts anything #858Ruled by agent under ADR 0174 — veto anytime
Ruling: route to
ready-for-agentfor the full journal-harvest (not just the "lower bound" fallback this issue offers) — the per-operation SSH target this issue says is missing already exists for the case this bug actually reports.Correction to the issue's framing: the deploy seam already resolves a per-node SSH target from the clan inventory — the same
Deploy.TargetHostfieldAdapter.UnitActivereads today to reach a node over "the SAME SSH target the deploy reaches it at". That resolution is not gated behind the ADR-0039/#163 mesh-target resolver. #163 (closed) is about Netbird-mesh-enrolled household nodes; the case this issue reports — the gateway's own self-deploy,clan-switch-gateway-*— targets itself at a static loopback address (the box "deploys to its OWN node at root@127.0.0.1"), the exact own-VPS forward-loopback caseUnitActive's own doc comment already covers. So the failingclan machines updateinvocation can resolve the SAME target it just used and open the SAME kind of ssh transportUnitActivealready opens for that node — no new resolver needed.Why this is a two-way door: which transport the harvest reuses is an implementation-shape call, reversible by a later commit, and provable by the seam's own tests —
UnitActive's existing contract tests already prove the transport works for exactly this target class; the harvest gets an equivalent seam test with a scripted CLI/ssh double.What proves it: the inventory-backed target resolution
Adapter.UnitActivealready uses and documents (own-VPS forward loopback included), and the gateway's own self-deploy render, which sets the gateway's deploy target to its own loopback address.Agent Brief
Category: bug
Summary: A deploy fault from a died remote switch names only the downstream symptom (e.g. a 502 / setup-error), never the switch unit's own death — diagnosing it today means hand-reading a node's journal out of band.
Current behavior: When a node's
switch-to-configurationdies non-zero during a deploy update (see GOTCHAS #86 — the self-deploy exit-101 panic), the deploy's Failure carries only the caller-visible symptom (e.g. "control plane responded 502"). The failing unit's own journal — which names the stop/death sequence — is never captured by the deploy itself, so a recurrence needs cross-referencing journals by hand.Desired behavior: When a deploy update's switch step fails non-zero, the resulting Failure should also carry a bounded, redacted excerpt of the failing switch unit's own journal for the deploy's own time window, harvested over the SAME per-node SSH target and host-key/identity discipline the deploy already uses to reach that node (the target
Adapter.UnitActiveresolves from the inventory). The harvest must be bounded in size (mirroring the seam's existing output-bounding helpers) and must never surface raw unit environment values (a gateway journal can carry unit env).At minimum, if the full harvest proves impractical for some node/deploy shape, the failure classifier should at least recognize a
switch-to-configurationnon-zero exit and name it in the Failure's message — e.g. "the remote switch died at exit<n>(a switch-to-configuration panic) — see GOTCHAS #86" — instead of surfacing only the downstream symptom.Key interfaces:
Failuretype'sDetail/Tailfields — where the harvested journal excerpt (or the corrected classifier message) should land.UnitActiveuses) should be reused for the harvest, not duplicated.--since <deploy start>-style window.Acceptance criteria:
switch-to-configurationnon-zero exit as the cause in the Failure's message, rather than surfacing only the downstream symptom.Out of scope:
swarm-claim host=matou-dev-server-01 run=10600
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #862 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope