honest-error: the agent logs a post-approval VM landing failure as "install command did not reach Pending" (it did reach Pending) #1201

Closed
opened 2026-09-03 21:12:53 +00:00 by matou-build-agent · 19 comments

Split from #1200 (found while fixing the enroll-trust mint gap; not the fault fixed there).

Symptom

When a VM-mode join's post-approval landing fails (e.g. GuestMeshJoin), the agent install path logs the failure as:

install command did not reach Pending

(agent/cmd/agent/main.go, runInstall's top-level log.Error("install command did not reach Pending", "err", err)).

Why it's wrong

This is untrue for a landing failure: the request reached Pending, the operator approved it, and the landing failed after approval. Conflating "never reached Pending" with "failed during landing" misdirects diagnosis — drive 20260903T204213Z (#1200) redded at approve with this exact misleading line in artifacts/join-transcript.txt, and the true cause was an ssh auth refusal three phases later.

Suggested shape

The install path spans redeem → consent → Pending → await-decision → land. The top-level error line should name the phase honestly (ADR 0100 — fail loud with the true cause), rather than a single "did not reach Pending" sentence that only fits the pre-Pending failures. Reachable two-way (a log-string / small phase-tagging change, revertible + unit-provable).

Advances #1153.

Split from #1200 (found while fixing the enroll-trust mint gap; not the fault fixed there). ## Symptom When a VM-mode join's **post-approval landing** fails (e.g. `GuestMeshJoin`), the `agent install` path logs the failure as: ``` install command did not reach Pending ``` (`agent/cmd/agent/main.go`, `runInstall`'s top-level `log.Error("install command did not reach Pending", "err", err)`). ## Why it's wrong This is untrue for a landing failure: the request **reached Pending**, the operator **approved** it, and the landing failed **after** approval. Conflating "never reached Pending" with "failed during landing" misdirects diagnosis — drive `20260903T204213Z` (#1200) redded at `approve` with this exact misleading line in `artifacts/join-transcript.txt`, and the true cause was an ssh auth refusal three phases later. ## Suggested shape The install path spans redeem → consent → Pending → await-decision → land. The top-level error line should name the phase honestly (ADR 0100 — fail loud with the true cause), rather than a single "did not reach Pending" sentence that only fits the pre-Pending failures. Reachable two-way (a log-string / small phase-tagging change, revertible + unit-provable). Advances #1153.
Author
Member

This was generated by AI during triage.

Agent Brief

Category: bug
Summary: The agent install path logs every failure with the fixed line "install command did not reach Pending", even when the request did reach Pending and failed later during post-approval landing — misdirecting diagnosis (ADR 0100: fail loud with the true cause).

Current behavior:
runInstall (in the agent command) has one top-level error line — log.Error("install command did not reach Pending", ...) — emitted for any failure returned by the install flow. The install flow spans multiple phases: redeem → consent → reach-Pending → await operator decision → land (e.g. GuestMeshJoin). When a post-approval landing step fails — the request reached Pending, the operator approved, and landing failed afterwards — the log still claims it "did not reach Pending". Drive 20260903T204213Z (#1200) redded at approve showing this line in the join transcript while the true cause was an ssh auth refusal three phases later.

Desired behavior:
The top-level failure line names the phase that actually failed, honestly. A failure before Pending still reads as "did not reach Pending" (or equivalent); a failure after the request reached Pending — during await-decision or landing — reads as a phase-tagged sentence carrying the real underlying error, not "did not reach Pending". The wrapped err is preserved in all cases.

Key interfaces:

  • The install flow in the agent command (runInstall and whatever it calls to drive redeem → consent → Pending → decision → land). The flow needs enough phase awareness that the top-level error handler can attribute the failure to the phase it occurred in — e.g. threading a phase tag/error type through, or classifying the returned error — rather than emitting one hardcoded pre-Pending sentence.

Acceptance criteria:

  • A failure that occurs before the request reaches Pending logs a message stating the request never reached Pending (behavior unchanged for that case).
  • A failure that occurs after Pending (await-decision or landing, e.g. a GuestMeshJoin failure) logs a message naming that later phase, and does not claim the request "did not reach Pending".
  • The underlying error is still included in the log line in every case.
  • A unit test covers at least one pre-Pending failure and one post-approval landing failure, asserting the phase named in the message.

Out of scope:

  • Fixing the underlying landing/ssh failures themselves (#1200 minted the enroll-trust key; #1202 fixes the GuestMeshJoin error text). This ticket is only the top-level phase attribution in the install path.
  • Changing the redeem/consent/land control flow beyond what phase attribution needs.

Advances #1153. Ruled ready-for-agent (no ADR-0174 residue): this is a log-string / phase-tagging change, revertible by a later commit and provable by a unit test — a two-way door with no one-way-door surface (no credentials, no security widening, no trust accept, no data destruction, no hardware). Verified the target line exists in the agent command's runInstall.

> *This was generated by AI during triage.* ## Agent Brief **Category:** bug **Summary:** The `agent install` path logs every failure with the fixed line "install command did not reach Pending", even when the request *did* reach Pending and failed later during post-approval landing — misdirecting diagnosis (ADR 0100: fail loud with the true cause). **Current behavior:** `runInstall` (in the agent command) has one top-level error line — `log.Error("install command did not reach Pending", ...)` — emitted for *any* failure returned by the install flow. The install flow spans multiple phases: redeem → consent → reach-Pending → await operator decision → land (e.g. `GuestMeshJoin`). When a **post-approval landing** step fails — the request reached Pending, the operator approved, and landing failed afterwards — the log still claims it "did not reach Pending". Drive `20260903T204213Z` (#1200) redded at `approve` showing this line in the join transcript while the true cause was an ssh auth refusal three phases later. **Desired behavior:** The top-level failure line names the phase that actually failed, honestly. A failure before Pending still reads as "did not reach Pending" (or equivalent); a failure after the request reached Pending — during await-decision or landing — reads as a phase-tagged sentence carrying the real underlying error, not "did not reach Pending". The wrapped `err` is preserved in all cases. **Key interfaces:** - The install flow in the agent command (`runInstall` and whatever it calls to drive redeem → consent → Pending → decision → land). The flow needs enough phase awareness that the top-level error handler can attribute the failure to the phase it occurred in — e.g. threading a phase tag/error type through, or classifying the returned error — rather than emitting one hardcoded pre-Pending sentence. **Acceptance criteria:** - [ ] A failure that occurs *before* the request reaches Pending logs a message stating the request never reached Pending (behavior unchanged for that case). - [ ] A failure that occurs *after* Pending (await-decision or landing, e.g. a `GuestMeshJoin` failure) logs a message naming that later phase, and does **not** claim the request "did not reach Pending". - [ ] The underlying error is still included in the log line in every case. - [ ] A unit test covers at least one pre-Pending failure and one post-approval landing failure, asserting the phase named in the message. **Out of scope:** - Fixing the underlying landing/ssh failures themselves (#1200 minted the enroll-trust key; #1202 fixes the `GuestMeshJoin` error text). This ticket is only the top-level phase attribution in the install path. - Changing the redeem/consent/land control flow beyond what phase attribution needs. --- Advances #1153. Ruled `ready-for-agent` (no ADR-0174 residue): this is a log-string / phase-tagging change, revertible by a later commit and provable by a unit test — a two-way door with no one-way-door surface (no credentials, no security widening, no trust accept, no data destruction, no hardware). Verified the target line exists in the agent command's `runInstall`.
Author
Member

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

close-report for #1201 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit 432ffed1bc is not reachable from origin/main (not landed)
  • changed_files: 'agent/cmd/agent/main.go' is not in the diff of the claimed commits
  • changed_files: 'agent/cmd/agent/main_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/join/cli.go' is not in the diff of the claimed commits
  • changed_files: 'internal/join/cli_test.go' is not in the diff of the claimed commits
envelope
{
  "issue": 1201,
  "status": "success",
  "commits": [
    "432ffed1bc5c10d4ed7554385ce62140adf1459b"
  ],
  "changed_files": [
    "agent/cmd/agent/main.go",
    "agent/cmd/agent/main_test.go",
    "internal/join/cli.go",
    "internal/join/cli_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/join/ ./agent/cmd/agent/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/join/ ./agent/cmd/agent/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A failure before the request reaches Pending logs a message stating the request never reached Pending (behavior unchanged)": "installFailureMessage returns \"install command did not reach Pending\" for PhaseFetch/PhasePending and any unphased error (agent/cmd/agent/main.go); asserted by TestInstallFailureMessage_NamesPhaseHonestly and TestRunInstallCommand_TagsFailurePhase's fetch subtest",
    "A failure after Pending (await-decision or landing, e.g. GuestMeshJoin) logs a message naming that later phase and does not claim the request did not reach Pending": "PhaseLanding maps to \"install command reached Pending but failed during landing\"; RunInstallCommand tags AwaitAndLand failures PhaseLanding (Phase.ReachedPending()==true); asserted by the GuestMeshJoin post-approval subtest in cli_test.go and the landing case in main_test.go",
    "The underlying error is still included in the log line in every case": "InstallPhaseError.Unwrap preserves the cause; log.Error(installFailureMessage(err), \"err\", err) still carries err; test asserts wrapped 'ssh: handshake failed' survives (internal/join/cli_test.go)",
    "A unit test covers at least one pre-Pending failure and one post-approval landing failure asserting the phase named in the message": "TestRunInstallCommand_TagsFailurePhase (fetch + GuestMeshJoin subtests) and TestInstallFailureMessage_NamesPhaseHonestly cover both, asserting phase/message"
  },
  "summary": "agent install now logs the true failing phase — a post-approval landing failure no longer masquerades as \"did not reach Pending\".",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1201 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 432ffed1bc5c10d4ed7554385ce62140adf1459b is not reachable from origin/main (not landed) - changed_files: 'agent/cmd/agent/main.go' is not in the diff of the claimed commits - changed_files: 'agent/cmd/agent/main_test.go' is not in the diff of the claimed commits - changed_files: 'internal/join/cli.go' is not in the diff of the claimed commits - changed_files: 'internal/join/cli_test.go' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 1201, "status": "success", "commits": [ "432ffed1bc5c10d4ed7554385ce62140adf1459b" ], "changed_files": [ "agent/cmd/agent/main.go", "agent/cmd/agent/main_test.go", "internal/join/cli.go", "internal/join/cli_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/join/ ./agent/cmd/agent/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/join/ ./agent/cmd/agent/", "exit_code": 0 } ], "criteria": { "A failure before the request reaches Pending logs a message stating the request never reached Pending (behavior unchanged)": "installFailureMessage returns \"install command did not reach Pending\" for PhaseFetch/PhasePending and any unphased error (agent/cmd/agent/main.go); asserted by TestInstallFailureMessage_NamesPhaseHonestly and TestRunInstallCommand_TagsFailurePhase's fetch subtest", "A failure after Pending (await-decision or landing, e.g. GuestMeshJoin) logs a message naming that later phase and does not claim the request did not reach Pending": "PhaseLanding maps to \"install command reached Pending but failed during landing\"; RunInstallCommand tags AwaitAndLand failures PhaseLanding (Phase.ReachedPending()==true); asserted by the GuestMeshJoin post-approval subtest in cli_test.go and the landing case in main_test.go", "The underlying error is still included in the log line in every case": "InstallPhaseError.Unwrap preserves the cause; log.Error(installFailureMessage(err), \"err\", err) still carries err; test asserts wrapped 'ssh: handshake failed' survives (internal/join/cli_test.go)", "A unit test covers at least one pre-Pending failure and one post-approval landing failure asserting the phase named in the message": "TestRunInstallCommand_TagsFailurePhase (fetch + GuestMeshJoin subtests) and TestInstallFailureMessage_NamesPhaseHonestly cover both, asserting phase/message" }, "summary": "agent install now logs the true failing phase — a post-approval landing failure no longer masquerades as \"did not reach Pending\".", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Author
Member

close-report for #1201 — status success

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

envelope
{
  "issue": 1201,
  "status": "success",
  "commits": [
    "432ffed1bc5c10d4ed7554385ce62140adf1459b"
  ],
  "changed_files": [
    "agent/cmd/agent/main.go",
    "agent/cmd/agent/main_test.go",
    "internal/join/cli.go",
    "internal/join/cli_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/join/ ./agent/cmd/agent/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/join/ ./agent/cmd/agent/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A failure before the request reaches Pending logs a message stating the request never reached Pending (behavior unchanged)": "installFailureMessage returns \"install command did not reach Pending\" for PhaseFetch/PhasePending and any unphased error (agent/cmd/agent/main.go); asserted by TestInstallFailureMessage_NamesPhaseHonestly and TestRunInstallCommand_TagsFailurePhase's fetch subtest",
    "A failure after Pending (await-decision or landing, e.g. GuestMeshJoin) logs a message naming that later phase and does not claim the request did not reach Pending": "PhaseLanding maps to \"install command reached Pending but failed during landing\"; RunInstallCommand tags AwaitAndLand failures PhaseLanding (Phase.ReachedPending()==true); asserted by the GuestMeshJoin post-approval subtest in cli_test.go and the landing case in main_test.go",
    "The underlying error is still included in the log line in every case": "InstallPhaseError.Unwrap preserves the cause; log.Error(installFailureMessage(err), \"err\", err) still carries err; test asserts wrapped 'ssh: handshake failed' survives (internal/join/cli_test.go)",
    "A unit test covers at least one pre-Pending failure and one post-approval landing failure asserting the phase named in the message": "TestRunInstallCommand_TagsFailurePhase (fetch + GuestMeshJoin subtests) and TestInstallFailureMessage_NamesPhaseHonestly cover both, asserting phase/message"
  },
  "summary": "agent install now logs the true failing phase — a post-approval landing failure no longer masquerades as \"did not reach Pending\".",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1201 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1201, "status": "success", "commits": [ "432ffed1bc5c10d4ed7554385ce62140adf1459b" ], "changed_files": [ "agent/cmd/agent/main.go", "agent/cmd/agent/main_test.go", "internal/join/cli.go", "internal/join/cli_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/join/ ./agent/cmd/agent/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/join/ ./agent/cmd/agent/", "exit_code": 0 } ], "criteria": { "A failure before the request reaches Pending logs a message stating the request never reached Pending (behavior unchanged)": "installFailureMessage returns \"install command did not reach Pending\" for PhaseFetch/PhasePending and any unphased error (agent/cmd/agent/main.go); asserted by TestInstallFailureMessage_NamesPhaseHonestly and TestRunInstallCommand_TagsFailurePhase's fetch subtest", "A failure after Pending (await-decision or landing, e.g. GuestMeshJoin) logs a message naming that later phase and does not claim the request did not reach Pending": "PhaseLanding maps to \"install command reached Pending but failed during landing\"; RunInstallCommand tags AwaitAndLand failures PhaseLanding (Phase.ReachedPending()==true); asserted by the GuestMeshJoin post-approval subtest in cli_test.go and the landing case in main_test.go", "The underlying error is still included in the log line in every case": "InstallPhaseError.Unwrap preserves the cause; log.Error(installFailureMessage(err), \"err\", err) still carries err; test asserts wrapped 'ssh: handshake failed' survives (internal/join/cli_test.go)", "A unit test covers at least one pre-Pending failure and one post-approval landing failure asserting the phase named in the message": "TestRunInstallCommand_TagsFailurePhase (fetch + GuestMeshJoin subtests) and TestInstallFailureMessage_NamesPhaseHonestly cover both, asserting phase/message" }, "summary": "agent install now logs the true failing phase — a post-approval landing failure no longer masquerades as \"did not reach Pending\".", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#1201
No description provided.