deploy-takeover: the takeover's first phase (kexec) destroys the mesh address it deploys over, so every phase after it reconnects to a dead wt0 and burns the 20-minute ceiling #1011

Closed
opened 2026-08-30 02:32:47 +00:00 by matou-build-agent · 1 comment

Failure

Drive 20260830T014530Z (target device), red at deploy-takeover after 1 313 161 ms; 26 of 27 legs green (artifacts/legs.json, artifacts/verdict.json). Surfaced fault:

deploy failed (resume): the takeover of node-req-0003 stopped: the takeover was cut off mid-run — re-drive it to resume where it stopped, never re-running completed disk work

Signature 800a2936720b. This is the third red on this signature; the two prior heals (0915977a entry-module compose order, ccee5984 control-plane HOME) fixed different faults on the same leg. The remedy sentence is again a severedRemedy (internal/clan/enrollment.go:1746-1752) that misdescribes what happened.

What actually happened

The takeover targets the device's mesh address and its first install phase destroys that address.

  1. The device joins the mesh and the takeover reaches it there. logs/gateway-journal.txt:1874-1875 — 02:02:51, netbird conn.go:410: configure WireGuard endpoint to: 170.64.146.21:51820, then wg_watcher.go:92: WireGuard watcher started. provision.runTakeover sets req.Target = clan.SSHTarget("root@" + d.MeshAddress) — internal/provision/takeover.go:157-158, the wt0 fact (internal/fleetstate/fleetstate.go:137-141), per the comment's ADR 0209 §3 / 0210 cite at internal/provision/takeover.go:143-149 and docs/adr/0209-device-add-landing-goes-live-mesh-fact-fleet-admission.md:24-27.
  2. PhaseKexec runs and kills the mesh. installPhaseOrder is kexec, disko, install, reboot (internal/clan/enrollment.go:291), each its own clan machines install --phases <phase>. logs/gateway-journal.txt:1885 — 02:05:21 wg_watcher.go:129: WireGuard watcher stopped. logs/device-journal.txt:2 — 02:05:23 the box boots init=/nix/store/…-nixos-system-nixos-installer-kexec-25.05pre-git/init. The installer image carries no netbird, so wt0 and the device's 100.x address are gone.
  3. Nothing ever reconnects. logs/device-journal.txt records zero occurrences of the gateway's IP 170.64.168.190 and exactly one Accepted publickey after the kexec — logs/device-journal.txt:1166, 02:26:08, from 179.65.135.113, the drive host's own forensics collector. Everything between 02:05:30 and 02:26:08 is internet scanner noise (2.57.122.168, 92.118.39.71). The gateway made no attempt: to root@100.x the packets have no route now that the peer is down.
  4. The peer stays down for the rest of the run. logs/gateway-journal.txt:1930 (02:12:50) and :1980 (02:22:50) — state_dump.go:79: Dump stat: Status: Connecting, SentOffer: 19 … 33, RemoteAnswer: 0.
  5. No disk work ever ran. logs/device-stall.txt === disk shows only tmpfs 2.0G 18M 1.9G 1% / — no /mnt, no /dev/vda mount. disko never executed; the device is stranded in the ephemeral installer with its old disk untouched.
  6. The phase died on the ceiling, not on an error. logs/gateway-journal.txt:1992 — 02:24:40 level=WARN msg="provision deploy failed" device=node-req-0003. That is 02:04:40 + defaultPhaseTimeout = 20 * time.Minute (internal/clan/enrollment.go:68) — the kexec phase's own invocation, killed while waiting for a host that can never answer on that address. The timeout-kill classifies FailInterrupted, which internal/clan/enrollment.go:765-770 turns into severedRemedy — hence the "cut off mid-run" wording for a connection that was never re-attempted.

Corroboration that the transfer was not the deploy: gateway outbound stays at ~0.05 Mbps through 02:06–02:12 (logs/gateway-do-forensics.txt, outbound series) while the device's inbound runs ~7 Mbps (logs/device-do-forensics.txt, inbound series) — the device was fetching from the public internet, not receiving a store copy from the gateway.

Why #996's preflight does not catch this

internal/clan/enrollment.go:735-750 runs the reachability preflight only if e.a.reachPreflight && s.Target != "" && len(s.DonePhases) == 0 — i.e. before the first phase, when the mesh is still up. It passes, correctly. The address dies during phase 1. internal/clan/adapter.go:110-118 documents the preflight as the cure for "a gateway with no mesh peer"; this is the adjacent and distinct case — a mesh peer that existed and was destroyed by the takeover itself.

Suspected layer

internal/provision (target selection) plus internal/clan (phase-loop reconnect), with an ADR 0209 ruling behind it. Not the app, not the wireframe, not the harness.

What plugging it needs

This needs a design ruling first — ADR 0209 §3 explicitly rules the wt0 address as the takeover deploy target, and that ruling is what the kexec invalidates. The options:

  • Split the target by phase. Keep wt0 for the pre-takeover work (the mesh is the honest address for a landed device) and reconnect the destructive phases on the address that survives a re-image — the probe's captured NetworkFacts.Address already rides into the request (internal/provision/takeover.go:155, clanFacts at :278-285). Open question the ruling must settle: clanFacts is documented as "zero for a LAN/DHCP host", so a DHCP device has no such fact to fall back to.
  • Carry the mesh into the installer so wt0 survives the kexec. A nix/image change to the kexec bundle; also lets the existing single-target contract stand.
  • Fail fast either way. Whatever address is chosen, the phase loop must not spend a 20-minute ceiling on a target that stopped answering mid-run, and must not word that as severedRemedy "re-drive to resume" — a re-drive over the same dead address cannot resume. Extend the #996 preflight (or an equivalent per-phase probe) to the reconnect between phases.

A seam test is reachable for whichever shape is chosen: internal/clan already injects sshRun/reachable doubles and scripts the CLI, so a test can drive kexec-succeeds-then-target-goes-dark and assert the classification and the target actually used; internal/provision/takeover_test.go can lock the per-phase target selection.

Cost of leaving it: the drive re-fires straight into this every tick — a fresh community stood up and a whole run spent to rediscover it, with the takeover ceiling alone burning 20 minutes of paid droplet each time.

drive 20260830T014530Z red at deploy-takeover: deploy failed (resume): the takeover of node-req-0003 stopped: the takeover was cut off mid-run — re-drive it to resume where it stopped, never re-running completed disk work
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260830T014530Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Failure Drive `20260830T014530Z` (target `device`), red at `deploy-takeover` after 1 313 161 ms; 26 of 27 legs green (`artifacts/legs.json`, `artifacts/verdict.json`). Surfaced fault: > deploy failed (resume): the takeover of node-req-0003 stopped: the takeover was cut off mid-run — re-drive it to resume where it stopped, never re-running completed disk work Signature `800a2936720b`. This is the third red on this signature; the two prior heals (`0915977a` entry-module compose order, `ccee5984` control-plane `HOME`) fixed different faults on the same leg. The remedy sentence is again a `severedRemedy` (`internal/clan/enrollment.go:1746-1752`) that misdescribes what happened. ## What actually happened The takeover targets the device's **mesh** address and its **first** install phase destroys that address. 1. **The device joins the mesh and the takeover reaches it there.** `logs/gateway-journal.txt:1874-1875` — 02:02:51, netbird `conn.go:410: configure WireGuard endpoint to: 170.64.146.21:51820`, then `wg_watcher.go:92: WireGuard watcher started`. `provision.runTakeover` sets `req.Target = clan.SSHTarget("root@" + d.MeshAddress)` — `internal/provision/takeover.go:157-158`, the `wt0` fact (`internal/fleetstate/fleetstate.go:137-141`), per the comment's ADR 0209 §3 / 0210 cite at `internal/provision/takeover.go:143-149` and `docs/adr/0209-device-add-landing-goes-live-mesh-fact-fleet-admission.md:24-27`. 2. **`PhaseKexec` runs and kills the mesh.** `installPhaseOrder` is `kexec, disko, install, reboot` (`internal/clan/enrollment.go:291`), each its own `clan machines install --phases <phase>`. `logs/gateway-journal.txt:1885` — 02:05:21 `wg_watcher.go:129: WireGuard watcher stopped`. `logs/device-journal.txt:2` — 02:05:23 the box boots `init=/nix/store/…-nixos-system-nixos-installer-kexec-25.05pre-git/init`. The installer image carries no netbird, so `wt0` and the device's `100.x` address are gone. 3. **Nothing ever reconnects.** `logs/device-journal.txt` records **zero** occurrences of the gateway's IP `170.64.168.190` and exactly one `Accepted publickey` after the kexec — `logs/device-journal.txt:1166`, 02:26:08, from `179.65.135.113`, the drive host's own forensics collector. Everything between 02:05:30 and 02:26:08 is internet scanner noise (`2.57.122.168`, `92.118.39.71`). The gateway made no attempt: to `root@100.x` the packets have no route now that the peer is down. 4. **The peer stays down for the rest of the run.** `logs/gateway-journal.txt:1930` (02:12:50) and `:1980` (02:22:50) — `state_dump.go:79: Dump stat: Status: Connecting, SentOffer: 19 … 33, RemoteAnswer: 0`. 5. **No disk work ever ran.** `logs/device-stall.txt` `=== disk` shows only `tmpfs 2.0G 18M 1.9G 1% /` — no `/mnt`, no `/dev/vda` mount. `disko` never executed; the device is stranded in the ephemeral installer with its old disk untouched. 6. **The phase died on the ceiling, not on an error.** `logs/gateway-journal.txt:1992` — 02:24:40 `level=WARN msg="provision deploy failed" device=node-req-0003`. That is 02:04:40 + `defaultPhaseTimeout = 20 * time.Minute` (`internal/clan/enrollment.go:68`) — the kexec phase's own invocation, killed while waiting for a host that can never answer on that address. The timeout-kill classifies `FailInterrupted`, which `internal/clan/enrollment.go:765-770` turns into `severedRemedy` — hence the "cut off mid-run" wording for a connection that was never re-attempted. Corroboration that the transfer was not the deploy: gateway outbound stays at ~0.05 Mbps through 02:06–02:12 (`logs/gateway-do-forensics.txt`, outbound series) while the device's inbound runs ~7 Mbps (`logs/device-do-forensics.txt`, inbound series) — the device was fetching from the public internet, not receiving a store copy from the gateway. ## Why #996's preflight does not catch this `internal/clan/enrollment.go:735-750` runs the reachability preflight only `if e.a.reachPreflight && s.Target != "" && len(s.DonePhases) == 0` — i.e. **before the first phase**, when the mesh is still up. It passes, correctly. The address dies *during* phase 1. `internal/clan/adapter.go:110-118` documents the preflight as the cure for "a gateway with no mesh peer"; this is the adjacent and distinct case — a mesh peer that existed and was destroyed by the takeover itself. ## Suspected layer `internal/provision` (target selection) plus `internal/clan` (phase-loop reconnect), with an ADR 0209 ruling behind it. Not the app, not the wireframe, not the harness. ## What plugging it needs This needs a **design ruling first** — ADR 0209 §3 explicitly rules the `wt0` address as the takeover deploy target, and that ruling is what the kexec invalidates. The options: - **Split the target by phase.** Keep `wt0` for the pre-takeover work (the mesh is the honest address for a landed device) and reconnect the destructive phases on the address that survives a re-image — the probe's captured `NetworkFacts.Address` already rides into the request (`internal/provision/takeover.go:155`, `clanFacts` at `:278-285`). Open question the ruling must settle: `clanFacts` is documented as "zero for a LAN/DHCP host", so a DHCP device has no such fact to fall back to. - **Carry the mesh into the installer** so `wt0` survives the kexec. A nix/image change to the kexec bundle; also lets the existing single-target contract stand. - **Fail fast either way.** Whatever address is chosen, the phase loop must not spend a 20-minute ceiling on a target that stopped answering mid-run, and must not word that as `severedRemedy` "re-drive to resume" — a re-drive over the same dead address cannot resume. Extend the `#996` preflight (or an equivalent per-phase probe) to the reconnect between phases. A seam test is reachable for whichever shape is chosen: `internal/clan` already injects `sshRun`/`reachable` doubles and scripts the CLI, so a test can drive kexec-succeeds-then-target-goes-dark and assert the classification and the target actually used; `internal/provision/takeover_test.go` can lock the per-phase target selection. Cost of leaving it: the drive re-fires straight into this every tick — a fresh community stood up and a whole run spent to rediscover it, with the takeover ceiling alone burning 20 minutes of paid droplet each time. drive `20260830T014530Z` red at `deploy-takeover`: `deploy failed (resume): the takeover of node-req-0003 stopped: the takeover was cut off mid-run — re-drive it to resume where it stopped, never re-running completed disk work` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260830T014530Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 800a2936720b -->
Owner

RULED B by Ben (2026-08-30) — ADR 0209 amended (3699e016): the kexec installer bundles the mesh client + a fresh single-use MeshMinter setup key (same node-<requestID> identity) and rejoins the plane at installer boot, so the single-target wt0 contract survives the whole takeover. Option A (per-phase public-address split) recorded rejected — NAT'd member devices have no reachable public address by design.

Sliced and armed:

  • #1012 — installer rejoins the mesh (blocks #854)
  • #1013 — phase-loop fail-fast + honest remedy (the mechanical half)

Closing this ticket in the slices' favour; #854's block moved to #1012.

**RULED B by Ben (2026-08-30)** — ADR 0209 amended (`3699e016`): the kexec installer bundles the mesh client + a fresh single-use MeshMinter setup key (same `node-<requestID>` identity) and rejoins the plane at installer boot, so the single-target `wt0` contract survives the whole takeover. Option A (per-phase public-address split) recorded rejected — NAT'd member devices have no reachable public address by design. Sliced and armed: - #1012 — installer rejoins the mesh (blocks #854) - #1013 — phase-loop fail-fast + honest remedy (the mechanical half) Closing this ticket in the slices' favour; #854's block moved to #1012.
ben closed this issue 2026-08-30 02:39:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1011
No description provided.