rehearsal drive red at deploy-takeover #630

Closed
opened 2026-08-21 03:35:50 +00:00 by matou-build-agent · 3 comments

(headless diagnosis unparseable — raw stdout saved to logs/reporter-claude.out)

drive 20260821T030832Z red at deploy-takeover: expect(locator).toBeVisible() failed Locator: locator('[data-status="deploy-live"]').or(locator('[data-status="hand-off"]')).or(locator('[data-status="deploy-failed"]')).first() Expected: visible Time
evidence: test-results/…/20260821T030832Z/ on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)

(headless diagnosis unparseable — raw stdout saved to logs/reporter-claude.out) drive `20260821T030832Z` red at `deploy-takeover`: `expect(locator).toBeVisible() failed Locator: locator('[data-status="deploy-live"]').or(locator('[data-status="hand-off"]')).or(locator('[data-status="deploy-failed"]')).first() Expected: visible Time` evidence: `test-results/…/20260821T030832Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596) <!-- rehearsal-sig: 800a2936720b -->
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

Diagnosed and fixed as a two-way-door code change (a Go source fix in internal/hostprobe, revertible by commit, proven by new unit tests + a full green go build/go vet/go test ./...). No one-way-door touched: no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend.

Root cause: internal/hostprobe.Prober.Network — the only production join.Prober, so the sole facts source for a self-hosted full install — was a stub left from spike #12's original scope cut (#183 leg B·2), always returning the zero address/gateway/MAC regardless of host. enrollment.go's renderNetworkd bakes those straight into a MAC-matched networkd config, and its own comment already named the consequence: "a DHCP-only config boots a fresh cloud host unreachable." The sibling own-VPS carrier (fleetwire/carrier.go) captures these facts for real over SSH and fails loud if any are missing; self-hosted had no equivalent — so drive 20260821T030832Z's droplet went dark on SSH after the takeover reboot (GOTCHAS #6/#11/#12 shape) even though its rendered config already carried every one of those prior fixes.

Fixed in 353a3e03: Prober.Network now reads the host's real default route (/proc/net/route, parsed directly — the agent runs ON the host, no SSH needed) and that interface's address/MAC (net.InterfaceByName), failing loud and naming what's missing exactly like the carrier already does, instead of silently shipping zeros. A prior test had codified the zero-facts stub as the correct contract; replaced with TestParse_DefaultRoute/TestParse_DefaultRouteNone, TestNetwork_ReportsRealAddressGatewayMAC, TestNetwork_FailsLoudWithNoDefaultRoute, TestNetwork_FailsLoudWhenInterfaceFactsUnreadable. GOTCHAS #45 appended; STATUS.md updated in the same commit.

NOT re-proved by a fresh live drive this session — diagnosis worked from the one red drive's evidence only (the reporter's own headless diagnosis session failed, OAuth session expired, the same gap #628 hit); the next selfhosted rehearsal that reaches deploy-takeover is the live proof.

**Ruled by agent under ADR 0174 — veto anytime.** Diagnosed and fixed as a two-way-door code change (a Go source fix in `internal/hostprobe`, revertible by commit, proven by new unit tests + a full green `go build`/`go vet`/`go test ./...`). No one-way-door touched: no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend. Root cause: `internal/hostprobe.Prober.Network` — the only production `join.Prober`, so the sole facts source for a self-hosted full install — was a stub left from spike #12's original scope cut (`#183` leg B·2), always returning the zero address/gateway/MAC regardless of host. `enrollment.go`'s `renderNetworkd` bakes those straight into a MAC-matched networkd config, and its own comment already named the consequence: "a DHCP-only config boots a fresh cloud host unreachable." The sibling own-VPS carrier (`fleetwire/carrier.go`) captures these facts for real over SSH and fails loud if any are missing; self-hosted had no equivalent — so drive `20260821T030832Z`'s droplet went dark on SSH after the takeover reboot (GOTCHAS #6/#11/#12 shape) even though its rendered config already carried every one of those prior fixes. Fixed in `353a3e03`: `Prober.Network` now reads the host's real default route (`/proc/net/route`, parsed directly — the agent runs ON the host, no SSH needed) and that interface's address/MAC (`net.InterfaceByName`), failing loud and naming what's missing exactly like the carrier already does, instead of silently shipping zeros. A prior test had codified the zero-facts stub as the correct contract; replaced with `TestParse_DefaultRoute`/`TestParse_DefaultRouteNone`, `TestNetwork_ReportsRealAddressGatewayMAC`, `TestNetwork_FailsLoudWithNoDefaultRoute`, `TestNetwork_FailsLoudWhenInterfaceFactsUnreadable`. GOTCHAS #45 appended; STATUS.md updated in the same commit. **NOT re-proved by a fresh live drive this session** — diagnosis worked from the one red drive's evidence only (the reporter's own headless diagnosis session failed, `OAuth session expired`, the same gap #628 hit); the next `selfhosted` rehearsal that reaches `deploy-takeover` is the live proof.
Author
Member

Close report.

What landed: commit 353a3e03 ("sandcastle: #630 — self-hosted full-install never captured its own network facts"), pushed to origin/main.

  • internal/hostprobe/prober.go: Network now reads the real default route + interface address/MAC and fails loud naming what's missing, instead of always returning zero address/gateway/MAC.
  • internal/hostprobe/sources_linux.go: wires DefaultRoute (/proc/net/route parse) and InterfaceAddress (net.InterfaceByName) real sources.
  • internal/hostprobe/sources_other.go: non-Linux stays honestly unbuilt (v1 device end is Linux-only, ADR 0056).
  • internal/hostprobe/parse_test.go, prober_test.go: new red-then-green coverage (TestParse_DefaultRoute, TestParse_DefaultRouteNone, TestNetwork_ReportsRealAddressGatewayMAC, TestNetwork_FailsLoudWithNoDefaultRoute, TestNetwork_FailsLoudWhenInterfaceFactsUnreadable); the old test that asserted always-zero facts is gone — that assertion WAS the bug.
  • docs/GOTCHAS.md #45 and STATUS.md updated in the same commit.

Proof: full go build ./..., go vet ./..., go test ./... green (every package, not just internal/hostprobe). Not re-proved by a fresh live drive — advances #630, the next selfhosted rehearsal reaching deploy-takeover is the live proof, same as the #628/#629 precedent this session's diagnosis followed.

Separately, unrelated to this fix: this ticket's own body came through as raw stdout because the reporter's headless diagnosis session hit OAuth session expired — worth a look if it recurs (matches #628's report of the same failure), not filed separately here since it's out of this ticket's scope.

**Close report.** What landed: commit `353a3e03` ("sandcastle: #630 — self-hosted full-install never captured its own network facts"), pushed to `origin/main`. - `internal/hostprobe/prober.go`: `Network` now reads the real default route + interface address/MAC and fails loud naming what's missing, instead of always returning zero address/gateway/MAC. - `internal/hostprobe/sources_linux.go`: wires `DefaultRoute` (`/proc/net/route` parse) and `InterfaceAddress` (`net.InterfaceByName`) real sources. - `internal/hostprobe/sources_other.go`: non-Linux stays honestly unbuilt (v1 device end is Linux-only, ADR 0056). - `internal/hostprobe/parse_test.go`, `prober_test.go`: new red-then-green coverage (`TestParse_DefaultRoute`, `TestParse_DefaultRouteNone`, `TestNetwork_ReportsRealAddressGatewayMAC`, `TestNetwork_FailsLoudWithNoDefaultRoute`, `TestNetwork_FailsLoudWhenInterfaceFactsUnreadable`); the old test that asserted always-zero facts is gone — that assertion WAS the bug. - `docs/GOTCHAS.md` #45 and `STATUS.md` updated in the same commit. Proof: full `go build ./...`, `go vet ./...`, `go test ./...` green (every package, not just `internal/hostprobe`). **Not re-proved by a fresh live drive** — advances #630, the next `selfhosted` rehearsal reaching `deploy-takeover` is the live proof, same as the #628/#629 precedent this session's diagnosis followed. Separately, unrelated to this fix: this ticket's own body came through as raw stdout because the reporter's headless diagnosis session hit `OAuth session expired` — worth a look if it recurs (matches #628's report of the same failure), not filed separately here since it's out of this ticket's scope.
Owner

Head-start (evidence test-results/drive-selfhosted/20260821T030832Z, tree+helper built at 6710a0b, pin 6710a0b) — NOT the #626/#628 eval failure again: this time the deploy never started at all.

  • Leg 10 timed out at its full 1500 s ceiling waiting for deploy-live | hand-off | deploy-failed. state/founding-state.json: step: "deploying" but no deploy key, and the last event is name-wiring: "rehearsal-b.idss.nz now points at 170.64.235.114". Compare the previous two drives (013253Z, 015833Z): both logged deploy: "gateway deploy started over the established clan connection" (internal/founding/deploy.go:324) immediately after name-wiring and then failed inside the deploy. Here: 25 minutes of silence, no kexec/disko on the droplet (journal has 0 such lines).
  • The app-side kick-off is FoundingStandup.vue onDeploy() (auto when step==='deploying' && !deploy for self-hosted). What runs before the "started" event is composeSelfHostedGateway (selfhostedpath.go:154-), which since #626 calls SeedCommunity (L168) then Secrets().EnsureOperator (L171) before Enroll. Prime suspect: one of those blocks — EnsureOperator shells clan secrets key generate / registerOperator (secrets.go:63-), and a clan CLI call waiting on a prompt (editor, passphrase, git identity, --no-sandbox confirmation) would hang exactly like this with nothing logged. Drive 015833Z (tree 25c9cb5, also post-#626) did get past compose — so check what differs for this founding (fresh state dir? existing age key at the app-scoped path? adoptDefaultKey?). Second suspect: a Go panic in the deploy goroutine (nothing surfaces to the UI) — #629 (6710a0b) touched adapter.go's readiness path; tail(res.Output) on a nil res would do it, though that path should only run on a failed preflight.
  • Evidence gap that blocks this diagnosis: logs/helper.log is 0 bytes this drive (prior drives had the Electron GLX noise in it), so the helper's stderr — where a Go panic or a hanging clan invocation would show — was not captured. launch.ts:102 wires __ocHelperLog; worth checking why it came up empty here before re-driving, or the next red will be just as blind. While there: the in-drive healer/reporter claude calls fail with OAuth session expired on every drive since 00:32Z (manual reproductions all pass); d2… adds logs/claude-env.txt to the next run so that can be diagnosed alongside.

Reproduce on the workstation: take this drive's state dir and run the compose path under go test/a harness with a fake CLI that records the invocation sequence — the last recorded Invocation before silence names the hang.

**Head-start (evidence `test-results/drive-selfhosted/20260821T030832Z`, tree+helper built at `6710a0b`, pin `6710a0b`) — NOT the #626/#628 eval failure again: this time the deploy never started at all.** - Leg 10 timed out at its full 1500 s ceiling waiting for `deploy-live | hand-off | deploy-failed`. `state/founding-state.json`: `step: "deploying"` but **no `deploy` key**, and the last event is `name-wiring: "rehearsal-b.idss.nz now points at 170.64.235.114"`. Compare the previous two drives (`013253Z`, `015833Z`): both logged `deploy: "gateway deploy started over the established clan connection"` (`internal/founding/deploy.go:324`) immediately after name-wiring and then failed *inside* the deploy. Here: 25 minutes of silence, no kexec/disko on the droplet (journal has 0 such lines). - The app-side kick-off is `FoundingStandup.vue` `onDeploy()` (auto when `step==='deploying' && !deploy` for self-hosted). What runs before the "started" event is `composeSelfHostedGateway` (`selfhostedpath.go:154-`), which since #626 calls `SeedCommunity` (L168) then `Secrets().EnsureOperator` (L171) before `Enroll`. **Prime suspect: one of those blocks** — `EnsureOperator` shells `clan secrets key generate` / `registerOperator` (`secrets.go:63-`), and a clan CLI call waiting on a prompt (editor, passphrase, git identity, `--no-sandbox` confirmation) would hang exactly like this with nothing logged. Drive `015833Z` (tree `25c9cb5`, also post-#626) did get past compose — so check what differs for *this* founding (fresh state dir? existing age key at the app-scoped path? `adoptDefaultKey`?). Second suspect: a Go panic in the deploy goroutine (nothing surfaces to the UI) — #629 (`6710a0b`) touched `adapter.go`'s readiness path; `tail(res.Output)` on a nil `res` would do it, though that path should only run on a failed preflight. - **Evidence gap that blocks this diagnosis:** `logs/helper.log` is **0 bytes** this drive (prior drives had the Electron GLX noise in it), so the helper's stderr — where a Go panic or a hanging clan invocation would show — was not captured. `launch.ts:102` wires `__ocHelperLog`; worth checking why it came up empty here before re-driving, or the next red will be just as blind. While there: the in-drive healer/reporter `claude` calls fail with `OAuth session expired` on every drive since 00:32Z (manual reproductions all pass); `d2…` adds `logs/claude-env.txt` to the next run so that can be diagnosed alongside. Reproduce on the workstation: take this drive's state dir and run the compose path under `go test`/a harness with a fake CLI that records the invocation sequence — the last recorded `Invocation` before silence names the hang.
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#630
No description provided.