enroll-configure: droplet never comes back over SSH after nixos-anywhere reboot #414

Closed
opened 2026-08-10 20:58:06 +00:00 by ben · 1 comment
Owner

Failure

The #183 rehearsal drive against the real own-VPS droplet (170.64.213.10) got through connect, DNS pointing, and flake/brand seeding, then nixos-anywhere's takeover install ran to completion (kexec, disko, install, reboot all reported complete) — but the droplet never came back over SSH afterward. Founding entered its blocked/resumable fault state and stayed there; Playwright's waitForLeg("enroll-configure", 1200s) burned the full budget and threw.

Evidence

artifacts/journey.droplet.../error-context.md (Playwright):

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

and the rendered fault paragraph in the same page snapshot:

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

logs/founding-state.log / state/founding-state.json (the app's own event log) shows the real stage was enroll-activate, one stage past what Playwright named, and gives the underlying cause:

"install · reboot: reboot complete"
...
"could not reach the node: [gateway] ssh: connect to host 170.64.213.10 port 22: Connection timed out\n[gateway] failed with error:\n-- 'bash -c ... /var/lib/sops-nix 700'\nssh: connect to host 170.64.213.10 port 22: Connection timed out\n1 hosts failed with an error. Check the logs above"

with "fault_resumable": true.

logs/droplet-journal.txt (post-mortem evidence gather, run after the test already failed) shows the droplet was still unreachable:

ssh: connect to host 170.64.213.10 port 22: Connection timed out
    note: droplet evidence gather failed (droplet unreachable?) — the run dir keeps the app-side story

All guest-*.log files (journal, caddy, phpfpm, kanidm, nextcloud-setup, control-plane, files-oidc) are 0 bytes, consistent with SSH never reopening — there was no way to pull anything off the box.

host.json's "qemu": "exit ENOENT: spawn qemu-system-x86_64 ENOENT" and the empty qemu.log/guest-unit*.log (Failed to connect to bus: No medium found) are the harness's generic local-VM evidence-gathering steps failing harmlessly — this is a real DigitalOcean droplet run, not a qemu guest, so these are noise, not the fault.

artifacts/legs.json is [] — no per-leg records or skip reasons were persisted for this run at all, so I cannot literally quote a skip-reason string here (worth flagging as its own small gap: if the intent is for a repeat own-VPS no-SSH block to short-circuit into a labeled skip, that didn't happen this run).

Suspected layer

Primarily infra, and it matches the team's own recently-tracked frontier: the droplet not answering SSH after nixos-anywhere's reboot (fault_resumable: true, "wait for the reboot to finish, then re-drive to verify") is exactly the shape described by recent commits #412 ("own-VPS no-SSH frontier — keep-on-red droplet + real DNS upstream scrape") and #407 ("widen the droplet enroll-configure ceiling to 20m"). This looks like the same known, not-yet-closed own-VPS carrier issue — the pairing after takeover-reboot doesn't reliably flip back up.

Secondarily harness: independent of the infra frontier, tests/e2e/journey.droplet.spec.ts's readJourney()/waitForLeg() never saw the fault at all — it polled for [data-status="standup-progress"] for the full 1200s and got state: 'absent' throughout, even though the app rendered a fault frame with the real reason within seconds of the reboot timeout. The app's blocked view apparently doesn't keep the standup-progress bar in the DOM with data-state="failed"/data-failed="enroll-activate" — it swaps to a separate fault frame that waitForLeg doesn't check. That's why the thrown error says leg "enroll-configure" (the leg the test happened to be waiting on) rather than the actual failing stage enroll-activate, and why it took the full budget instead of failing fast.

What plugging it needs

For the infra frontier: confirm with whoever owns #412 whether this run is the same open issue (droplet-side networking/boot flakiness post-nixos-anywhere-reboot on this VPS) — if so this red needs no new diagnosis, just continued tracking there.

For the harness gap (independently actionable by a swarm agent, no human ruling needed): make waitForLeg in tests/e2e/journey.droplet.spec.ts also poll [data-status="journey-fault"] and treat its presence as an immediate failure (using readFault/readFaultResumable, which already exist and work — the page snapshot proves the fault frame renders correctly), instead of relying solely on the standup-progress bar's data-state. That turns a 1200s timeout with a misleading leg name into an immediate, correctly-attributed failure.

drive 20260810T203119Z red at wizard: ssh: connect to host N.N.N.N port N: Connection timed out
evidence: test-results/…/20260810T203119Z/ on matou-workstation (legs.json, droplet-journal.txt, trace)


CONSOLE-PENDING — this red IS the planned evidence run (do not work yet)

This is the #412 evidence run executing as designed: REHEARSAL_KEEP_RED_DROPLET=1 held teardown — droplet clan-lab-rehearsal-73cbdaed (170.64.213.10, id 591432280) is ALIVE for a DO-console inspection (TTL reaps ≤6h). Second identical reproduction: takeover fully succeeded (kexec/disko/install/reboot per founding-state), then no L3 presence (port 22 + ICMP dead on live probes both runs — NOT a transient; do not re-bounce as "wait and re-drive").

Ben's console glance classifies the fault: GRUB prompt / no-bootable-device → bootloader embed (BIOS grub on /dev/vda); kernel panic → kernel/initrd of the built system; NixOS login banner → boots fine, the wan0 MAC-rename/networkd config is dead. The verdict lands here as a comment, the concrete fix gets scoped then, and this flips back to ready-for-agent. Until that comment exists there is nothing implementable — hence ready-for-human.


CONSOLE VERDICT + CLOSURE AUTOPSY (Ben's Recovery-Console look + built-toplevel inspection, 2026-08-10 ~21:30Z) — ready for the swarm

Recovery Console shows a clean NixOS login prompt. GRUB, kernel, initrd, disko: all fine. The takeover installs a healthy system; what died is reachability. The built toplevel (nix build .#nixosConfigurations.gateway...toplevel from this run's captured flake, cached on the workstation: /nix/store/cda4m3yp13smclfv1404ks7cj2pr9kbb-...) shows THREE defects:

1. Default route is silently discarded — first-match-wins shadowing. The seed renders systemd.network.networks."10-wan0" (Address + DNS) while networking.defaultGateway renders a SEPARATE 40-wan0.network carrying the [Route] Gateway=. systemd-networkd applies only the FIRST .network file matching a link — 10-wan0.network wins, the gateway unit is ignored → address up, no default route → inbound arrives, every reply dropped. Exactly the observed "dead from outside, alive on console". Fix: ONE unit — carry the gateway inside the same 10-wan0 network (routes/Gateway=) and drop networking.defaultGateway, or render address+gateway together via NixOS's own interface options so they co-render into a single unit.

2. The installed system has NO sshd. etc/systemd/system/ in the toplevel carries no sshd.service — services.openssh is never enabled by the own-VPS gateway seed (the local-guest path inherits it from the vmguest baseline; the droplet path has no baseline). Even with routing fixed, enroll-activate can never reconnect. Fix: seed services.openssh.enable = true + settings.PermitRootLogin = "prohibit-password".

3. No root authorized key. Nothing in the seed carries users.users.root.openssh.authorizedKeys — with sshd enabled, the ambient-key auth would still be refused. Elegant fix honouring ADR 0152's "the same access your provider gave you": the carrier's connectScript already runs on the pre-takeover box — have it scrape /root/.ssh/authorized_keys (the keys the provider installed) and seed exactly those into the NixOS config.

Cosmetic, same pass: the (fixed) DNS upstream scrape now emits each resolver 3× — dedup in parseCarrierFacts or the render.

Seam-test extension (closes the class): extend #401's eval seam test to assert on the BUILT closure: exactly one .network unit matches wan0 and it carries BOTH Address= and a default route; sshd.service exists; at least one root authorized key present. Those three asserts would have caught all of today's frontier reds locally.

Note for the fixing worker: REHEARSAL_KEEP_RED_DROPLET=1 stays exported on the workstation until this leg goes green — if your fix reds, the droplet survives for another console look. The current evidence droplet (clan-lab-rehearsal-73cbdaed) can be left to its TTL.

## Failure The #183 rehearsal drive against the real own-VPS droplet (170.64.213.10) got through connect, DNS pointing, and flake/brand seeding, then nixos-anywhere's takeover install ran to completion (kexec, disko, install, reboot all reported complete) — but the droplet never came back over SSH afterward. Founding entered its `blocked`/resumable fault state and stayed there; Playwright's `waitForLeg("enroll-configure", 1200s)` burned the full budget and threw. ## Evidence `artifacts/journey.droplet.../error-context.md` (Playwright): ``` JourneyFailure: journey leg "enroll-configure" went red: budget of 1200s elapsed at "absent" ``` and the rendered fault paragraph in the same page snapshot: ``` 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 ``` `logs/founding-state.log` / `state/founding-state.json` (the app's own event log) shows the real stage was `enroll-activate`, one stage past what Playwright named, and gives the underlying cause: ``` "install · reboot: reboot complete" ... "could not reach the node: [gateway] ssh: connect to host 170.64.213.10 port 22: Connection timed out\n[gateway] failed with error:\n-- 'bash -c ... /var/lib/sops-nix 700'\nssh: connect to host 170.64.213.10 port 22: Connection timed out\n1 hosts failed with an error. Check the logs above" ``` with `"fault_resumable": true`. `logs/droplet-journal.txt` (post-mortem evidence gather, run *after* the test already failed) shows the droplet was still unreachable: ``` ssh: connect to host 170.64.213.10 port 22: Connection timed out note: droplet evidence gather failed (droplet unreachable?) — the run dir keeps the app-side story ``` All `guest-*.log` files (journal, caddy, phpfpm, kanidm, nextcloud-setup, control-plane, files-oidc) are 0 bytes, consistent with SSH never reopening — there was no way to pull anything off the box. `host.json`'s `"qemu": "exit ENOENT: spawn qemu-system-x86_64 ENOENT"` and the empty `qemu.log`/`guest-unit*.log` (`Failed to connect to bus: No medium found`) are the harness's generic local-VM evidence-gathering steps failing harmlessly — this is a real DigitalOcean droplet run, not a qemu guest, so these are noise, not the fault. `artifacts/legs.json` is `[]` — no per-leg records or skip reasons were persisted for this run at all, so I cannot literally quote a skip-reason string here (worth flagging as its own small gap: if the intent is for a repeat own-VPS no-SSH block to short-circuit into a labeled skip, that didn't happen this run). ## Suspected layer **Primarily infra**, and it matches the team's own recently-tracked frontier: the droplet not answering SSH after nixos-anywhere's reboot (`fault_resumable: true`, "wait for the reboot to finish, then re-drive to verify") is exactly the shape described by recent commits `#412` ("own-VPS no-SSH frontier — keep-on-red droplet + real DNS upstream scrape") and `#407` ("widen the droplet enroll-configure ceiling to 20m"). This looks like the same known, not-yet-closed own-VPS carrier issue — the pairing after takeover-reboot doesn't reliably flip back up. **Secondarily harness**: independent of the infra frontier, `tests/e2e/journey.droplet.spec.ts`'s `readJourney()`/`waitForLeg()` never saw the fault at all — it polled for `[data-status="standup-progress"]` for the full 1200s and got `state: 'absent'` throughout, even though the app rendered a fault frame with the real reason within seconds of the reboot timeout. The app's `blocked` view apparently doesn't keep the `standup-progress` bar in the DOM with `data-state="failed"`/`data-failed="enroll-activate"` — it swaps to a separate fault frame that `waitForLeg` doesn't check. That's why the thrown error says leg `"enroll-configure"` (the leg the test happened to be waiting on) rather than the actual failing stage `enroll-activate`, and why it took the full budget instead of failing fast. ## What plugging it needs For the infra frontier: confirm with whoever owns `#412` whether this run is the same open issue (droplet-side networking/boot flakiness post-nixos-anywhere-reboot on this VPS) — if so this red needs no new diagnosis, just continued tracking there. For the harness gap (independently actionable by a swarm agent, no human ruling needed): make `waitForLeg` in `tests/e2e/journey.droplet.spec.ts` also poll `[data-status="journey-fault"]` and treat its presence as an immediate failure (using `readFault`/`readFaultResumable`, which already exist and work — the page snapshot proves the fault frame renders correctly), instead of relying solely on the `standup-progress` bar's `data-state`. That turns a 1200s timeout with a misleading leg name into an immediate, correctly-attributed failure. drive `20260810T203119Z` red at `wizard`: `ssh: connect to host N.N.N.N port N: Connection timed out ` evidence: `test-results/…/20260810T203119Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) <!-- rehearsal-sig: dcf630511b50 --> --- ## CONSOLE-PENDING — this red IS the planned evidence run (do not work yet) This is the #412 evidence run executing as designed: `REHEARSAL_KEEP_RED_DROPLET=1` held teardown — droplet **`clan-lab-rehearsal-73cbdaed`** (`170.64.213.10`, id 591432280) is ALIVE for a DO-console inspection (TTL reaps ≤6h). Second identical reproduction: takeover fully succeeded (kexec/disko/install/reboot per founding-state), then no L3 presence (port 22 + ICMP dead on live probes both runs — NOT a transient; do not re-bounce as "wait and re-drive"). Ben's console glance classifies the fault: GRUB prompt / no-bootable-device → bootloader embed (BIOS grub on /dev/vda); kernel panic → kernel/initrd of the built system; NixOS login banner → boots fine, the `wan0` MAC-rename/networkd config is dead. The verdict lands here as a comment, the concrete fix gets scoped then, and this flips back to `ready-for-agent`. Until that comment exists there is nothing implementable — hence `ready-for-human`. --- ## CONSOLE VERDICT + CLOSURE AUTOPSY (Ben's Recovery-Console look + built-toplevel inspection, 2026-08-10 ~21:30Z) — ready for the swarm **Recovery Console shows a clean NixOS login prompt.** GRUB, kernel, initrd, disko: all fine. The takeover installs a healthy system; what died is reachability. The built toplevel (`nix build .#nixosConfigurations.gateway...toplevel` from this run's captured flake, cached on the workstation: `/nix/store/cda4m3yp13smclfv1404ks7cj2pr9kbb-...`) shows THREE defects: **1. Default route is silently discarded — first-match-wins shadowing.** The seed renders `systemd.network.networks."10-wan0"` (Address + DNS) while `networking.defaultGateway` renders a SEPARATE `40-wan0.network` carrying the `[Route] Gateway=`. systemd-networkd applies only the FIRST `.network` file matching a link — `10-wan0.network` wins, the gateway unit is ignored → address up, no default route → inbound arrives, every reply dropped. Exactly the observed "dead from outside, alive on console". Fix: ONE unit — carry the gateway inside the same `10-wan0` network (routes/Gateway=) and drop `networking.defaultGateway`, or render address+gateway together via NixOS's own interface options so they co-render into a single unit. **2. The installed system has NO sshd.** `etc/systemd/system/` in the toplevel carries no `sshd.service` — `services.openssh` is never enabled by the own-VPS gateway seed (the local-guest path inherits it from the vmguest baseline; the droplet path has no baseline). Even with routing fixed, enroll-activate can never reconnect. Fix: seed `services.openssh.enable = true` + `settings.PermitRootLogin = "prohibit-password"`. **3. No root authorized key.** Nothing in the seed carries `users.users.root.openssh.authorizedKeys` — with sshd enabled, the ambient-key auth would still be refused. Elegant fix honouring ADR 0152's "the same access your provider gave you": the carrier's `connectScript` already runs on the pre-takeover box — have it scrape `/root/.ssh/authorized_keys` (the keys the provider installed) and seed exactly those into the NixOS config. Cosmetic, same pass: the (fixed) DNS upstream scrape now emits each resolver 3× — dedup in `parseCarrierFacts` or the render. **Seam-test extension (closes the class):** extend #401's eval seam test to assert on the BUILT closure: exactly one `.network` unit matches wan0 and it carries BOTH `Address=` and a default route; `sshd.service` exists; at least one root authorized key present. Those three asserts would have caught all of today's frontier reds locally. Note for the fixing worker: `REHEARSAL_KEEP_RED_DROPLET=1` stays exported on the workstation until this leg goes green — if your fix reds, the droplet survives for another console look. The current evidence droplet (`clan-lab-rehearsal-73cbdaed`) can be left to its TTL.
Author
Owner

Closed by ec5f246 on origin/main.

Ben's console autopsy turned into a fix — all three render gaps closed and proven off the built closure by TestOwnVPSGateway_EvalSmoke's new #414 asserts (ran green against real clan-core+nixpkgs):

  1. Default route un-shadowed. renderNetworkd now carries the route as a [Route] Gateway= inside the addressed 10-wan0 unit and drops networking.defaultGateway — no more separate 40-wan0.network that systemd-networkd silently discards (the proven Q2.2 spike template). The closure assert proves exactly one wan0 unit, carrying both Address= and the route.
  2. sshd now baked. The full-install path bakes no baseline, so a new access.nix (renderAccess, joined to baseMachineModules) enables services.openssh + PermitRootLogin=prohibit-password + firewall :22.
  3. Root key now seeded. access.nix sets users.users.root.openssh.authorizedKeys.keys from the keys the carrier now scrapes off the box's pre-takeover /root/.ssh/authorized_keys (ADR 0152). Load-bearing at connect — a box reporting no root key fails loud (a reinstall that could never come back).

Flow: connectScript scrape → CarrierFacts.RootAuthorizedKeys → EnrollRequest.AuthorizedKeys → snapshot → NodeConfig.RootAuthorizedKeys (configure) → renderAccess.

Cosmetic: DNS + rootkey scrapes deduped in parseCarrierFacts (first-seen order).

Docs: GOTCHAS #11 (networkd two-unit shadowing) + #12 (full-install bakes no baseline), STATUS.md; own-vps-gateway drvPath baseline regenerated. Seam tests green across clan/fleetwire/founding + full Go pre-push gate.

The live droplet re-drive (does the real box now come back over SSH after takeover?) is the infra-side confirmation — the kept evidence droplet / next rehearsal drive owns that.

Closed by `ec5f246` on origin/main. Ben's console autopsy turned into a fix — all three render gaps closed and **proven off the built closure** by `TestOwnVPSGateway_EvalSmoke`'s new #414 asserts (ran green against real clan-core+nixpkgs): 1. **Default route un-shadowed.** `renderNetworkd` now carries the route as a `[Route] Gateway=` *inside* the addressed `10-wan0` unit and drops `networking.defaultGateway` — no more separate `40-wan0.network` that systemd-networkd silently discards (the proven Q2.2 spike template). The closure assert proves exactly one wan0 unit, carrying both `Address=` and the route. 2. **sshd now baked.** The full-install path bakes no baseline, so a new `access.nix` (`renderAccess`, joined to `baseMachineModules`) enables `services.openssh` + `PermitRootLogin=prohibit-password` + firewall :22. 3. **Root key now seeded.** `access.nix` sets `users.users.root.openssh.authorizedKeys.keys` from the keys the carrier now scrapes off the box's pre-takeover `/root/.ssh/authorized_keys` (ADR 0152). Load-bearing at connect — a box reporting no root key fails loud (a reinstall that could never come back). Flow: `connectScript` scrape → `CarrierFacts.RootAuthorizedKeys` → `EnrollRequest.AuthorizedKeys` → snapshot → `NodeConfig.RootAuthorizedKeys` (configure) → `renderAccess`. Cosmetic: DNS + rootkey scrapes deduped in `parseCarrierFacts` (first-seen order). Docs: GOTCHAS #11 (networkd two-unit shadowing) + #12 (full-install bakes no baseline), STATUS.md; own-vps-gateway drvPath baseline regenerated. Seam tests green across clan/fleetwire/founding + full Go pre-push gate. The live droplet re-drive (does the real box now come back over SSH after takeover?) is the infra-side confirmation — the kept evidence droplet / next rehearsal drive owns that.
ben closed this issue 2026-08-11 00:03:39 +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#414
No description provided.