rented enroll-copy: droplet goes fully dark mid-transfer at 714/723 store paths, before activation ever runs #711

Closed
opened 2026-08-23 18:45:30 +00:00 by matou-build-agent · 1 comment

Failure. Drive 20260823T170734Z reds at enroll-copy (sig 52ef2766d349) on the ceiling waitForLeg throws in app/tests/e2e/fixtures/foundingPrefix.ts:159, budget 90*60_000 from app/tests/e2e/journey.rented.spec.ts:178. legs.json shows enroll-copy ran 5401267ms and the last progress reported was 714 of 723 store paths · copying path '/nix/store/s6biwg0xy7sz1x5vzbihcvinimjmhh5q-etc' to 'ssh-ng://root@170.64.195.77'... (98.75% done) — see artifacts/journey.rented-rented-gate-014d4--on-a-broker-rented-droplet/error-context.md. It never advanced past that path for the remainder of the budget.

The droplet went fully dark, not just slow. Post-drive evidence-gather's separate SSH connections all failed identically: logs/droplet-journal.txt, logs/droplet-caddy.txt, logs/droplet-units.txt each say ssh: connect to host 170.64.195.77 port 22: Connection timed out. I independently re-tested from the healer session, ~2h after the drive ended: both ssh -o ConnectTimeout=5 root@170.64.195.77 and ping -c 3 170.64.195.77 still time out with zero response. A box that's merely busy mid-nix copy still answers a fresh SSH/ICMP probe on a second connection — this one doesn't, at any point since. The box (or its network path) is dead, not congested.

Not the known dark-box bug. GOTCHAS.md #62 (⭐⭐, answered under #703/#704) documents boxes going dark, but specifically during enroll-activate's switch-to-configuration — clan-core's detached remote unit stops networkd and hands the NIC to dhcpcd, which takes a link-local address and blackholes the route. That fix does not apply here: this red is at enroll-copy, strictly BEFORE enroll-activate ever runs (leg order in internal/founding/rentedpath.go:393-396; enroll-configure/enroll-build both went green in this same drive per legs.json, and neither performs an activation — enroll-configure is eval-only per its own label). No switch-to-configuration has executed yet when this box goes dark, so the known networking-handoff regression cannot be the cause. This is a new dark-box signature.

Ruled out as a code regression: internal/clan/enrollment.go:855 already carries --substitute-on-destination (landed by #699, commit da21ec14), so the copy is not naively pushing the full closure from this host — the target is meant to substitute stock nixpkgs itself. c21a86f4 (#709, landed just before this drive at 16:50Z) fixed a separate configure-stage authorized_keys bug and explicitly noted it was unconfirmed live because its own drive's droplet was already reaped — this drive (started 17:07Z) IS that live confirmation, and it got much further than any prior rented drive (past configure/build, deep into copy), so #709's fix is working. The new fault is downstream of both.

Suspected layer: droplet/infra, not app code. Two live hypotheses, neither provable from repo-side evidence since the box is unreachable for forensics:

  1. Target-side resource exhaustion during substitution. --substitute-on-destination makes the DROPLET itself fetch+decompress+verify stock nixpkgs paths from cache.nixos.org — CPU/RAM/disk pressure on a small rented droplet during a large closure's tail end (paths like -etc that depend on nearly everything) could OOM-kill sshd/networking or fill the disk. No dmesg/journal is obtainable to confirm since the box never answers again.
  2. DigitalOcean-side network fault (syd1 region), independent of anything this deploy did.

What plugging it needs: live droplet/DigitalOcean forensics — console access (DO's web console, since SSH is dead), doctl compute droplet get for power/status state, and if reachable via console: dmesg, df -h, journalctl -b for OOM-kill or disk-full evidence, per the same live-forensics need GOTCHAS #62/#703 already established for the activation-stage dark-box case. Until that evidence exists, no code-level fix is evidenced — do not widen the enroll-copy ceiling further (GOTCHAS #62's own rule against timeout-only fixes for a box that may already be gone). A secondary, smaller follow-up worth considering once the root cause is known: internal/clan/store_count.go's sshNGStore sets no ServerAliveInterval/ServerAliveCountMax in NIX_SSHOPTS (store_count.go:154), so a genuinely dead connection hangs silently for the full ceiling instead of failing fast with a diagnosable SSH error — this would sharpen the SIGNAL on the next occurrence but does not address the underlying cause.

drive 20260823T170734Z red at enroll-copy: journey leg "enroll-copy" went red: budget of 5400s elapsed at "enroll-copy" — last activity: 714 of 723 store paths · copying path '/nix/store/s6biwg0xy7sz1x5vzbihcvinimjmhh5q-etc' to 'ssh-ng://ro
evidence: test-results/…/20260823T170734Z/ on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)

**Failure.** Drive `20260823T170734Z` reds at `enroll-copy` (sig `52ef2766d349`) on the ceiling `waitForLeg` throws in `app/tests/e2e/fixtures/foundingPrefix.ts:159`, budget `90*60_000` from `app/tests/e2e/journey.rented.spec.ts:178`. `legs.json` shows `enroll-copy` ran `5401267`ms and the last progress reported was `714 of 723 store paths · copying path '/nix/store/s6biwg0xy7sz1x5vzbihcvinimjmhh5q-etc' to 'ssh-ng://root@170.64.195.77'...` (98.75% done) — see `artifacts/journey.rented-rented-gate-014d4--on-a-broker-rented-droplet/error-context.md`. It never advanced past that path for the remainder of the budget. **The droplet went fully dark, not just slow.** Post-drive evidence-gather's *separate* SSH connections all failed identically: `logs/droplet-journal.txt`, `logs/droplet-caddy.txt`, `logs/droplet-units.txt` each say `ssh: connect to host 170.64.195.77 port 22: Connection timed out`. I independently re-tested from the healer session, ~2h after the drive ended: both `ssh -o ConnectTimeout=5 root@170.64.195.77` and `ping -c 3 170.64.195.77` still time out with zero response. A box that's merely busy mid-`nix copy` still answers a fresh SSH/ICMP probe on a second connection — this one doesn't, at any point since. The box (or its network path) is dead, not congested. **Not the known dark-box bug.** GOTCHAS.md #62 (`⭐⭐`, answered under #703/#704) documents boxes going dark, but specifically during `enroll-activate`'s `switch-to-configuration` — clan-core's detached remote unit stops `networkd` and hands the NIC to `dhcpcd`, which takes a link-local address and blackholes the route. That fix does not apply here: this red is at `enroll-copy`, strictly BEFORE `enroll-activate` ever runs (leg order in `internal/founding/rentedpath.go:393-396`; `enroll-configure`/`enroll-build` both went green in this same drive per `legs.json`, and neither performs an activation — `enroll-configure` is eval-only per its own label). No `switch-to-configuration` has executed yet when this box goes dark, so the known networking-handoff regression cannot be the cause. This is a new dark-box signature. **Ruled out as a code regression:** `internal/clan/enrollment.go:855` already carries `--substitute-on-destination` (landed by #699, commit `da21ec14`), so the copy is not naively pushing the full closure from this host — the target is meant to substitute stock nixpkgs itself. `c21a86f4` (#709, landed just before this drive at 16:50Z) fixed a separate `configure`-stage authorized_keys bug and explicitly noted it was unconfirmed live because its own drive's droplet was already reaped — this drive (started 17:07Z) IS that live confirmation, and it got much further than any prior rented drive (past configure/build, deep into copy), so #709's fix is working. The new fault is downstream of both. **Suspected layer:** droplet/infra, not app code. Two live hypotheses, neither provable from repo-side evidence since the box is unreachable for forensics: 1. **Target-side resource exhaustion during substitution.** `--substitute-on-destination` makes the DROPLET itself fetch+decompress+verify stock nixpkgs paths from cache.nixos.org — CPU/RAM/disk pressure on a small rented droplet during a large closure's tail end (paths like `-etc` that depend on nearly everything) could OOM-kill sshd/networking or fill the disk. No dmesg/journal is obtainable to confirm since the box never answers again. 2. **DigitalOcean-side network fault** (syd1 region), independent of anything this deploy did. **What plugging it needs:** live droplet/DigitalOcean forensics — console access (DO's web console, since SSH is dead), `doctl compute droplet get` for power/status state, and if reachable via console: `dmesg`, `df -h`, `journalctl -b` for OOM-kill or disk-full evidence, per the same live-forensics need GOTCHAS #62/#703 already established for the activation-stage dark-box case. Until that evidence exists, no code-level fix is evidenced — do not widen the `enroll-copy` ceiling further (GOTCHAS #62's own rule against timeout-only fixes for a box that may already be gone). A secondary, smaller follow-up worth considering once the root cause is known: `internal/clan/store_count.go`'s `sshNGStore` sets no `ServerAliveInterval`/`ServerAliveCountMax` in `NIX_SSHOPTS` (`store_count.go:154`), so a genuinely dead connection hangs silently for the full ceiling instead of failing fast with a diagnosable SSH error — this would sharpen the SIGNAL on the next occurrence but does not address the underlying cause. drive `20260823T170734Z` red at `enroll-copy`: `journey leg "enroll-copy" went red: budget of 5400s elapsed at "enroll-copy" — last activity: 714 of 723 store paths · copying path '/nix/store/s6biwg0xy7sz1x5vzbihcvinimjmhh5q-etc' to 'ssh-ng://ro` evidence: `test-results/…/20260823T170734Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596) <!-- rehearsal-sig: 52ef2766d349 -->
Author
Member

Ruled by agent under ADR 0174 — veto anytime. Two-way door: a revertible source change plus a revertible harness addition, proven by a Go contract test and a controlled A/B off-drive. No security-posture widening, no spend, nothing destroyed.

What this red actually was

Not a droplet that died mid-transfer — a nix copy that could not fail.

sshNGStore (internal/clan/store_count.go:154) built NIX_SSHOPTS out of the host-key options, the port and the identity file, and no keepalive. ssh waits on a socket whose peer has stopped answering indefinitely: the connection stays ESTABLISHED and the kernel still ACKs, so nothing below ssh fails either. So when the target went quiet at 714 of 723 paths, nix copy had no way to report it — it could only be killed by the leg's 90m ceiling, having printed nothing since the path it was on. The ticket's "it never advanced past that path for the remainder of the budget" is that, precisely.

Reproduced off-drive, with a relay that forwards 5 MB of a real ssh-ng transfer and then freezes (TCP up, nothing moving — the shape of a peer that stops answering):

NIX_SSHOPTS outcome
today's (no ServerAlive*) still hanging when killed at 300s; last line copying path '…-glibc-2.42-67' to 'ssh-ng://…'…, no error — this ticket's signature, reproduced
+ ServerAliveInterval=5 -o ServerAliveCountMax=3 dead 15s after the stall: Timeout, server 127.0.0.1 not responding. → error: write of 8192 bytes: Broken pipe, rc 1

and at the values shipped (30 × 10), a plain ssh A/B through the same frozen relay: fixed session out at 325s, control carrying today's options still hanging at 741s.

The dark-box diagnosis in the filing does not stand

DigitalOcean's action log for the drive's droplet 594590436:

create   2026-08-23T17:08:31Z
destroy  2026-08-23T18:40:37Z    <- the drive's own teardown, ~37s after the red

No power action of any kind in between — nothing provider-side power-cycled, resized or moved it. Every probe taken after 18:40:43Z was probing a droplet that no longer existed, including this ticket's own re-test (ssh + ping, ~2h after the drive). "Still times out with zero response" two hours later is exactly what a destroyed droplet does, so it proves nothing either way. The three droplet-*.txt timeouts are pre-destroy (evidence-gather is 3 × ConnectTimeout=10, then the reap), so the box was genuinely unreachable at ~18:40 — but that is one reading at minute 60 of the stall, not a death certificate for minute 25.

What survives the destroy: DO's hypervisor-side bandwidth series

The one forensic channel that outlives a reaped droplet (CPU/memory need do-agent; bandwidth is hypervisor-side). For 594590436, public inbound, Mbps:

17:14  14.48   17:22  2.12    17:34  1.59    17:40  0.00015
17:16  11.54   17:24  2.26    17:36  1.10    …     (floor to teardown)
17:18  10.88   17:26  2.35    17:38  0.82
17:20  10.62   17:28  2.38

Read: 14.5 → 10.6 Mbps 17:14–17:20 — the target substituting stock paths from cache.nixos.org itself, exactly what --substitute-on-destination is for (so #699's fix is working as designed); ~2 Mbps 17:22–17:34 — the unsigned custom paths pushing from the drive host; taper 1.6 → 1.1 → 0.8; floor from 17:40 to teardown. The transfer stopped ~25 minutes into a 90-minute ceiling; the remaining ~55 minutes bought nothing. A wider ceiling would have bought only more silence — GOTCHAS #62's rule holds.

Calibration caveat, stated so nobody over-reads it: a live, idle droplet measured the same order at the floor (0.0002–0.0009 Mbps vs the stalled box's 0.0001–0.0003). The series dates when traffic stopped; it cannot say whether the box was alive.

Landed (27880caa)

  • internal/clan/store_count.go — NIX_SSHOPTS carries ServerAliveInterval=30 + ServerAliveCountMax=10. The probes ride the ssh protocol, not the store channel, so a target legitimately idle mid-substitution (fetching from cache.nixos.org, nothing on the channel for minutes) answers them and keeps its connection; only a target that answers nothing for the full 5-minute window loses it. Both ssh-ng invocations — the copy (enrollment.go:855) and missingOnTarget's path-info probe — route through here, so the ticket's suggested secondary fix covers both.
  • internal/clan/store_count_test.go — TestSSHNGStore_AsksSSHToNoticeADeadPeer. Red before, green after.
  • scripts/lib/rehearsal-droplet.sh — oc_droplet_do_forensics, called from oc_droplet_evidence, writes logs/droplet-do-forensics.txt: ICMP, a fresh TCP connect to 22 (dark at the transport, or only to ssh?), the droplet record, DO's action list, and the bandwidth series — before teardown destroys the box. Smoke-tested against a live droplet; every capture degrades to a note if doctl/token/ping are absent, and it never gates teardown. This is the ticket's "what plugging it needs: live droplet/DO forensics", automated so the next occurrence arrives with it attached.
  • docs/GOTCHAS.md #67; STATUS.md header.

Full internal/... suite, go vet, gofmt, bash -n clean.

What is NOT fixed, and where it went

Why the target stopped moving bytes at 98.8% is still unknown, and unrecoverable for this box — it was destroyed 37 seconds after the red, and DO exposes no console-log API. Both hypotheses in the filing (target-side exhaustion during substitution; a syd1 network fault) remain open and unprovable. One counter-datum worth having: the same drive host copied a gateway toplevel to two freshly rented syd1 droplets ~2h later (#710's A/B) with no stall — this is not a reliably reproducible failure of the copy path, so a speculative code change would be a guess.

Filed as #712 (deferred), revisit criterion = the next rented drive that stalls or reds at enroll-copy. That drive will now carry what this one lacked: a named ssh error ~5 minutes after the peer goes quiet, with the path it was on, and droplet-do-forensics.txt beside it — which is what tells the two hypotheses apart on the spot.

Closing #711: the defect it could name and prove is fixed, and the residue is tracked.

**Ruled by agent under ADR 0174 — veto anytime.** Two-way door: a revertible source change plus a revertible harness addition, proven by a Go contract test and a controlled A/B off-drive. No security-posture widening, no spend, nothing destroyed. ## What this red actually was Not a droplet that died mid-transfer — a **`nix copy` that could not fail**. `sshNGStore` (`internal/clan/store_count.go:154`) built `NIX_SSHOPTS` out of the host-key options, the port and the identity file, and **no keepalive**. ssh waits on a socket whose peer has stopped answering *indefinitely*: the connection stays ESTABLISHED and the kernel still ACKs, so nothing below ssh fails either. So when the target went quiet at 714 of 723 paths, `nix copy` had no way to report it — it could only be killed by the leg's 90m ceiling, having printed nothing since the path it was on. The ticket's "it never advanced past that path for the remainder of the budget" is that, precisely. **Reproduced off-drive**, with a relay that forwards 5 MB of a real ssh-ng transfer and then freezes (TCP up, nothing moving — the shape of a peer that stops answering): | `NIX_SSHOPTS` | outcome | |---|---| | today's (no `ServerAlive*`) | still hanging when killed at **300s**; last line `copying path '…-glibc-2.42-67' to 'ssh-ng://…'…`, **no error** — this ticket's signature, reproduced | | `+ ServerAliveInterval=5 -o ServerAliveCountMax=3` | dead **15s** after the stall: `Timeout, server 127.0.0.1 not responding.` → `error: write of 8192 bytes: Broken pipe`, rc 1 | and at the values shipped (`30` × `10`), a plain ssh A/B through the same frozen relay: fixed session out at **325s**, control carrying today's options **still hanging at 741s**. ## The dark-box diagnosis in the filing does not stand DigitalOcean's action log for the drive's droplet `594590436`: ``` create 2026-08-23T17:08:31Z destroy 2026-08-23T18:40:37Z <- the drive's own teardown, ~37s after the red ``` No power action of any kind in between — nothing provider-side power-cycled, resized or moved it. **Every probe taken after 18:40:43Z was probing a droplet that no longer existed**, including this ticket's own re-test (`ssh` + `ping`, ~2h after the drive). "Still times out with zero response" two hours later is exactly what a destroyed droplet does, so it proves nothing either way. The three `droplet-*.txt` timeouts *are* pre-destroy (evidence-gather is 3 × `ConnectTimeout=10`, then the reap), so the box was genuinely unreachable at ~18:40 — but that is one reading at minute 60 of the stall, not a death certificate for minute 25. ## What survives the destroy: DO's hypervisor-side bandwidth series The one forensic channel that outlives a reaped droplet (CPU/memory need `do-agent`; bandwidth is hypervisor-side). For `594590436`, public inbound, Mbps: ``` 17:14 14.48 17:22 2.12 17:34 1.59 17:40 0.00015 17:16 11.54 17:24 2.26 17:36 1.10 … (floor to teardown) 17:18 10.88 17:26 2.35 17:38 0.82 17:20 10.62 17:28 2.38 ``` Read: **14.5 → 10.6 Mbps 17:14–17:20** — the target substituting stock paths from cache.nixos.org itself, exactly what `--substitute-on-destination` is for (so #699's fix is working as designed); **~2 Mbps 17:22–17:34** — the unsigned custom paths pushing from the drive host; taper 1.6 → 1.1 → 0.8; **floor from 17:40 to teardown**. The transfer stopped **~25 minutes into a 90-minute ceiling**; the remaining ~55 minutes bought nothing. A wider ceiling would have bought only more silence — GOTCHAS #62's rule holds. **Calibration caveat, stated so nobody over-reads it:** a live, idle droplet measured the same order at the floor (0.0002–0.0009 Mbps vs the stalled box's 0.0001–0.0003). The series dates *when traffic stopped*; it cannot say whether the box was alive. ## Landed (`27880caa`) - `internal/clan/store_count.go` — `NIX_SSHOPTS` carries `ServerAliveInterval=30` + `ServerAliveCountMax=10`. The probes ride the ssh protocol, not the store channel, so a target legitimately idle mid-substitution (fetching from cache.nixos.org, nothing on the channel for minutes) answers them and keeps its connection; only a target that answers *nothing* for the full 5-minute window loses it. Both ssh-ng invocations — the copy (`enrollment.go:855`) and `missingOnTarget`'s path-info probe — route through here, so the ticket's suggested secondary fix covers both. - `internal/clan/store_count_test.go` — `TestSSHNGStore_AsksSSHToNoticeADeadPeer`. Red before, green after. - `scripts/lib/rehearsal-droplet.sh` — `oc_droplet_do_forensics`, called from `oc_droplet_evidence`, writes `logs/droplet-do-forensics.txt`: ICMP, a **fresh** TCP connect to 22 (dark at the transport, or only to ssh?), the droplet record, DO's action list, and the bandwidth series — **before** teardown destroys the box. Smoke-tested against a live droplet; every capture degrades to a note if doctl/token/ping are absent, and it never gates teardown. This is the ticket's "what plugging it needs: live droplet/DO forensics", automated so the next occurrence arrives with it attached. - `docs/GOTCHAS.md` #67; `STATUS.md` header. Full `internal/...` suite, `go vet`, `gofmt`, `bash -n` clean. ## What is NOT fixed, and where it went **Why the target stopped moving bytes at 98.8%** is still unknown, and unrecoverable for this box — it was destroyed 37 seconds after the red, and DO exposes no console-log API. Both hypotheses in the filing (target-side exhaustion during substitution; a syd1 network fault) remain open and unprovable. One counter-datum worth having: the same drive host copied a gateway toplevel to two freshly rented syd1 droplets ~2h later (#710's A/B) with no stall — this is not a reliably reproducible failure of the copy path, so a speculative code change would be a guess. Filed as **#712** (`deferred`), revisit criterion = the next rented drive that stalls or reds at `enroll-copy`. That drive will now carry what this one lacked: a named ssh error ~5 minutes after the peer goes quiet, with the path it was on, and `droplet-do-forensics.txt` beside it — which is what tells the two hypotheses apart on the spot. Closing #711: the defect it could name and prove is fixed, and the residue is tracked.
matou-build-agent 2026-08-23 19:26:02 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#711
No description provided.