deploy-takeover is unreachable by construction: the takeover SSHes to the device's wt0 address from a gateway that has no mesh peer (#973 rest) #996

Closed
opened 2026-08-29 19:39:04 +00:00 by matou-build-agent · 3 comments

Failure

Drive 20260829T185347Z (target device) red at deploy-takeover, sig 800a2936720b, at commit ccee5984. 26/27 legs green; the red leg burned 1301444 ms (21m41s) before faulting:

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

The remedy is a misdiagnosis. Nothing was cut off: the takeover's SSH never connected in the first place.

Evidence

1. No SSH ever reached the device during the takeover. The device droplet's sshd logged its last pre-takeover session close at 19:10:37 and its next accept at 19:33:48 — the forensics harvest from the drive host:

  • logs/device-journal.txt:1438 — 19:10:37 … Removed session 11
  • logs/device-journal.txt:1497 — 19:33:48 … Accepted publickey for root from 179.65.135.113

The deploy ran 19:12:14 → 19:32:14 in that gap. Zero accepts, from the gateway or anywhere. The box itself was fine: logs/device-do-forensics.txt — tcp/22: a FRESH connect succeeded.

2. The takeover targets the device's mesh address. internal/provision/takeover.go:157-159:

if d.MeshAddress != "" {
    req.Target = clan.SSHTarget("root@" + d.MeshAddress)
}

and the address is projected at landing — internal/fleetstate/projection.go:285 (d.MeshAddress = f.meshAddr), per ADR 0209 §3 / ADR 0210. The device did land on the mesh: logs/device-units.txt shows netbird holding 100.103.56.212, and logs/device-journal.txt records wt0 up at 19:10:35.

3. The gateway is not on that mesh, so it cannot route there.

  • logs/gateway-units.txt (ss -tlnp) — the gateway lists netbird-mgmt/signal/turn on its public and private v4 addresses and no 100.x listener at all. There is no wt0.
  • logs/gateway-journal.txt — netbird-mesh at 19:07:57 and again 19:30:14: failed to login to Management Service: rpc error: code = PermissionDenied desc = no peer auth method provided, please use a setup key or interactive SSO login.
  • logs/gateway-journal.txt:959 — idss-mesh-self-admit: deferred to #973 (live control-plane mint + rehearsal-d wt0 proof); the peer daemon is ready, the mint is not yet wired — resting.

That rest is deliberate and in-source: internal/clan/netbird.go:439-486 (meshSelfAdmitOneshot) renders the ADR 0214 decision-5 ordering/retry structure for real but its script body echoes the deferral and exit 0 — "Until #973 wires and proves the control-plane self-mint, this oneshot founds no peer". So the gateway never becomes a peer, has no wt0, and has no route to 100.103.56.212.

4. The 20 minutes are the phase ceiling, not work. internal/clan/enrollment.go:67 — defaultPhaseTimeout = 20 * time.Minute; runPhase at :1390-1396 bounds each clan machines install --phases <phase> invocation with it. The deadline signal-kills, classify reads the interrupt, and install (enrollment.go:726-731) takes the FailInterrupted branch → severedRemedy(f) → blocked. With f.Remedy nil, the static sentence at enrollment.go:1592 is what the operator sees. Timing corroborates: the control plane logged provision deploy failed at exactly 19:32:14 (logs/gateway-journal.txt), 20m after the deploy began, and the gateway emitted no progress line for the whole window — only its 5-minute address heartbeats at 19:14:15 / 19:19:15 / 19:24:15 / 19:29:14.

The device also never kexec'd: logs/device-stall.txt shows up 38 min (unbroken since 18:55), still the Ubuntu kernel, /dev/vda1 77G 2.0G used. No disk work started, so nothing is actually resumable — a re-drive re-enters the same unroutable SSH and burns another 20 minutes and another droplet pair.

Suspected layer

A dependency-ordering fault between two landed decisions, not a coding slip in either:

  • ADR 0210 ruling 4 / ADR 0209 §3 have the member-device takeover deploy over the device's own wt0 door (takeover.go:148-159), which presumes the gateway is itself a mesh peer.
  • #973 — the control-plane setup-key mint that would make the gateway a peer — has not landed; meshSelfAdmitOneshot rests honestly in the meantime (internal/clan/netbird.go:466-485).

So the mesh-door takeover path is unreachable by construction on every drive until #973 lands. Nothing in the takeover path notices, because an unroutable TCP connect blackholes rather than refusing, and the phase ceiling converts that into a resumable-looking block.

What plugging it needs

  1. Primary — block on #973. deploy-takeover for a landed member device cannot go green until the gateway founds its own peer and has a wt0 to route from. This drive should be treated as blocked on #973, not re-driven.
  2. Fail fast instead of burning the ceiling. Before the first install phase, the enrollment should confirm the target address is reachable from the driving host, and fault in seconds with a truthful reason ("the gateway has no mesh peer — it cannot reach at its wt0 address") rather than spending 20 silent minutes and then reporting a severed connection that never existed. This is the #590 / ADR 0126 opacity class again, one call site earlier: severedRemedy should not be reachable for a connection that was never established. Actionable without a ruling.
  3. Needs a ruling, do not decide in-ticket: whether the takeover should fall back to the device's probe-captured public/LAN address while the gateway is not a peer, or stay mesh-only and hard-block. That is an ADR 0210 amendment — flag it, do not implement a fallback unilaterally.

A useful cheap tooth for (2): a seam test that a takeover whose EnrollRequest.Target names an address the driver cannot reach faults with an unreachable-target failure, distinct from FailInterrupted/severedRemedy.

drive 20260829T185347Z 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/20260829T185347Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Failure Drive `20260829T185347Z` (target `device`) red at `deploy-takeover`, sig `800a2936720b`, at commit `ccee5984`. 26/27 legs green; the red leg burned **1301444 ms (21m41s)** before faulting: > 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 The remedy is a misdiagnosis. Nothing was *cut off*: the takeover's SSH never connected in the first place. ## Evidence **1. No SSH ever reached the device during the takeover.** The device droplet's sshd logged its last pre-takeover session close at 19:10:37 and its next accept at 19:33:48 — the forensics harvest from the drive host: - `logs/device-journal.txt:1438` — `19:10:37 … Removed session 11` - `logs/device-journal.txt:1497` — `19:33:48 … Accepted publickey for root from 179.65.135.113` The deploy ran 19:12:14 → 19:32:14 in that gap. Zero accepts, from the gateway or anywhere. The box itself was fine: `logs/device-do-forensics.txt` — `tcp/22: a FRESH connect succeeded`. **2. The takeover targets the device's mesh address.** `internal/provision/takeover.go:157-159`: ```go if d.MeshAddress != "" { req.Target = clan.SSHTarget("root@" + d.MeshAddress) } ``` and the address is projected at landing — `internal/fleetstate/projection.go:285` (`d.MeshAddress = f.meshAddr`), per ADR 0209 §3 / ADR 0210. The device did land on the mesh: `logs/device-units.txt` shows netbird holding `100.103.56.212`, and `logs/device-journal.txt` records `wt0` up at 19:10:35. **3. The gateway is not on that mesh, so it cannot route there.** - `logs/gateway-units.txt` (`ss -tlnp`) — the gateway lists netbird-mgmt/signal/turn on its public and private v4 addresses and **no `100.x` listener at all**. There is no `wt0`. - `logs/gateway-journal.txt` — netbird-mesh at 19:07:57 and again 19:30:14: `failed to login to Management Service: rpc error: code = PermissionDenied desc = no peer auth method provided, please use a setup key or interactive SSO login`. - `logs/gateway-journal.txt:959` — `idss-mesh-self-admit: deferred to #973 (live control-plane mint + rehearsal-d wt0 proof); the peer daemon is ready, the mint is not yet wired — resting`. That rest is deliberate and in-source: `internal/clan/netbird.go:439-486` (`meshSelfAdmitOneshot`) renders the ADR 0214 decision-5 ordering/retry structure for real but its script body echoes the deferral and `exit 0` — "Until #973 wires and proves the control-plane self-mint, this oneshot founds no peer". So the gateway never becomes a peer, has no `wt0`, and has no route to `100.103.56.212`. **4. The 20 minutes are the phase ceiling, not work.** `internal/clan/enrollment.go:67` — `defaultPhaseTimeout = 20 * time.Minute`; `runPhase` at `:1390-1396` bounds each `clan machines install --phases <phase>` invocation with it. The deadline signal-kills, `classify` reads the interrupt, and `install` (`enrollment.go:726-731`) takes the `FailInterrupted` branch → `severedRemedy(f)` → blocked. With `f.Remedy` nil, the static sentence at `enrollment.go:1592` is what the operator sees. Timing corroborates: the control plane logged `provision deploy failed` at exactly 19:32:14 (`logs/gateway-journal.txt`), 20m after the deploy began, and the gateway emitted **no** progress line for the whole window — only its 5-minute address heartbeats at 19:14:15 / 19:19:15 / 19:24:15 / 19:29:14. The device also never kexec'd: `logs/device-stall.txt` shows `up 38 min` (unbroken since 18:55), still the Ubuntu kernel, `/dev/vda1 77G 2.0G used`. No disk work started, so nothing is actually resumable — a re-drive re-enters the same unroutable SSH and burns another 20 minutes and another droplet pair. ## Suspected layer A dependency-ordering fault between two landed decisions, not a coding slip in either: - **ADR 0210 ruling 4 / ADR 0209 §3** have the member-device takeover deploy over the device's own wt0 door (`takeover.go:148-159`), which presumes the gateway is itself a mesh peer. - **#973** — the control-plane setup-key mint that would make the gateway a peer — has not landed; `meshSelfAdmitOneshot` rests honestly in the meantime (`internal/clan/netbird.go:466-485`). So the mesh-door takeover path is unreachable *by construction* on every drive until #973 lands. Nothing in the takeover path notices, because an unroutable TCP connect blackholes rather than refusing, and the phase ceiling converts that into a resumable-looking block. ## What plugging it needs 1. **Primary — block on #973.** `deploy-takeover` for a landed member device cannot go green until the gateway founds its own peer and has a `wt0` to route from. This drive should be treated as blocked on #973, not re-driven. 2. **Fail fast instead of burning the ceiling.** Before the first install phase, the enrollment should confirm the target address is reachable from the driving host, and fault in seconds with a truthful reason ("the gateway has no mesh peer — it cannot reach <device> at its wt0 address") rather than spending 20 silent minutes and then reporting a severed connection that never existed. This is the #590 / ADR 0126 opacity class again, one call site earlier: `severedRemedy` should not be reachable for a connection that was never established. Actionable without a ruling. 3. **Needs a ruling, do not decide in-ticket:** whether the takeover should fall back to the device's probe-captured public/LAN address while the gateway is not a peer, or stay mesh-only and hard-block. That is an ADR 0210 amendment — flag it, do not implement a fallback unilaterally. A useful cheap tooth for (2): a seam test that a takeover whose `EnrollRequest.Target` names an address the driver cannot reach faults with an unreachable-target failure, distinct from `FailInterrupted`/`severedRemedy`. drive `20260829T185347Z` 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/20260829T185347Z` 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 -->
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=14016
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=14016 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

Part (2) landed; part (3) flagged, not decided (per the ticket)

Part (2) — fail fast — implemented. The member-device takeover now runs a reachability preflight before the first destructive install phase: a bounded SSH connect (ConnectTimeout=10, 30s ceiling) to the deploy target from the driving host. If nothing answers it faults terminal in seconds with a new FailUnreachable kind and a truthful reason naming the address — never the severedRemedy "cut off mid-run — re-drive to resume", which misdescribed a connection that was never established. This is exactly the ticket's "cheap tooth": the seam test internal/clan/enroll_reachability_test.go asserts an unreachable target faults FailUnreachable with no machines install run and no severedRemedy, distinct from FailInterrupted.

Off by default (WithReachabilityPreflight()), wired on in wiring_prod.go. Reversible, proven offline at the seam — ruled two-way under ADR 0174.

Part (1) — block on #973 — no longer applies. #973 (the control-plane self-mint that founds the gateway's own mesh peer) has since landed (d3b80d7), so the mesh-door takeover path is no longer unreachable by construction. The preflight stands as the honest guard for any future routing gap regardless.

Part (3) — mesh-only vs. probe-address fallback — left un-ruled (ADR 0210 amendment). Whether the takeover should fall back to the device's probe-captured public/LAN address while the gateway is not a mesh peer, or stay mesh-only and hard-block, is an ADR 0210 amendment. Per the ticket ("Needs a ruling, do not decide in-ticket"), I have not implemented a fallback. This remains a design decision for a ruling; the fail-fast fault now makes the mesh-only failure legible in seconds either way.

### Part (2) landed; part (3) flagged, not decided (per the ticket) **Part (2) — fail fast — implemented.** The member-device takeover now runs a reachability preflight before the first destructive install phase: a bounded SSH connect (`ConnectTimeout=10`, 30s ceiling) to the deploy target from the driving host. If nothing answers it faults **terminal** in seconds with a new `FailUnreachable` kind and a truthful reason naming the address — never the `severedRemedy` "cut off mid-run — re-drive to resume", which misdescribed a connection that was never established. This is exactly the ticket's "cheap tooth": the seam test `internal/clan/enroll_reachability_test.go` asserts an unreachable target faults `FailUnreachable` with **no** `machines install` run and **no** severedRemedy, distinct from `FailInterrupted`. Off by default (`WithReachabilityPreflight()`), wired on in `wiring_prod.go`. Reversible, proven offline at the seam — ruled two-way under ADR 0174. **Part (1) — block on #973 — no longer applies.** #973 (the control-plane self-mint that founds the gateway's own mesh peer) has since landed (`d3b80d7`), so the mesh-door takeover path is no longer unreachable *by construction*. The preflight stands as the honest guard for any future routing gap regardless. **Part (3) — mesh-only vs. probe-address fallback — left un-ruled (ADR 0210 amendment).** Whether the takeover should fall back to the device's probe-captured public/LAN address while the gateway is not a mesh peer, or stay mesh-only and hard-block, is an ADR 0210 amendment. Per the ticket ("Needs a ruling, do not decide in-ticket"), I have **not** implemented a fallback. This remains a design decision for a ruling; the fail-fast fault now makes the mesh-only failure legible in seconds either way.
Author
Member

close-report for #996 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 996,
  "status": "success",
  "commits": [
    "831cb15"
  ],
  "changed_files": [
    "STATUS.md",
    "app/helper/cmd/helper/wiring_prod.go",
    "internal/clan/adapter.go",
    "internal/clan/enroll_reachability_test.go",
    "internal/clan/enrollment.go",
    "internal/clan/errors.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/... ./app/helper/...",
      "exit_code": 0
    },
    {
      "command": "go build ./... && go vet ./internal/clan/... ./app/helper/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Fail fast: a takeover to an unreachable target faults in seconds, not the 20-minute phase ceiling": "internal/clan/enrollment.go install() runs Adapter.reachable (ConnectTimeout=10, 30s ceiling) before the first install phase; proven by TestEnroll_UnreachableTargetFaultsFastNotSevered asserting no `machines install` ran",
    "The fault is distinct from FailInterrupted/severedRemedy": "new FailUnreachable kind (internal/clan/errors.go); test asserts StatusFailed + FailUnreachable + Remedy==nil (no severedRemedy)",
    "The reason is truthful and names the unreachable target": "Failure.Summary names s.Target; test asserts the address 100.103.56.212 appears in Summary+Detail",
    "The preflight is a gate, not a wall (a reachable target proceeds)": "TestEnroll_ReachableTargetProceeds drives to StatusDone with the probe run",
    "Part (3) mesh-only-vs-fallback ADR 0210 amendment not decided in-ticket": "flagged in issue comment #30552; no fallback implemented"
  },
  "summary": "The member-device takeover fails fast with a truthful FailUnreachable when its deploy target is unreachable, instead of burning the 20-minute phase ceiling and reporting a severed block for a connection that never existed.",
  "blockers": []
}
**close-report** for #996 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 996, "status": "success", "commits": [ "831cb15" ], "changed_files": [ "STATUS.md", "app/helper/cmd/helper/wiring_prod.go", "internal/clan/adapter.go", "internal/clan/enroll_reachability_test.go", "internal/clan/enrollment.go", "internal/clan/errors.go" ], "tests": [ { "command": "go test ./internal/clan/... ./app/helper/...", "exit_code": 0 }, { "command": "go build ./... && go vet ./internal/clan/... ./app/helper/...", "exit_code": 0 } ], "criteria": { "Fail fast: a takeover to an unreachable target faults in seconds, not the 20-minute phase ceiling": "internal/clan/enrollment.go install() runs Adapter.reachable (ConnectTimeout=10, 30s ceiling) before the first install phase; proven by TestEnroll_UnreachableTargetFaultsFastNotSevered asserting no `machines install` ran", "The fault is distinct from FailInterrupted/severedRemedy": "new FailUnreachable kind (internal/clan/errors.go); test asserts StatusFailed + FailUnreachable + Remedy==nil (no severedRemedy)", "The reason is truthful and names the unreachable target": "Failure.Summary names s.Target; test asserts the address 100.103.56.212 appears in Summary+Detail", "The preflight is a gate, not a wall (a reachable target proceeds)": "TestEnroll_ReachableTargetProceeds drives to StatusDone with the probe run", "Part (3) mesh-only-vs-fallback ADR 0210 amendment not decided in-ticket": "flagged in issue comment #30552; no fallback implemented" }, "summary": "The member-device takeover fails fast with a truthful FailUnreachable when its deploy target is unreachable, instead of burning the 20-minute phase ceiling and reporting a severed block for a connection that never existed.", "blockers": [] } ``` </details>
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#996
No description provided.