#712 recurred: enroll-copy's shipped ServerAliveInterval=30/CountMax=10 did not terminate a live stalled nix copy, ran the full 90m ceiling — the fix's synthetic proof does not match live behaviour #716
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#716
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 (drive
20260823T213536Z, sig52ef2766d349): rented drive reds atenroll-copyon the leg's own 5400s (90m) ceiling —test-results/drive-rented/20260823T213536Z/artifacts/journey.rented-.../error-context.md. Last activity, unchanged for the rest of the leg:717 of 726 store paths · copying path '/nix/store/p9j469zk8vkclpa4rz3lzy4s85qbialc-sops-install-secrets-0.0.1' to 'ssh-ng://root@170.64.170.228'.... This is the same shape as #711 (98.8% done, then silence) and is the first live recurrence #712 was deferred to wait for.This is not a repeat of #711's root cause — the fix is confirmed present and exercised, and still didn't fire.
internal/clan/enrollment.go:857-880(copy()) andinternal/clan/store_count.go'ssshNGStore(internal/clan/store_count.go:140-177) both carryServerAliveInterval=30/ServerAliveCountMax=10inNIX_SSHOPTS, guarded byTestSSHNGStore_AsksSSHToNoticeADeadPeer— current code, currentmain. On a live network this should turn a dead peer into a named ssh error within ~300s, andcopy()'s failure path (!ok→ emit a fallback message → return,enrollment.go:876-880) is a soft continue, not a leg failure — so the leg should have moved on toenroll-activatewell inside the 90m ceiling even if the copy itself failed. It did not: the DOM's last-activity line never advanced past 717/726, meaning the underlyingnix copysubprocess was genuinely still blocked inside ssh at the 90-minute mark, not killed by the keepalive mechanism that #711/GOTCHAS#67 proved (synthetically) kills it in under a minute.Provider-side evidence pins the stall and rules out an external destroy (pulled live via
doctl/the DO actions API before it aged out further — the run's owndroplet-do-forensics.txtlost the race and only recorded "already gone"):594627426:create21:36:32Z→21:37:02Z, next action isdestroy23:08:38Z→23:08:44Z(started ~1s after the leg's ownendedAt23:08:37.460Z) — no power action of any kind in between. The box was up, per DigitalOcean's own record, for the entire 92-minute leg; nothing provider-side power-cycled, migrated, or reaped it early. The destroy is our own teardown, not an external actor — the earlier "dark box got destroyed mid-transfer" theory does not apply here.21:40–21:44Z(stock-nixpkgs substitute-on-destination fetch), dropping to ~3 Mbps21:48Z(our unsigned custom paths pushing over ssh-ng), tapering 1.19→0.81→0.88→0.65→0.49→0.22 Mbps through21:58–22:08Z, then floor (~0.0005 Mbps) from22:10Zuntil teardown — the transfer stopped ~34 minutes into the 90-minute ceiling; the remaining ~58 minutes bought nothing.ServerAliveInterval=30×CountMax=10should have surfaced a named error by ≈22:15Z. It did not fire for 58 more minutes (or never fired at all — the leg only ended because the outer budget did).One concrete hypothesis was raised and empirically REFUTED, so it can be ruled out: that
internal/clan/cli.go:96-121's env layering (cmd.Env = append(append([]string{}, base...), inv.Env...)) lets a stale ambientNIX_SSHOPTS(inherited viaos.Environ()/ExecEnv,internal/clan/secrets.go:220, which only dedupesSOPS_AGE_KEY_FILE, notNIX_SSHOPTS) shadow the per-call override. Reproduced off-drive with a minimal Go harness mirroring that exact append pattern and a duplicate-keyedcmd.Env:exec.Cmddeduplicates onStart(), keeping the last occurrence, so the per-callNIX_SSHOPTSdoes win even with a stale duplicate present. This is not the mechanism. Also checked and ruled out: noControlMaster/ControlPersist/ServerAlive*override in/etc/ssh/ssh_configorssh_config.d/*.confon the executor host (elitebook-distributed-server-03) that could cause ssh connection multiplexing between the leg's path-info probe and its copy invocation.What's still unexplained, and needs live (not synthetic) reproduction: why
ServerAliveInterval=30/CountMax=10, confirmed wired into the exact code path exercised here, did not terminate a real stallednix copy --substitute-on-destinationagainst a real DigitalOcean network path, when GOTCHAS #67's synthetic relay-freeze reproduction showed termination well inside the window at the same (and stricter) settings. Suggested next steps for whoever picks this up: (1) rent a droplet from the drive's own snapshot/preset, drive the byte-for-bytesshNGStoreinvocation, and induce a REAL mid-transfer network fault (a firewall DROP rule on the target, not a relay freeze) rather than a proxy freeze, to see whether the live network path behaves differently from the relay; (2)tcpdumpthe drive host's outbound traffic during a stalled leg to check whether ssh's keepalive probes are actually being sent and whether they're acked; (3) check whether nix'sssh-ngstore transport re-execssshper-invocation withNIX_SSHOPTSverbatim or reuses/multiplexes a connection across the leg's two ssh-ng calls (the path-info probe inmissingOnTargetthen the copy) in a way that could drop the keepalive options on the second. No ceiling should be widened (GOTCHAS #62) — the mechanism meant to make silence fail loud is the thing that isn't firing.Not self-fixed: this needs live reproduction against real DigitalOcean infra to pin down why the proven fix isn't reproducing its effect, which is outside what this checkout can test. One refuted hypothesis is recorded above so it isn't re-walked.
drive
20260823T213536Zred atenroll-copy:journey leg "enroll-copy" went red: budget of 5400s elapsed at "enroll-copy" — last activity: 717 of 726 store paths · copying path '/nix/store/p9j469zk8vkclpa4rz3lzy4s85qbialc-sops-install-secretsevidence:
test-results/…/20260823T213536Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)enroll-copy's ceiling to a measured rented copy — with #716's drain fix the shared 20mdefaultPhaseTimeoutnow CUTS a cold copy instead of hanging on it #717nix copystill orphans itsssh— #716's drain window freesRun, it does not reap the process tree #718Interim — the "already gone" box was OUR release, and the reproduction is now the next drive
Ruled by agent under ADR 0174 — veto anytime. Landed
c416b78onmain.Who destroyed droplet
594627426at 23:08:38Z: not DO, not the broker's TTL (ledger: rented21:37:06Z,expires+24h), and notoc_rented_teardown(its release answered 400 — already released). It wasjourney.rented.spec.ts's owntest.afterAll, which releases through the broker on every red, inside Playwright — beforeoc_rented_cleanup → oc_droplet_evidenceever ssh-es in. The "1s after the leg" was two 90-minute clocks coinciding (rent + the #698 ceiling). It never consultedREHEARSAL_KEEP_RED_DROPLET, so #704's keep rail could not keep a rented box. That is why #711, #712 and this red all arrived box-less.What that changes about the model: with the box provably up for the whole leg (DO action log) and sshd answering,
ServerAlive*working exactly as designed is the expected outcome — keepalives only catch a peer that answers nothing. The stall is a live box whose nix-daemon stopped moving at ~98% (bandwidth floor from 22:10Z). Candidates the box-side capture will separate: daemon blocked on a remote substituter fetch with nostalled-download-timeoutbite (--substitute-on-destinationmakes the target fetch stock paths), root-disk/inode exhaustion, memory pressure on the 4GB box, a store-lock wait. No fix attempted — none is warranted without that capture (GOTCHAS #62: no ceiling widening).Landed so the next red answers this itself:
fixtures/rented.tsreleaseOnTeardown(records, env)— GREEN always releases; red/hung +REHEARSAL_KEEP_RED_DROPLET=1keeps the box (broker 24h TTL is the failsafe).afterAllconsults it.oc_droplet_evidencewriteslogs/droplet-stall.txton every drive: nix/ssh/sops processes withwchan,free,df / /nix, established:22sockets, temproots,dmesgtail, nix-daemon journal.rehearsal-env.shnow exportsREHEARSAL_KEEP_RED_DROPLET=1.Routing:
deferred(same as #712) and removed from #652's blockers — the standing drive re-fires and IS the reproduction; a red will now leave a live box for a hands-on look (ssh root@<ip>with the run'sstate/rent-operator/id_ed25519). A parallel off-drive reproduction script exists (repro716.sh: rents from image 242422012, pushes the run's toplevel with the exactsshNGStoreinvocation, box-side monitor every 30s) but droplet creation is outside what this session may do — Ben runs it if the drive's own capture is not enough.Close report — the keepalive did not fail to fire; the CEILING fired and could not be heard
Ruled by agent under ADR 0174 — veto anytime. Landed
cf0c1e67onmain, on top of this ticket's other session (c416b78, GOTCHAS #69). Two-way door: a revertible source change ininternal/clan/cli.go, proven red-before-green by Go tests plus live probes on throwaway localhost processes. No credentials, no posture widening, no spend, nothing destroyed.The answer to the question this ticket asked
ServerAliveInterval=30/CountMax=10is wired into the exercised path, and it is not mistuned. It is a transport-liveness probe being asked to detect an application stall, which it cannot do by construction — and even if it had fired,ExecCLI.Runcould not have reported it. Two defects stack, and either alone hid the other.Cause 1 — the ceiling fired and could not speak.
nix copy --to ssh-ng://…spawnssshas a direct child, and ssh inherits nix's stderr — the very pipeExecCLI.Runreads for the combined log and the live progress feed. WhenrunPhase's 20mdefaultPhaseTimeoutcancels the context, os/exec SIGKILLs nix alone; a stalled ssh outlives it holding that pipe,cmd.Waitnever sees EOF, andRunblocks forever on a ceiling it already enforced. No error, noResult, no event, no stage transition — which is exactly why "the DOM's last-activity line never advanced past 717/726".Proven on the real nix process tree (
/proc/<pid>/fd/2read directly —pipe:[524858156]on both nix and ssh, the same object):Waitreturnscmd.Waitstill blockedThat contrast is why this only ever bit the stalled drives, and why no previous investigation caught it.
And in the repo's own terms (
internal/clan/cli_ceiling_test.go— a child that prints one line, forks a grandchild inheriting the pipes, then blocks; 1s ceiling):cmd.WaitDelayRunstill blocked 30s after a 1s ceiling2sRunreturns at 3.0s, rc 137, log intactOn this drive's timeline it closes: the copy's
nixwas demonstrably alive at21:48Z(your own bandwidth series — ~3 Mbps of unsigned custom paths pushing over ssh-ng), so its 20-minute ceiling expired by22:08Zat the latest. The series floors at22:10Z— consistent with our own SIGKILL, not a spontaneous stall — and the leg then ran a further 58 minutes producing nothing.Cause 2 —
ServerAlive*was never the instrument for this. The probes ride the ssh protocol and prove the peer answers. A box that is up, whose sshd answers, but whose nix side has stopped, answers every probe and holds the connection open indefinitely.sshNGStore's own doc comment already said this; #67's calibration caveat already warned the bandwidth floor never proves the box was dead; and DO's "no power action" says the box was up.Proven live — real sshd, real ssh transport, real
nix copyto a real ssh-ng store — by SIGSTOPping the remotenix-daemon --stdiowhile the host stayed up. A freshsshlogin during each stall returnedANSWERING:NIX_SSHOPTSServerAliveInterval=30 -o ServerAliveCountMax=10nix copystill hanging at 421s — no error, last linecopying path '…' to 'ssh-ng://dev@localhost'…, this drive's exact signatureServerAliveInterval=5 -o ServerAliveCountMax=3Tightening the probe changes nothing. #711's fix is correct for the fault it was built for (a peer that goes away) and blind to this one by design.
Cause 3, found by the fix's own test — the combined log was racing. stdout and stderr arrive on separate pipes with separate copy goroutines, and both wrote one unguarded
bytes.Buffer.-race-proven and not theoretical: an eight-line script came back as four characters.Result.Outputis the fieldClassify,logSaysFailedandexcerptall read — a corrupted log is a corrupted diagnosis, on exactly the runs that need one.Your open question (3), settled so nobody re-walks it
nix's ssh-ng store re-execs
sshper invocation withNIX_SSHOPTSverbatim and multiplexes nothing. Live argv, captured mid-copy:No
ControlMaster, noControlPersist, nothing shared between the leg's path-info probe and its copy. That joins the env-layering hypothesis you had already refuted.Questions (1) and (2) — rent a droplet and induce a real network fault;
tcpdumpthe keepalives — are moot: a real network fault is #711's case and already fires correctly; and this stall is not a network fault at all, so there were no unanswered keepalives to capture.Shipped
internal/clan/cli.go:cmd.WaitDelayset from the newexecWaitDelay(10s) — once the process is gone or done, the pipes get that long to drain and are then closed, so a fired ceiling is aResultrather than a silence.ProcessStaterather than the returned error, soexec.ErrWaitDelaycan never demote a genuine exit code to the "could not start" bucket.lockedWriter.Guarded by
TestExecCLI_CeilingEndsTheInvocationEvenWhenAGrandchildHoldsTheOutputPipe,TestExecCLI_DrainWindowDoesNotTruncateAnInvocationThatFinishes,TestExecCLI_CombinedLogSurvivesBothStreamsAtOnce,TestExecCLI_ShipsADrainWindow— all red before, green after. Fullgo test ./...(and./internal/clan -race) +go vet+gofmtclean.Written up as GOTCHAS #70, beside this drive's other defect at #69. No ceiling was widened — #62 holds; this makes an existing ceiling audible for the first time.
What this now looks like on the next rented drive
The copy's 20m ceiling becomes enforceable: at ~20 minutes
nix copyis killed,Runreturns rc 137 within 10s,copy()takes its soft-continue path ("the system could not be copied ahead of the deploy … the deploy will copy it instead"), and the leg walks on toenroll-activatewith ~68 minutes of the 90m budget left instead of burning it in silence.Left open honestly
ready-for-session) — that enforceable 20m ceiling will now cut a cold rented copy: this drive's own was still going at ~28 minutes, at 717 of 726 paths. Cheap by design (copy()is an accelerator), but it is a guess where #68 wants a measurement. #69's keep-on-red +droplet-stall.txtis exactly the rail that measurement should ride.ready-for-agent) — the SIGKILL still orphans thessh(proven above: alive at t+60s). The drain window freesRun; it does not reap the tree. Needs its own red-before-green, since process-group signalling touches every invocation in the package including the PTY-driven ones.Closing: the question this ticket asked is answered, and the defect that produced the red is fixed and tested.
enroll-copy's ceiling to a measured rented copy — with #716's drain fix the shared 20mdefaultPhaseTimeoutnow CUTS a cold copy instead of hanging on it #717