enroll-activate's internal 20m phase timeout SIGKILLs a still-progressing rented clan machines update, and the droplet never comes back — reboot-vs-no-reboot contradiction (follow-on to #700) #702

Closed
opened 2026-08-23 11:23:16 +00:00 by matou-build-agent · 1 comment

Failure: drive 20260823T104013Z reds at enroll-activate (sig 073c79de3e67): founding: the rented 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. legs.json records enroll-activate at ms: 1200753 — within 1s of exactly 1,200,000ms (20 minutes). That is not a coincidence: it is defaultPhaseTimeout (internal/clan/enrollment.go:67, 20 * time.Minute), the internal wrapper every clan/nix CLI invocation runs under (runPhase, internal/clan/enrollment.go:1171-1179). The reported fault text is the app's own fault frame (read via readFault/data-status="journey-fault"), not Playwright's waitForLeg "budget of Ns elapsed" message — confirming the Go-internal timeout fired first and killed the process, which the outer Playwright PAIR_FRONTIER ceiling for this row (also 20m, app/tests/e2e/journey.rented.spec.ts:179) then simply observed.

Mechanism: founding-state.log shows the killed invocation's tail was normal, IN-PROGRESS nixos-rebuild switch output — sops-install-secrets: Imported /etc/ssh/ssh_host_{rsa,ed25519}_key…, then [gateway] NOT restarting the following changed units: systemd-fsck@dev-disk-by\x2dpartlabel-disk\x2dmain\x2dESP.service, … and Failed to reload user unit dbus-broker.service — i.e. the process was still actively progressing near the very end of activation when our own wrapper SIGKILLed it (internal/clan/errors.go:142-143 reads exit 137/143 as FailInterrupted). Critically, enrollment.go:971-983's reconnect-backoff retry (built for exactly a 'box rebooted mid-takeover, first SSH honestly refuses' scenario, #426) only fires for FailConnectivity; FailInterrupted instead breaks immediately (enrollment.go:984) straight to the resumable-blocked remedy, with zero retries. So whether or not the droplet was genuinely about to come back, this code path can't tell — our own kill pre-empts the classification that would let it try.

Corroborating evidence the box stayed dark: logs/droplet-journal.txt, droplet-units.txt, droplet-caddy.txt — all gathered after the red — show ssh: connect to host 209.38.89.240 port 22: Connection timed out. The droplet never answered SSH again during this run.

Open design contradiction (matches a very recent, still-unresolved item): internal/founding/rentedpath.go:32-35 documents the rented VMMode path as explicitly not rebooting ("No RotateHostKey (no reboot — the box keeps the host key connect learned)"), yet the fault text this shared verify() code emits ("wait for the reboot to finish") and the box going permanently dark strongly resemble a reboot happening anyway. STATUS.md's current top entry (#700, commit 734e466c, 2026-08-23) hit the same open question on a different droplet (170.64.134.129) and explicitly left it for a human: "whether the rented box actually rebooted (contradicting rentedpath.go's no-reboot assumption) and needs a host-key re-learn analogous to own-VPS RotateHostKey, or a disko.nix/DiskoLayout drift per GOTCHAS #47 — an infra investigation needing a live box … and a host-key-accept posture decision that is a one-way door." This drive reproduces the same shape on a fresh droplet, suggesting it's a recurring pattern rather than a one-off.

Checked and ruled out: docs/GOTCHAS.md #47 (disko/DiskoLayout drift bricking the box on reboot) is a plausible mechanism given the interrupted log names an ESP-partlabel unit (systemd-fsck@dev-disk-by\x2dpartlabel-disk\x2dmain\x2dESP.service), but the static contract test is green: GOWORK=$(pwd)/go.work CGO_ENABLED=0 go test ./internal/clan/... -run TestGatewayImageDiskoMatchesRenderDisko -v → PASS. That only proves disko.nix and renderDisko agree textually, not that the live droplet's actual on-disk partitioning matches at runtime — it doesn't clear the box.

Suspected layer / what plugging it needs (why not self-fixed): this isn't a certain, mechanical single-constant fix. Two things are entangled and need a ruling with live-droplet access: (1) whether clan machines update on the rented VMMode path genuinely reboots (resolving the rentedpath.go contradiction) — if yes, rentedpath.go's comments/behavior need correcting and the retry logic (enrollment.go:971-994) needs to treat a plausibly-rebooting FailInterrupted as retry-eligible, not just FailConnectivity; if no, the real fix is elsewhere (disko/kernel/network fault killing the box outright, needing GOTCHAS #47-style live investigation, not a timeout bump). (2) Only once that's settled does widening defaultPhaseTimeout/the enroll-activate PAIR_FRONTIER ceiling (mirroring the #698 enroll-copy precedent) become a safe, evidenced move — this run's log doesn't carry a quantifiable progress rate the way the copy leg's store-path count did, so I can't back a specific new number the way #698 did. Needs a session/human with live droplet access (or the drive's droplet console/serial log) to determine the actual reboot behavior and clear the box before any timeout number is trusted.

drive 20260823T104013Z red at enroll-activate: journey leg "enroll-activate" went red: founding: the rented 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 ver
evidence: test-results/…/20260823T104013Z/ on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)

**Failure:** drive `20260823T104013Z` reds at `enroll-activate` (sig `073c79de3e67`): `founding: the rented 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`. `legs.json` records `enroll-activate` at `ms: 1200753` — within 1s of exactly 1,200,000ms (20 minutes). That is not a coincidence: it is `defaultPhaseTimeout` (`internal/clan/enrollment.go:67`, `20 * time.Minute`), the internal wrapper every `clan`/`nix` CLI invocation runs under (`runPhase`, `internal/clan/enrollment.go:1171-1179`). The reported fault text is the app's own fault frame (read via `readFault`/`data-status="journey-fault"`), not Playwright's `waitForLeg` "budget of Ns elapsed" message — confirming the Go-internal timeout fired first and killed the process, which the outer Playwright `PAIR_FRONTIER` ceiling for this row (also 20m, `app/tests/e2e/journey.rented.spec.ts:179`) then simply observed. **Mechanism:** `founding-state.log` shows the killed invocation's tail was normal, IN-PROGRESS `nixos-rebuild switch` output — `sops-install-secrets: Imported /etc/ssh/ssh_host_{rsa,ed25519}_key…`, then `[gateway] NOT restarting the following changed units: systemd-fsck@dev-disk-by\x2dpartlabel-disk\x2dmain\x2dESP.service, …` and `Failed to reload user unit dbus-broker.service` — i.e. the process was still actively progressing near the very end of activation when our own wrapper SIGKILLed it (`internal/clan/errors.go:142-143` reads exit 137/143 as `FailInterrupted`). Critically, `enrollment.go:971-983`'s reconnect-backoff retry (built for exactly a 'box rebooted mid-takeover, first SSH honestly refuses' scenario, #426) only fires for `FailConnectivity`; `FailInterrupted` instead breaks immediately (`enrollment.go:984`) straight to the resumable-blocked remedy, with zero retries. So whether or not the droplet was genuinely about to come back, this code path can't tell — our own kill pre-empts the classification that would let it try. **Corroborating evidence the box stayed dark:** `logs/droplet-journal.txt`, `droplet-units.txt`, `droplet-caddy.txt` — all gathered *after* the red — show `ssh: connect to host 209.38.89.240 port 22: Connection timed out`. The droplet never answered SSH again during this run. **Open design contradiction (matches a very recent, still-unresolved item):** `internal/founding/rentedpath.go:32-35` documents the rented VMMode path as explicitly **not rebooting** ("No RotateHostKey (no reboot — the box keeps the host key connect learned)"), yet the fault text this shared `verify()` code emits ("wait for the reboot to finish") and the box going permanently dark strongly resemble a reboot happening anyway. STATUS.md's current top entry (`#700`, commit `734e466c`, 2026-08-23) hit the *same* open question on a different droplet (`170.64.134.129`) and explicitly left it for a human: "whether the rented box actually rebooted (contradicting `rentedpath.go`'s no-reboot assumption) and needs a host-key re-learn analogous to own-VPS `RotateHostKey`, or a `disko.nix`/`DiskoLayout` drift per GOTCHAS #47 — an infra investigation needing a live box … and a host-key-accept posture decision that is a one-way door." This drive reproduces the same shape on a fresh droplet, suggesting it's a recurring pattern rather than a one-off. **Checked and ruled out:** `docs/GOTCHAS.md` #47 (disko/`DiskoLayout` drift bricking the box on reboot) is a plausible mechanism given the interrupted log names an ESP-partlabel unit (`systemd-fsck@dev-disk-by\x2dpartlabel-disk\x2dmain\x2dESP.service`), but the static contract test is green: `GOWORK=$(pwd)/go.work CGO_ENABLED=0 go test ./internal/clan/... -run TestGatewayImageDiskoMatchesRenderDisko -v` → PASS. That only proves `disko.nix` and `renderDisko` agree textually, not that the live droplet's actual on-disk partitioning matches at runtime — it doesn't clear the box. **Suspected layer / what plugging it needs (why not self-fixed):** this isn't a certain, mechanical single-constant fix. Two things are entangled and need a ruling with live-droplet access: (1) whether `clan machines update` on the rented VMMode path genuinely reboots (resolving the `rentedpath.go` contradiction) — if yes, `rentedpath.go`'s comments/behavior need correcting and the retry logic (enrollment.go:971-994) needs to treat a plausibly-rebooting `FailInterrupted` as retry-eligible, not just `FailConnectivity`; if no, the real fix is elsewhere (disko/kernel/network fault killing the box outright, needing GOTCHAS #47-style live investigation, not a timeout bump). (2) Only once that's settled does widening `defaultPhaseTimeout`/the `enroll-activate` `PAIR_FRONTIER` ceiling (mirroring the #698 enroll-copy precedent) become a safe, evidenced move — this run's log doesn't carry a quantifiable progress rate the way the copy leg's store-path count did, so I can't back a specific new number the way #698 did. Needs a session/human with live droplet access (or the drive's droplet console/serial log) to determine the actual reboot behavior and clear the box before any timeout number is trusted. drive `20260823T104013Z` red at `enroll-activate`: `journey leg "enroll-activate" went red: founding: the rented 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 ver` evidence: `test-results/…/20260823T104013Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596) <!-- rehearsal-sig: 073c79de3e67 -->
Owner

Ruled by agent under ADR 0174 — veto anytime

The reboot-vs-no-reboot contradiction this ticket named is settled: NO, VMMode never reboots. Read clan-core's own clan_lib/machines/update.py (_nixos_activate, the code clan machines update actually runs) directly from the pinned clan-cli in the nix store (/nix/store/minv5pvqianfkrvc1clj65cxiwr0357h-clan-cli-source). It never issues a reboot under any path: it runs switch-to-configuration boot (bootloader entry only, for the next reboot) then switch (the live activation now); if switch is blocked by inhibitors it raises an error telling the operator to reboot manually — it never reboots itself, and this invocation is headless with no operator present to act on that message.

So rentedpath.go's "no RotateHostKey — no reboot" contract was correct all along. The actual bug was internal/clan/enrollment.go's verify() — shared between FullInstall (own-VPS, which genuinely reboots mid-takeover, #426) and VMMode (never reboots) — hard-coding reboot language ("wait for the reboot to finish", "still coming back up after its reboot") for both.

Fix (two-way door: revertible Go change, proven by a unit test, no security-posture widening — commit 01eedc89): verify()'s reconnect-retry and blocked-remedy messages now branch on s.Install == FullInstall (retryingConnectionMessage/blockedRemedyInstruction). VMMode's messages now say the node is "not answering" rather than claim a reboot in progress. Proven by TestEnroll_VMModeBlockedRemedyDoesNotClaimReboot (red before / green after); full internal/clan suite and go vet clean.

New finding, recorded as GOTCHAS #62: _nixos_activate wraps the live switch in systemd-run --pipe --wait --collect specifically (per its own docstring) "so the activation survives SSH connection drops" — the transient unit is systemd-managed on the TARGET, decoupled from the invoking SSH session. This means our defaultPhaseTimeout SIGKILLing the LOCAL clan machines update process likely does not stop the REMOTE activation at all — the box's fate may already be sealed server-side regardless of our local wait. That materially changes this ticket's originally-suspected mechanism ("our own wrapper SIGKILLed a still-progressing update") and rules out the #698-style timeout-widening as a well-evidenced fix here: #698's ceiling bump helped because that leg's cost was a LOCAL transfer genuinely gated by local wall-clock; this leg's remote activation is not gated by how long our local process waits, and a blind widening could even risk a second overlapping switch-to-configuration firing on re-drive against a still-running first one.

What's left open — filed as follow-up #703 (ready-for-session, blocked-by #702): why THIS drive's specific droplet (209.38.89.240) never answered SSH again. GOTCHAS #47's disko drift is checked and ruled out for this shape (same as #700's analogous case — TestGatewayImageDiskoMatchesRenderDisko green, and there's no reboot in this path to trigger it anyway). The remaining lead is the interrupted log's Failed to reload user unit dbus-broker.service line — a plausible live-service-reload failure during activation, independent of disko or reboot — but confirming that (or ruling it out) needs live-droplet/console evidence a future session should gather, not resolvable from a killed process's log tail alone. #703 gives that future session the systemd-run-detachment context up front so it doesn't re-derive it.

Closing #702: its named question (the contradiction) is fully resolved and the fix is landed; the deeper "why did the box die" question is now a separately-scoped, properly-evidenced follow-up rather than being smuggled into "still open" on this ticket.

## Ruled by agent under ADR 0174 — veto anytime **The reboot-vs-no-reboot contradiction this ticket named is settled: NO, VMMode never reboots.** Read clan-core's own `clan_lib/machines/update.py` (`_nixos_activate`, the code `clan machines update` actually runs) directly from the pinned clan-cli in the nix store (`/nix/store/minv5pvqianfkrvc1clj65cxiwr0357h-clan-cli-source`). It never issues a reboot under any path: it runs `switch-to-configuration boot` (bootloader entry only, for the *next* reboot) then `switch` (the live activation now); if `switch` is blocked by inhibitors it raises an error telling the **operator** to reboot manually — it never reboots itself, and this invocation is headless with no operator present to act on that message. So `rentedpath.go`'s "no RotateHostKey — no reboot" contract was correct all along. The actual bug was `internal/clan/enrollment.go`'s `verify()` — shared between FullInstall (own-VPS, which genuinely reboots mid-takeover, #426) and VMMode (never reboots) — hard-coding reboot language ("wait for the reboot to finish", "still coming back up after its reboot") for both. **Fix (two-way door: revertible Go change, proven by a unit test, no security-posture widening — commit `01eedc89`):** `verify()`'s reconnect-retry and blocked-remedy messages now branch on `s.Install == FullInstall` (`retryingConnectionMessage`/`blockedRemedyInstruction`). VMMode's messages now say the node is "not answering" rather than claim a reboot in progress. Proven by `TestEnroll_VMModeBlockedRemedyDoesNotClaimReboot` (red before / green after); full `internal/clan` suite and `go vet` clean. **New finding, recorded as GOTCHAS #62:** `_nixos_activate` wraps the live switch in `systemd-run --pipe --wait --collect` specifically (per its own docstring) "so the activation survives SSH connection drops" — the transient unit is systemd-managed on the TARGET, decoupled from the invoking SSH session. This means our `defaultPhaseTimeout` SIGKILLing the LOCAL `clan machines update` process likely does **not** stop the REMOTE activation at all — the box's fate may already be sealed server-side regardless of our local wait. That materially changes this ticket's originally-suspected mechanism ("our own wrapper SIGKILLed a still-progressing update") and rules out the #698-style timeout-widening as a well-evidenced fix here: #698's ceiling bump helped because that leg's cost was a LOCAL transfer genuinely gated by local wall-clock; this leg's remote activation is not gated by how long our local process waits, and a blind widening could even risk a second overlapping `switch-to-configuration` firing on re-drive against a still-running first one. **What's left open — filed as follow-up #703 (`ready-for-session`, blocked-by #702):** why THIS drive's specific droplet (`209.38.89.240`) never answered SSH again. GOTCHAS #47's disko drift is checked and ruled out for this shape (same as #700's analogous case — `TestGatewayImageDiskoMatchesRenderDisko` green, and there's no reboot in this path to trigger it anyway). The remaining lead is the interrupted log's `Failed to reload user unit dbus-broker.service` line — a plausible live-service-reload failure during activation, independent of disko or reboot — but confirming that (or ruling it out) needs live-droplet/console evidence a future session should gather, not resolvable from a killed process's log tail alone. #703 gives that future session the systemd-run-detachment context up front so it doesn't re-derive it. Closing #702: its named question (the contradiction) is fully resolved and the fix is landed; the deeper "why did the box die" question is now a separately-scoped, properly-evidenced follow-up rather than being smuggled into "still open" on this ticket.
ben closed this issue 2026-08-23 11:51:05 +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#702
No description provided.