enroll-activate: SSH never came back after nixos-anywhere reboot (own-VPS frontier) #426

Closed
opened 2026-08-11 00:40:16 +00:00 by ben · 1 comment
Owner

Failing leg

enroll-activate — the drive threw:

JourneyFailure: journey leg "enroll-activate" went red: budget of 1200s elapsed at "absent"

(legs.json is [] and artifacts/journey.json is {"rows": null, "fault": null} for this run — the per-leg ledger the harness normally writes never got populated; see "Harness defects" below. What actually shows what happened is state/founding-state.json and the app's own fault frame, captured in the Playwright error-context snapshot.)

Evidence

state/founding-state.json records the standup reaching enroll-configure, completing install, then failing to reconnect:

"install · reboot: reboot complete"
...
"could not reach the node: [gateway] ssh: connect to host 168.144.172.115 port 22: Connection refused
[gateway] failed with error:
-- 'bash -c ... /var/lib/sops-nix 700'
ssh: connect to host 168.144.172.115 port 22: Connection refused
1 hosts failed with an error. Check the logs above"
...
"the stand-up hit a problem — founding: the server stand-up did not complete (status \"blocked\"): the node has not come back yet — wait for the reboot to finish, then re-drive to verify"

fault_resumable: true is set on that same record — the seam classified this as a re-drivable block, not a manual one. The Playwright page snapshot (artifacts/.../error-context.md) shows the UI rendering exactly that fault with the "Retry the connection" affordance up, confirming the app rendered the carrier-level block correctly rather than crashing.

Suspected layer

Infra, matching the KNOWN frontier: nixos-anywhere reboots the VPS mid-takeover (install · reboot: reboot complete fires), but the box does not reliably come back up on :22 within the drive's budget — 168.144.172.115 refused the connection for the full 1200s. This is the own-VPS carrier issue tracked by the recent hardening commit ec5f246 ("own-VPS takeover comes back over SSH — one networkd unit, plus sshd + root keys the box already trusted"): the pairing (reboot → SSH back up) still does not flip reliably on this box. Nothing in this run's evidence points at a product-code regression — the standup got cleanly through connect, point, seed, and enroll-configure; only the boot-order/networking dependency for SSH-after-reboot is implicated.

Plugging it needs: infra-side — either lengthen the enroll-activate wait budget to tolerate this VPS's slower cold-boot networking, or continue the #414 line of work verifying the networkd/sshd unit ordering actually holds across every reboot path this VPS's provider image takes (not just the one #414 fixed). A human/infra call, not something a swarm agent can patch in product code.

Harness defects (secondary, found while diagnosing — worth their own tickets)

These didn't cause the RED, but they degraded this run's diagnosability and blocked the automated healer from getting a turn:

  1. Per-leg evidence not captured: artifacts/legs.json is [] and artifacts/journey.json is {"rows": null, "fault": null} even though state/founding-state.json clearly has a full event list and a fault. The harness's leg-recording step isn't reading the same state the app itself wrote.
  2. Post-run droplet evidence-gather fails on host-key mismatch: logs/droplet-journal.txt shows REMOTE HOST IDENTIFICATION HAS CHANGED against /home/dev/.ssh/known_hosts:86 for 168.144.172.115, with strict host-key checking rejecting the connection ("note: droplet evidence gather failed (droplet unreachable?) — the run dir keeps the app-side story"). This is a stale system-level known_hosts entry from a prior rehearsal against the same reused VPS (each takeover mints a fresh host key) — the evidence-gather step needs to key off the app's own state/own-vps/known_hosts (which has the current key) or drop strict checking for this reused rehearsal box.
  3. healer-claude never ran: logs/healer-claude.out is just Error: Input must be provided either through stdin or as a prompt argument when using --print, and logs/healer-claude.err shows five --allowedTools rules being ignored (**Diagnose.**, **Judge.**, **If, fixing:**, `.sandcastle/rehearsal-*`) — all malformed wildcard patterns rejected by the CLI's allow-rule parser. Even though the fault was fault_resumable: true (a case the healer is meant to act on), the healer subprocess invocation itself is broken, so no automated retry was ever attempted.

drive 20260811T001112Z red at wizard: drive red at wizard — the wizard died before any leg ran
evidence: test-results/…/20260811T001112Z/ on matou-workstation (legs.json, droplet-journal.txt, trace)


LIVE-PROBE VERDICT (manual session, 2026-08-11 ~01:35Z) — the box CAME BACK; the wait is the defect

The kept droplet from this run (clan-lab-rehearsal-5f007f33, 168.144.172.115 — preserved by REHEARSAL_KEEP_RED_DROPLET) is fully alive right now: ping answers, port 22 accepts, SSH as root with the operator key works, hostname = gateway, sshd active. The #414 triad landed whole (closure autopsy on this run's captured flake: one wan0 unit with address+route, sshd.service present, firewall accepts 22, Port 22).

The failure sequence was pure timing: post-reboot, enroll-activate's reconnect got Connection refused — the box mid-boot, sshd not listening YET (contrast every earlier run's timed out = no L3 at all) — and treated it as terminal within its window, faulting "the node has not come back yet". The node then finished booting and has served SSH ever since. (On-box kanidm sits failed as expected — activation bailed before pushing its secrets; not a separate defect.)

Scope for this ticket (replaces "never came back"): the own-VPS enroll-activate post-reboot reconnect must tolerate a fresh droplet's boot time — treat Connection refused AND timed out as retryable within a generous bounded window (droplet boot ≈ 30–90s; give it ~5 min with backoff) before classifying the resumable block. The classification/remedy region is internal/clan/enrollment.go:695-716 (the connectivity-block classifier the #406 worker mapped); the reconnect loop that gave up sits on the activate path just above it. A unit case: refused-then-accepting fake target → activate succeeds.

With this landed, the next drive's frontier is genuinely past reachability: secrets push → activation → seed services → pairing ceremony.

## Failing leg `enroll-activate` — the drive threw: > `JourneyFailure: journey leg "enroll-activate" went red: budget of 1200s elapsed at "absent"` (`legs.json` is `[]` and `artifacts/journey.json` is `{"rows": null, "fault": null}` for this run — the per-leg ledger the harness normally writes never got populated; see "Harness defects" below. What actually shows what happened is `state/founding-state.json` and the app's own fault frame, captured in the Playwright error-context snapshot.) ## Evidence `state/founding-state.json` records the standup reaching `enroll-configure`, completing install, then failing to reconnect: ``` "install · reboot: reboot complete" ... "could not reach the node: [gateway] ssh: connect to host 168.144.172.115 port 22: Connection refused [gateway] failed with error: -- 'bash -c ... /var/lib/sops-nix 700' ssh: connect to host 168.144.172.115 port 22: Connection refused 1 hosts failed with an error. Check the logs above" ... "the stand-up hit a problem — founding: the server stand-up did not complete (status \"blocked\"): the node has not come back yet — wait for the reboot to finish, then re-drive to verify" ``` `fault_resumable: true` is set on that same record — the seam classified this as a re-drivable block, not a manual one. The Playwright page snapshot (`artifacts/.../error-context.md`) shows the UI rendering exactly that fault with the "Retry the connection" affordance up, confirming the app rendered the carrier-level block correctly rather than crashing. ## Suspected layer **Infra**, matching the KNOWN frontier: nixos-anywhere reboots the VPS mid-takeover (`install · reboot: reboot complete` fires), but the box does not reliably come back up on :22 within the drive's budget — `168.144.172.115` refused the connection for the full 1200s. This is the own-VPS carrier issue tracked by the recent hardening commit `ec5f246` ("own-VPS takeover comes back over SSH — one networkd unit, plus sshd + root keys the box already trusted"): the pairing (reboot → SSH back up) still does not flip reliably on this box. Nothing in this run's evidence points at a product-code regression — the standup got cleanly through connect, point, seed, and enroll-configure; only the boot-order/networking dependency for SSH-after-reboot is implicated. **Plugging it needs**: infra-side — either lengthen the enroll-activate wait budget to tolerate this VPS's slower cold-boot networking, or continue the #414 line of work verifying the networkd/sshd unit ordering actually holds across every reboot path this VPS's provider image takes (not just the one #414 fixed). A human/infra call, not something a swarm agent can patch in product code. ## Harness defects (secondary, found while diagnosing — worth their own tickets) These didn't cause the RED, but they degraded this run's diagnosability and blocked the automated healer from getting a turn: 1. **Per-leg evidence not captured**: `artifacts/legs.json` is `[]` and `artifacts/journey.json` is `{"rows": null, "fault": null}` even though `state/founding-state.json` clearly has a full event list and a fault. The harness's leg-recording step isn't reading the same state the app itself wrote. 2. **Post-run droplet evidence-gather fails on host-key mismatch**: `logs/droplet-journal.txt` shows `REMOTE HOST IDENTIFICATION HAS CHANGED` against `/home/dev/.ssh/known_hosts:86` for `168.144.172.115`, with strict host-key checking rejecting the connection ("note: droplet evidence gather failed (droplet unreachable?) — the run dir keeps the app-side story"). This is a stale system-level `known_hosts` entry from a prior rehearsal against the same reused VPS (each takeover mints a fresh host key) — the evidence-gather step needs to key off the app's own `state/own-vps/known_hosts` (which has the current key) or drop strict checking for this reused rehearsal box. 3. **`healer-claude` never ran**: `logs/healer-claude.out` is just `Error: Input must be provided either through stdin or as a prompt argument when using --print`, and `logs/healer-claude.err` shows five `--allowedTools` rules being ignored (`**Diagnose.**`, `**Judge.**`, `**If`, `fixing:**`, `` `.sandcastle/rehearsal-*` ``) — all malformed wildcard patterns rejected by the CLI's allow-rule parser. Even though the fault was `fault_resumable: true` (a case the healer is meant to act on), the healer subprocess invocation itself is broken, so no automated retry was ever attempted. drive `20260811T001112Z` red at `wizard`: `drive red at wizard — the wizard died before any leg ran` evidence: `test-results/…/20260811T001112Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) <!-- rehearsal-sig: dcf630511b50 --> --- ## LIVE-PROBE VERDICT (manual session, 2026-08-11 ~01:35Z) — the box CAME BACK; the wait is the defect The kept droplet from this run (`clan-lab-rehearsal-5f007f33`, `168.144.172.115` — preserved by `REHEARSAL_KEEP_RED_DROPLET`) is **fully alive right now**: ping answers, port 22 accepts, SSH as root with the operator key works, `hostname` = `gateway`, `sshd` active. The #414 triad landed whole (closure autopsy on this run's captured flake: one wan0 unit with address+route, `sshd.service` present, firewall accepts 22, `Port 22`). The failure sequence was pure timing: post-reboot, enroll-activate's reconnect got **`Connection refused`** — the box mid-boot, sshd not listening YET (contrast every earlier run's `timed out` = no L3 at all) — and treated it as terminal within its window, faulting "the node has not come back yet". The node then finished booting and has served SSH ever since. (On-box `kanidm` sits failed as expected — activation bailed before pushing its secrets; not a separate defect.) **Scope for this ticket (replaces "never came back"):** the own-VPS enroll-activate post-reboot reconnect must tolerate a fresh droplet's boot time — treat `Connection refused` AND `timed out` as retryable within a generous bounded window (droplet boot ≈ 30–90s; give it ~5 min with backoff) before classifying the resumable block. The classification/remedy region is `internal/clan/enrollment.go:695-716` (the connectivity-block classifier the #406 worker mapped); the reconnect loop that gave up sits on the activate path just above it. A unit case: refused-then-accepting fake target → activate succeeds. With this landed, the next drive's frontier is genuinely past reachability: secrets push → activation → seed services → pairing ceremony.
Author
Owner

Landed in fd108b4 on origin/main.

Fix (product code, adopting this ticket's LIVE-PROBE VERDICT scope — the box came back; the wait was the defect): verify (the enroll-activate machines update on the activate path) now re-drives on a FailConnectivity — both connection refused and connection timed out classify there — within a bounded backoff budget before conceding the still-resumable block. A fresh droplet reboots mid-takeover and can honestly refuse/time-out on :22 for its cold-boot window (≈30–90s); giving up on the first knock faulted "the node has not come back yet" on a healthy box.

  • Adapter.reconnectWindow (default defaultReconnectWindow = 5 min) bounds the total reconnect backoff budget; reconnectBackoff is 5s→10s→20s→30s-capped; sleepCtx is a ctx-cancellable wait (injectable for the seam tests).
  • A severed control connection mid-wait blocks at once (an interruption, not a vanished node); a non-connectivity fault (secrets/eval) stays terminal with no retry.

Seam tests (internal/clan/enrollment_test.go), incl. the ticket's named unit case:

  • TestEnroll_ActivateRetriesRefusedRebootThenBecomesMember — refused-then-accepting fake target → activate succeeds (member).
  • TestEnroll_ActivateGivesUpAfterReconnectWindowThenBlocksResumable — refused-forever → resumable block, only after spending the budget.
  • TestEnroll_ActivateSeveredMidReconnectBlocksResumable — severed mid-wait → resumable block, one attempt.
  • TestEnroll_ActivateTerminalFailureDoesNotRetry — secrets fault → terminal, no retry.

Files: internal/clan/enrollment.go, internal/clan/adapter.go, internal/clan/enrollment_test.go, STATUS.md.

Out of scope — the three harness defects flagged while diagnosing are left to their own tickets (per-leg evidence not captured; post-run evidence-gather host-key mismatch; broken healer-claude --allowedTools parsing). The next drive's frontier is genuinely past reachability: secrets push → activation → seed services → pairing ceremony.

Landed in `fd108b4` on `origin/main`. Fix (product code, adopting this ticket's LIVE-PROBE VERDICT scope — the box came back; the wait was the defect): `verify` (the enroll-activate `machines update` on the activate path) now re-drives on a `FailConnectivity` — both `connection refused` and `connection timed out` classify there — within a bounded backoff budget before conceding the still-resumable block. A fresh droplet reboots mid-takeover and can honestly refuse/time-out on `:22` for its cold-boot window (≈30–90s); giving up on the first knock faulted "the node has not come back yet" on a healthy box. - `Adapter.reconnectWindow` (default `defaultReconnectWindow` = 5 min) bounds the total reconnect backoff budget; `reconnectBackoff` is 5s→10s→20s→30s-capped; `sleepCtx` is a ctx-cancellable wait (injectable for the seam tests). - A severed control connection mid-wait blocks at once (an interruption, not a vanished node); a non-connectivity fault (secrets/eval) stays terminal with **no** retry. Seam tests (`internal/clan/enrollment_test.go`), incl. the ticket's named unit case: - `TestEnroll_ActivateRetriesRefusedRebootThenBecomesMember` — refused-then-accepting fake target → activate succeeds (member). - `TestEnroll_ActivateGivesUpAfterReconnectWindowThenBlocksResumable` — refused-forever → resumable block, only after spending the budget. - `TestEnroll_ActivateSeveredMidReconnectBlocksResumable` — severed mid-wait → resumable block, one attempt. - `TestEnroll_ActivateTerminalFailureDoesNotRetry` — secrets fault → terminal, no retry. Files: `internal/clan/enrollment.go`, `internal/clan/adapter.go`, `internal/clan/enrollment_test.go`, `STATUS.md`. **Out of scope — the three harness defects flagged while diagnosing are left to their own tickets** (per-leg evidence not captured; post-run evidence-gather host-key mismatch; broken `healer-claude` `--allowedTools` parsing). The next drive's frontier is genuinely past reachability: secrets push → activation → seed services → pairing ceremony.
ben closed this issue 2026-08-11 06:11:59 +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#426
No description provided.