device-add: the terminal says 'did not reach Pending' after a guest-create failure, but the request IS pending and the panel offers Approve for a device with no VM #2006

Closed
opened 2026-09-30 01:12:34 +00:00 by ben · 2 comments
Owner

Symptom

The install terminal ended with

level=ERROR msg="install command did not reach Pending" … err="join: create vm guest: …"

but the gateway's ledger says otherwise: GET /api/v1/enroll/pending holds the request pending (req-0002, bens-mac-04, mode vm), and the control panel's Fleet tab offers the operator an Approve for a device whose guest does not exist. Approving would walk the landing (mesh join into the guest over loopback SSH) against nothing.

Whakatōhea Demo, 2026-09-30 00:51Z.

Cause

By design Consent pairs first and creates the guest second (internal/join/app.go:177-207: "the request is paired regardless of what the guest create does next"), and the resume anchor is saved between the two. So a create failure leaves a Pending request — correct for a resumable transient fault — but:

  • installFailureMessage (agent/cmd/agent/main.go:440-455) prints the one fixed line "did not reach Pending" for every failure after redeem, which is false here.
  • Nothing tells the operator side. The pending card carries no "guest not yet up" state; guest_spec is the only hint and the card does not show it.
  • The standing idss-agent join service resumed the anchor 16 s later and logged waiting for the operator's decision… — so the device is now waiting for an approval it cannot land, with the same stale VM config (see the cold-install ticket).

Fix

  • The device end tells the truth: after a successful Pair, a create failure prints "paired — the VM could not be created: . Fix it and re-run the same command; the request stays pending" and exits non-zero. "did not reach Pending" is printed only when Pair itself did not happen.
  • The Pending view carries whether the device's guest is up (a guest_state the device reports at pair time and updates on create success/failure through the poll it already runs), and the panel's pending card shows "VM not yet created" with Approve held until it is — or the approval landing checks it and refuses with the reason instead of starting the mesh join.
  • A seam test: Pair ok + Create fails → the terminal line, the view's guest state, and Approve's refusal.

Cold-install VM create (the failure that exposed it) and the zero-floor server role — filed alongside.

Siblings

Found in the one hand run (bens-mac-04 → Whakatōhea Demo, 2026-09-30): #2002 #2003 #2004 #2005 #2007

## Symptom The install terminal ended with ``` level=ERROR msg="install command did not reach Pending" … err="join: create vm guest: …" ``` but the gateway's ledger says otherwise: `GET /api/v1/enroll/pending` holds the request **pending** (`req-0002`, `bens-mac-04`, mode vm), and the control panel's Fleet tab offers the operator an **Approve** for a device whose guest does not exist. Approving would walk the landing (mesh join into the guest over loopback SSH) against nothing. Whakatōhea Demo, 2026-09-30 00:51Z. ## Cause By design `Consent` pairs first and creates the guest second (`internal/join/app.go:177-207`: "the request is paired regardless of what the guest create does next"), and the resume anchor is saved between the two. So a create failure leaves a Pending request — correct for a resumable transient fault — but: - `installFailureMessage` (`agent/cmd/agent/main.go:440-455`) prints the one fixed line "did not reach Pending" for every failure after redeem, which is false here. - Nothing tells the operator side. The pending card carries no "guest not yet up" state; `guest_spec` is the only hint and the card does not show it. - The standing `idss-agent join` service resumed the anchor 16 s later and logged `waiting for the operator's decision…` — so the device is now waiting for an approval it cannot land, with the same stale VM config (see the cold-install ticket). ## Fix - The device end tells the truth: after a successful Pair, a create failure prints "paired — the VM could not be created: <reason>. Fix it and re-run the same command; the request stays pending" and exits non-zero. "did not reach Pending" is printed only when Pair itself did not happen. - The Pending view carries whether the device's guest is up (a `guest_state` the device reports at pair time and updates on create success/failure through the poll it already runs), and the panel's pending card shows "VM not yet created" with Approve held until it is — or the approval landing checks it and refuses with the reason instead of starting the mesh join. - A seam test: Pair ok + Create fails → the terminal line, the view's guest state, and Approve's refusal. ## Related Cold-install VM create (the failure that exposed it) and the zero-floor `server` role — filed alongside. ## Siblings Found in the one hand run (bens-mac-04 → Whakatōhea Demo, 2026-09-30): #2002 #2003 #2004 #2005 #2007

swarm-claim host=matou-dev-server-01 run=36153
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=36153 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #2006 — status success

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

envelope
{
  "issue": 2006,
  "status": "success",
  "commits": [
    "203657a1ac78be8886859ea7ff34216fa9d19558"
  ],
  "changed_files": [
    "STATUS.md",
    "agent/cmd/agent/main.go",
    "agent/cmd/agent/main_test.go",
    "control-plane/cmd/control-plane/resting_composition.go",
    "internal/enroll/enroll.go",
    "internal/enroll/errors.go",
    "internal/enroll/ledger.go",
    "internal/enroll/persisted.go",
    "internal/enrollwire/client.go",
    "internal/enrollwire/device_transport_integration_test.go",
    "internal/enrollwire/enrollwire.go",
    "internal/enrollwire/server.go",
    "internal/enrollwire/taxonomy_test.go",
    "internal/join/app.go",
    "internal/join/cli.go",
    "internal/join/cli_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/join/ ./internal/enroll/ ./internal/enrollwire/ ./agent/cmd/agent/ ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "go test ./control-plane/... ./app/helper/...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/enroll/... ./internal/enrollwire/... ./internal/join/... ./agent/... ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The device end tells the truth: after a successful Pair, a create failure prints 'paired — the VM could not be created: <reason>. Fix it and re-run the same command; the request stays pending' and exits non-zero; 'did not reach Pending' is printed only when Pair itself did not happen": "internal/join/cli.go RunTerminal prints the paired-guest-failed line and returns the paired view; RunInstallCommand tags the new join.PhaseGuestCreate; agent/cmd/agent/main.go installFailureMessage names the guest create for PhaseGuestCreate and keeps 'did not reach Pending' only for the non-paired phase — proven by TestRunInstallCommand_GuestCreateFailsAfterPair (internal/join/cli_test.go) and TestInstallFailureMessage_NamesPhaseHonestly's guest-create case (agent/cmd/agent/main_test.go)",
    "The Pending view carries whether the device's guest is up (a guest_state the device reports at pair time and updates on create success/failure); the approval landing checks it and refuses with the reason instead of starting the mesh join": "RequestView.GuestState/GuestStateReason (internal/enroll/enroll.go), set GuestPending at VM Pair (ledger.go), reported via ControlPlane.ReportGuestState over POST /api/v1/enroll/requests/{id}/guest-state (enroll.go interface, ledger.go+persisted.go impl, enrollwire client.go/server.go), device reports it in Consent on Create success/failure (internal/join/app.go); Ledger.Approve refuses a GuestFailed VM request with GuestNotUpError (ledger.go, errors.go) — took the 'or the approval landing refuses' option per the ticket. Proven by TestRunInstallCommand_GuestCreateFailsAfterPair and TestDeviceTransport_ReportGuestStateOverHTTP (internal/enrollwire/device_transport_integration_test.go)",
    "A seam test: Pair ok + Create fails → the terminal line, the view's guest state, and Approve's refusal": "TestRunInstallCommand_GuestCreateFailsAfterPair (internal/join/cli_test.go) asserts all three at the join seam over the real enroll ledger — the terminal line + PhaseGuestCreate, the pending view's GuestFailed+reason, and the refused Approve (GuestNotUpError), plus a fixed re-run's release; TestDeviceTransport_ReportGuestStateOverHTTP proves the same over the real HTTP wire"
  },
  "summary": "A VM-mode install whose guest create fails after pairing now tells the operator's terminal the truth and holds the operator's Approve until the guest stands up.",
  "blockers": []
}
**close-report** for #2006 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 2006, "status": "success", "commits": [ "203657a1ac78be8886859ea7ff34216fa9d19558" ], "changed_files": [ "STATUS.md", "agent/cmd/agent/main.go", "agent/cmd/agent/main_test.go", "control-plane/cmd/control-plane/resting_composition.go", "internal/enroll/enroll.go", "internal/enroll/errors.go", "internal/enroll/ledger.go", "internal/enroll/persisted.go", "internal/enrollwire/client.go", "internal/enrollwire/device_transport_integration_test.go", "internal/enrollwire/enrollwire.go", "internal/enrollwire/server.go", "internal/enrollwire/taxonomy_test.go", "internal/join/app.go", "internal/join/cli.go", "internal/join/cli_test.go" ], "tests": [ { "command": "go test ./internal/join/ ./internal/enroll/ ./internal/enrollwire/ ./agent/cmd/agent/ ./internal/controlapi/", "exit_code": 0 }, { "command": "go test ./control-plane/... ./app/helper/...", "exit_code": 0 }, { "command": "golangci-lint run ./internal/enroll/... ./internal/enrollwire/... ./internal/join/... ./agent/... ./control-plane/...", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 } ], "criteria": { "The device end tells the truth: after a successful Pair, a create failure prints 'paired — the VM could not be created: <reason>. Fix it and re-run the same command; the request stays pending' and exits non-zero; 'did not reach Pending' is printed only when Pair itself did not happen": "internal/join/cli.go RunTerminal prints the paired-guest-failed line and returns the paired view; RunInstallCommand tags the new join.PhaseGuestCreate; agent/cmd/agent/main.go installFailureMessage names the guest create for PhaseGuestCreate and keeps 'did not reach Pending' only for the non-paired phase — proven by TestRunInstallCommand_GuestCreateFailsAfterPair (internal/join/cli_test.go) and TestInstallFailureMessage_NamesPhaseHonestly's guest-create case (agent/cmd/agent/main_test.go)", "The Pending view carries whether the device's guest is up (a guest_state the device reports at pair time and updates on create success/failure); the approval landing checks it and refuses with the reason instead of starting the mesh join": "RequestView.GuestState/GuestStateReason (internal/enroll/enroll.go), set GuestPending at VM Pair (ledger.go), reported via ControlPlane.ReportGuestState over POST /api/v1/enroll/requests/{id}/guest-state (enroll.go interface, ledger.go+persisted.go impl, enrollwire client.go/server.go), device reports it in Consent on Create success/failure (internal/join/app.go); Ledger.Approve refuses a GuestFailed VM request with GuestNotUpError (ledger.go, errors.go) — took the 'or the approval landing refuses' option per the ticket. Proven by TestRunInstallCommand_GuestCreateFailsAfterPair and TestDeviceTransport_ReportGuestStateOverHTTP (internal/enrollwire/device_transport_integration_test.go)", "A seam test: Pair ok + Create fails → the terminal line, the view's guest state, and Approve's refusal": "TestRunInstallCommand_GuestCreateFailsAfterPair (internal/join/cli_test.go) asserts all three at the join seam over the real enroll ledger — the terminal line + PhaseGuestCreate, the pending view's GuestFailed+reason, and the refused Approve (GuestNotUpError), plus a fixed re-run's release; TestDeviceTransport_ReportGuestStateOverHTTP proves the same over the real HTTP wire" }, "summary": "A VM-mode install whose guest create fails after pairing now tells the operator's terminal the truth and holds the operator's Approve until the guest stands up.", "blockers": [] } ``` </details>
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.

Dependencies

No dependencies set.

Reference
Matou/idss#2006
No description provided.