second-phase remote nix build dies with ssh exit 255 mid-deploy — transport death misclassified as a build failure, no retry #563
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#563
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?
Symptom
Headed e2e drive
20260815T043248Z(post-#558/#561, all identity fixes verified in-flight by live process capture): the deploy's control-plane row failed withExit 255 is the ssh client's own failure code, not a nix verdict. Timeline from the capture: first-phase upload/build/boot/switch all green (identity present throughout) → second-phase sops upload over a FRESH ControlMaster socket succeeded → second-phase
nix buildover that same master died 255 mid-run. The guest was healthy before and after: the spec's evidence harvest ssh'd in fine moments later (systemctl --failedclean), no earlyoom (host journal clean, clean systemd stops only), swap never filled.The strongest suspect is the post-switch sshd restart racing the live multiplexed session: the switch settles service restarts asynchronously, and a session opened just before sshd bounces dies mid-command with 255. The same second-phase build succeeded on the manual drive hours earlier — an intermittent race, not a deterministic wall.
Rule
A remote build/apply step that dies with ssh's transport code (255) must be classified as TRANSPORT, not as a build failure — and the deploy's one sanctioned resumable retry (the pattern the enroll legs already carry) should cover it: reconnect (fresh master) and re-drive the step; the second attempt is idempotent (nix builds are). Misclassifying it as "nix build failed" points the operator at evaluation problems that do not exist.
Also (again — #546): the step's failure detail persisted only the one-line summary; the actual clan stderr for the failed call is nowhere on disk.
Proof
Kill the ssh session under a remote build mid-deploy (or restart the guest sshd during it): the deploy classifies transport, retries once on a fresh connection, and the row completes.
Evidence: run dir
test-results/private-path/20260815T043248Z(state/founding-state.json events, artifacts/trace.zip), session ssh-capture log 2026-08-15.Verification: Codebase check confirms the misclassification mechanism.
Classifyin theclanpackage's error-classification path orders its checks: interrupted → connectivity (matches on substrings like"ssh:","connection refused","host key") → config-eval (matches on"failed assertions"or, further down, the generic"error: "/"evaluation"/"attribute"/"does not evaluate"substrings). The reported failure line[gateway] failed with error: nix build failed for 'gateway' (exit code 255).contains"error: "but no"ssh:"token, so it falls through the connectivity case and lands in the generic eval case — exactly the "operator pointed at evaluation problems that do not exist" misclassification described. The exit code itself (255) is never consulted as a classification signal, only the message/log text is. This confirms the bug is real and precisely reproducible against the current classifier, in the same failure family as #558/#561 (same drive lineage, both closedready-for-agent).Agent Brief
Category: bug
Summary: A remote build/apply step whose process exits with ssh's own transport code (255) must classify as a transport/connectivity failure, not a build/eval failure — and get one resumable retry over a fresh connection.
Current behavior:
The clan failure classifier derives its
FailureKindpurely from matching substrings in the invocation's message/log text, never from the raw process exit code. When an ssh-transported remote build dies with exit 255 (the ssh client's own failure code — e.g. because the target's sshd restarts mid-session after a NixOS switch) but the surfaced message is a generic wrapper like"nix build failed for '<node>' (exit code 255)"with no"ssh:"/"connection"/"host key"substring in the visible text, the classifier falls through connectivity-detection and lands in the config-eval bucket. The operator sees "the node's config does not evaluate" and a remedy pointing at fixing Nix config — which is wrong; the guest and its config are both healthy, and the failure is retriable by nature (the underlying build step is idempotent). There is also no retry: every current resumable remedy is driven by classification, so a mis-set kind means no retry happens where one is warranted.Separately (already flagged once, #546): a failed step currently persists only the one-line summary. The full stderr from the failed invocation is not retained anywhere durable, so post-hoc diagnosis of why a step failed has no evidence trail once the operator navigates away.
Desired behavior:
Resumable: true).Tail-style field pattern used elsewhere in the failure structure for exactly this reason — extend that pattern to this step rather than inventing a new one.)Key interfaces:
Classify-shaped function,node/exit/message/logExcerpt → *Failure) — needs an exit-code-driven branch that runs before (or takes precedence over) the generic eval/"error: "substring match, at minimum for exit 255. Consider whether other well-known transport-only exit codes deserve the same treatment, but scope this ticket to 255 unless the fix is trivially general.Failurestruct (or equivalent) — already carries a boundedTailfield for exactly this "full diagnostic text survives even though the summary is short" purpose; use it (or its equivalent) for this step's stderr rather than adding a parallel mechanism.Acceptance criteria:
"nix build failed for '<node>' (exit code 255)") classifies as connectivity/transport, not config-eval.Out of scope:
Ruling (ADR 0174): two-way door — revertible by commit, provable by the existing unit-test suite around the classifier plus the standing rehearsal-drive cron, which will re-exercise this exact deploy path on its next cycle. Same failure family as #558/#561, which were ruled
ready-for-agentand closed. Ruled by agent under ADR 0174 — veto anytime.swarm-claim host=matou-dev-server-01 run=6676
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #563 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope
sopstoken mislabels itmissing_varand eats the transport retry #1210sopstoken mislabels itmissing_varand eats the transport retry #1210config_eval— the one-shot transport retry never fires and the operator is told to fix a flake that is fine #1272