activation: self-hosted never switches guest forwards off the local-VM path #634

Closed
opened 2026-08-21 06:02:00 +00:00 by matou-build-agent · 2 comments

Failure

The drive got all the way through deploy-takeover (366s, green — full takeover of the real DigitalOcean box succeeded, gateway rebooted into NixOS, control plane and dashboard seeded) and then the very next leg, activation, faulted in 23ms:

activation faulted: founding: hand the ledger into the fleet: fleetwire: read the guest SSH forward: vm: no guest unit on this host — create the guest first (ADR 0126)

23ms is instant — no network call was even attempted. This is not the known own-VPS pairing frontier (pair was green here, and this run's Access kind is self-hosted/full-install, not own-vps).

Root cause (traced in internal/founding and internal/fleetwire)

handOverLedger (internal/founding/privatepath.go) calls o.fleet.SeedLedger, which is fleetwire.Fleet.SeedLedger (internal/fleetwire/fleet.go). That resolves the guest's SSH port via f.sshPort(), which — when a GuestForwards seam is wired (it is, in prod: app/helper/cmd/helper/wiring_prod.go) — delegates to GuestForwards.SSHPort() (internal/fleetwire/forwards.go). That method defaults to the private path's committed local-VM forward (g.cfg.SSHPort, wired to vm.Manager.SSHPort) unless UseOwnVPS(host) has switched it to the real box's root@<host>:22.

The switch is driven by ensureGuestForwards → ownVPSFoundingHost (internal/founding/ownvpspath.go:156-161):

func ownVPSFoundingHost(s State) string {
	if s.Draft != nil && s.Draft.Access != nil && s.Draft.Access.Kind == AccessOwnVPS {
		return s.Draft.Access.IP
	}
	return ""
}

This only recognizes AccessOwnVPS. This drive's founding-state.json has draft.access.kind: "self-hosted" (AccessSelfHosted) — the full-install/takeover carrier — so ownVPSFoundingHost returns "", UseOwnVPS is never called, and GuestForwards stays on its private-path default: it asks the local VM manager for a guest SSH forward. There is no local VM here (host.json: "qemu": "exit ENOENT: spawn qemu-system-x86_64 ENOENT" — this host doesn't even have qemu), so vm.Manager.SSHPort (internal/vm/manager.go:246) immediately returns the ADR-0126 "no guest unit on this host" error.

The self-hosted path does know the box's real IP by this point — Standup.GatewayIP is populated (209.38.93.61, via knownGatewayIP in standup.go, which explicitly handles AccessSelfHosted) and is used elsewhere (deploy.go's RotateHostKey(ctx, st.GatewayIP), SeedAmbient). ownVPSFoundingHost just never consults it — it only reads s.Draft.Access.IP, which self-hosted drafts don't populate at all.

Corroboration from the live droplet (root@209.38.93.61, still up)

  • No failed units; idss-control-plane active and healthy, listening on :8080, logging composition_whole=false (waiting on the ledger/config repo it never received).
  • curl 127.0.0.1:8080/api/v1/fleet → {"gateway":{...,"provisioned":true,...},"nodes":[]} — alive, un-seeded.
  • /var/lib/idss/ exists but is empty — enroll.json never landed, confirming SeedLedger's scp never ran (the error fired before any SSH/scp attempt).
  • sshd is up on :22 and answered immediately (no host-key friction), so a correctly-targeted ssh -L/direct-SSH approach would have worked fine.

The box and the deploy are sound; the harness/product just never pointed the ledger-handoff SSH call at it.

Suspected layer

Product (internal/founding/ownvpspath.go). GuestForwards/UseOwnVPS (#437) was built to carry both live-box carriers off the local-VM default, but the self-hosted (full-install) carrier was never wired into the switch — only own-VPS was. This is a real gap, not a harness artifact: the same fleetwire code path runs in production for real self-hosted foundings.

What plugging it needs

Extend ownVPSFoundingHost (or add a sibling check) to also return the box's address for AccessSelfHosted, sourced from Standup.GatewayIP (already populated for self-hosted via knownGatewayIP) rather than Draft.Access.IP (which is own-VPS-only). ensureGuestForwards takes State, which already carries Standup, so the fix is local to ownvpspath.go — thread s.Standup.GatewayIP in for the self-hosted case alongside the existing own-VPS Draft.Access.IP case. Same fix should confirm OpenEnrolment/AwaitEnrolment's ensureGuestForwards calls (handoff.go:421,466) pick it up too, since they share the same helper.

drive 20260821T054633Z red at activation: activation faulted: founding: hand the ledger into the fleet: fleetwire: read the guest SSH forward: vm: no guest unit on this host — create the guest first (ADR 0126)
evidence: test-results/…/20260821T054633Z/ on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)

## Failure The drive got all the way through `deploy-takeover` (366s, green — full takeover of the real DigitalOcean box succeeded, gateway rebooted into NixOS, control plane and dashboard seeded) and then the very next leg, `activation`, faulted in 23ms: ``` activation faulted: founding: hand the ledger into the fleet: fleetwire: read the guest SSH forward: vm: no guest unit on this host — create the guest first (ADR 0126) ``` 23ms is instant — no network call was even attempted. This is not the known own-VPS pairing frontier (`pair` was green here, and this run's Access kind is `self-hosted`/full-install, not `own-vps`). ## Root cause (traced in `internal/founding` and `internal/fleetwire`) `handOverLedger` (`internal/founding/privatepath.go`) calls `o.fleet.SeedLedger`, which is `fleetwire.Fleet.SeedLedger` (`internal/fleetwire/fleet.go`). That resolves the guest's SSH port via `f.sshPort()`, which — when a `GuestForwards` seam is wired (it is, in prod: `app/helper/cmd/helper/wiring_prod.go`) — delegates to `GuestForwards.SSHPort()` (`internal/fleetwire/forwards.go`). That method defaults to the **private path**'s committed local-VM forward (`g.cfg.SSHPort`, wired to `vm.Manager.SSHPort`) *unless* `UseOwnVPS(host)` has switched it to the real box's `root@<host>:22`. The switch is driven by `ensureGuestForwards` → `ownVPSFoundingHost` (`internal/founding/ownvpspath.go:156-161`): ```go func ownVPSFoundingHost(s State) string { if s.Draft != nil && s.Draft.Access != nil && s.Draft.Access.Kind == AccessOwnVPS { return s.Draft.Access.IP } return "" } ``` This only recognizes `AccessOwnVPS`. This drive's `founding-state.json` has `draft.access.kind: "self-hosted"` (`AccessSelfHosted`) — the full-install/takeover carrier — so `ownVPSFoundingHost` returns `""`, `UseOwnVPS` is never called, and `GuestForwards` stays on its private-path default: it asks the **local VM manager** for a guest SSH forward. There is no local VM here (`host.json`: `"qemu": "exit ENOENT: spawn qemu-system-x86_64 ENOENT"` — this host doesn't even have qemu), so `vm.Manager.SSHPort` (`internal/vm/manager.go:246`) immediately returns the ADR-0126 "no guest unit on this host" error. The self-hosted path *does* know the box's real IP by this point — `Standup.GatewayIP` is populated (`209.38.93.61`, via `knownGatewayIP` in `standup.go`, which explicitly handles `AccessSelfHosted`) and is used elsewhere (`deploy.go`'s `RotateHostKey(ctx, st.GatewayIP)`, `SeedAmbient`). `ownVPSFoundingHost` just never consults it — it only reads `s.Draft.Access.IP`, which self-hosted drafts don't populate at all. ## Corroboration from the live droplet (root@209.38.93.61, still up) - No failed units; `idss-control-plane` active and healthy, listening on `:8080`, logging `composition_whole=false` (waiting on the ledger/config repo it never received). - `curl 127.0.0.1:8080/api/v1/fleet` → `{"gateway":{...,"provisioned":true,...},"nodes":[]}` — alive, un-seeded. - `/var/lib/idss/` exists but is **empty** — `enroll.json` never landed, confirming `SeedLedger`'s `scp` never ran (the error fired before any SSH/scp attempt). - sshd is up on `:22` and answered immediately (no host-key friction), so a correctly-targeted `ssh -L`/direct-SSH approach would have worked fine. The box and the deploy are sound; the harness/product just never pointed the ledger-handoff SSH call at it. ## Suspected layer **Product** (`internal/founding/ownvpspath.go`). `GuestForwards`/`UseOwnVPS` (#437) was built to carry both live-box carriers off the local-VM default, but the self-hosted (full-install) carrier was never wired into the switch — only own-VPS was. This is a real gap, not a harness artifact: the same fleetwire code path runs in production for real self-hosted foundings. ## What plugging it needs Extend `ownVPSFoundingHost` (or add a sibling check) to also return the box's address for `AccessSelfHosted`, sourced from `Standup.GatewayIP` (already populated for self-hosted via `knownGatewayIP`) rather than `Draft.Access.IP` (which is own-VPS-only). `ensureGuestForwards` takes `State`, which already carries `Standup`, so the fix is local to `ownvpspath.go` — thread `s.Standup.GatewayIP` in for the self-hosted case alongside the existing own-VPS `Draft.Access.IP` case. Same fix should confirm `OpenEnrolment`/`AwaitEnrolment`'s `ensureGuestForwards` calls (`handoff.go:421,466`) pick it up too, since they share the same helper. drive `20260821T054633Z` red at `activation`: `activation faulted: founding: hand the ledger into the fleet: fleetwire: read the guest SSH forward: vm: no guest unit on this host — create the guest first (ADR 0126)` evidence: `test-results/…/20260821T054633Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596) <!-- rehearsal-sig: 4c82deb1e678 -->
Author
Member

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

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

close-report for #634 — status success

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

envelope
{
  "issue": 634,
  "status": "success",
  "commits": [
    "6a59a27"
  ],
  "changed_files": [
    "internal/founding/ownvpspath.go",
    "internal/founding/ownvpspath_internal_test.go",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "go test ./internal/founding/ -run TestGuestForwardHost",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/founding/...",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/founding/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "self-hosted founding switches guest forwards off the local-VM path to the box's real IP": "guestForwardHost returns Standup.GatewayIP for AccessSelfHosted (internal/founding/ownvpspath.go); TestGuestForwardHost self-hosted case asserts it, and that ensureGuestForwards drives UseOwnVPS(GatewayIP) into the wired seam",
    "own-VPS behaviour and ceremony-host origin (#498) unchanged": "ownVPSFoundingHost stays own-VPS-only; TestGuestForwardHost own-VPS case + existing TestOwnVPSCeremonyHost/TestOwnVPS_* pass",
    "no switch on private/rented/manual or before the gateway IP is known": "guestForwardHost returns \"\" for those; TestGuestForwardHost private/no-draft/self-hosted-before-IP cases assert no switch"
  },
  "summary": "Self-hosted founding now switches the guest-facing SSH forwards to the box's real Standup.GatewayIP so the ledger hand-off lands on the box instead of faulting on the missing local VM.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #634 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 634, "status": "success", "commits": [ "6a59a27" ], "changed_files": [ "internal/founding/ownvpspath.go", "internal/founding/ownvpspath_internal_test.go", "STATUS.md" ], "tests": [ { "command": "go test ./internal/founding/ -run TestGuestForwardHost", "exit_code": 0 }, { "command": "go test ./internal/founding/...", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/founding/", "exit_code": 0 } ], "criteria": { "self-hosted founding switches guest forwards off the local-VM path to the box's real IP": "guestForwardHost returns Standup.GatewayIP for AccessSelfHosted (internal/founding/ownvpspath.go); TestGuestForwardHost self-hosted case asserts it, and that ensureGuestForwards drives UseOwnVPS(GatewayIP) into the wired seam", "own-VPS behaviour and ceremony-host origin (#498) unchanged": "ownVPSFoundingHost stays own-VPS-only; TestGuestForwardHost own-VPS case + existing TestOwnVPSCeremonyHost/TestOwnVPS_* pass", "no switch on private/rented/manual or before the gateway IP is known": "guestForwardHost returns \"\" for those; TestGuestForwardHost private/no-draft/self-hosted-before-IP cases assert no switch" }, "summary": "Self-hosted founding now switches the guest-facing SSH forwards to the box's real Standup.GatewayIP so the ledger hand-off lands on the box instead of faulting on the missing local VM.", "reason": "", "blockers": [], "no_code_change": "" } ``` </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#634
No description provided.