stand-up retry re-deploys over root-SSH after activation closed that door — Permission denied on a converged gateway #550

Closed
opened 2026-08-14 23:47:57 +00:00 by ben · 3 comments
Owner

Symptom

2026-08-14 cold proof drive: after a genuinely-successful gateway activation was falsely faulted (#549), Retry the stand-up re-drove the deploy and the control-plane row failed for real:

[gateway] root@127.0.0.1: Permission denied (publickey,keyboard-interactive).
-- 'bash -c 'install -d -m "$1" "$0" && find "$0" -mindepth 1 -delete && tar -C "$0" -xzf -' /var/lib/sops-nix 700'
1 hosts failed with an error.

The re-deploy pushes sops secrets over root@127.0.0.1 — but the previous attempt's activation already applied the hardening that closes the root-SSH door (the #414 triad, working as designed). The retry re-uses a transport the successful activation ceremonially destroyed.

Cause

FoundingStandupPrivate documents re-driving stand-up-private as THE retry (spec §2, "Idempotent — a re-entry resumes"), but the control-plane deploy leg is only idempotent BEFORE activation: once the hardened config is live, root-SSH secret-push cannot work again. The retry path has no awareness of the activation boundary — it neither detects the gateway is already converged (skip forward) nor switches to the post-activation transport the later rows (dashboard/brand/admin) use.

Rule

A stand-up retry that reaches the control-plane row against an already-activated gateway must not attempt the pre-activation root-SSH path. Either: probe convergence first (the activated system generation / service health) and mark the row done, or route the re-deploy through the post-activation channel. "Permission denied against the door we ourselves closed" should never surface to the operator as a deploy failure.

Proof

Drive founding to a successful activation; force a fault after it (or use #549 until fixed); Retry the stand-up: the control-plane row must pass (converged-skip or new transport), and the drive must continue to dashboard/brand/admin.

Chained with #549 on the 2026-08-14 cold drive: #549 faults every fresh drive at activation, and this defect walls every retry — together they block the cold-machine proof (ADR 0110/0171, #425 ride).

## Symptom 2026-08-14 cold proof drive: after a genuinely-successful gateway activation was falsely faulted (#549), **Retry the stand-up** re-drove the deploy and the control-plane row failed for real: ``` [gateway] root@127.0.0.1: Permission denied (publickey,keyboard-interactive). -- 'bash -c 'install -d -m "$1" "$0" && find "$0" -mindepth 1 -delete && tar -C "$0" -xzf -' /var/lib/sops-nix 700' 1 hosts failed with an error. ``` The re-deploy pushes sops secrets over `root@127.0.0.1` — but the previous attempt's activation already applied the hardening that closes the root-SSH door (the #414 triad, working as designed). The retry re-uses a transport the successful activation ceremonially destroyed. ## Cause `FoundingStandupPrivate` documents re-driving stand-up-private as THE retry (spec §2, "Idempotent — a re-entry resumes"), but the control-plane deploy leg is only idempotent BEFORE activation: once the hardened config is live, root-SSH secret-push cannot work again. The retry path has no awareness of the activation boundary — it neither detects the gateway is already converged (skip forward) nor switches to the post-activation transport the later rows (dashboard/brand/admin) use. ## Rule A stand-up retry that reaches the control-plane row against an already-activated gateway must not attempt the pre-activation root-SSH path. Either: probe convergence first (the activated system generation / service health) and mark the row done, or route the re-deploy through the post-activation channel. "Permission denied against the door we ourselves closed" should never surface to the operator as a deploy failure. ## Proof Drive founding to a successful activation; force a fault after it (or use #549 until fixed); Retry the stand-up: the control-plane row must pass (converged-skip or new transport), and the drive must continue to dashboard/brand/admin. Chained with #549 on the 2026-08-14 cold drive: #549 faults every fresh drive at activation, and this defect walls every retry — together they block the cold-machine proof (ADR 0110/0171, #425 ride).
Author
Owner

This was generated by AI during triage.

Verification: Confirmed the founding stand-up retry/idempotency machinery exists (internal/founding — standup/journey code, explicitly documented as re-driving on retry) with no activation-boundary awareness found in it; consistent with the reporter's live-drive evidence (exact Permission denied transcript against root@127.0.0.1 after a real activation). Not already implemented — no convergence-skip or post-activation transport switch found for the control-plane row.

Agent Brief

Category: bug
Summary: Retrying stand-up after the gateway has already activated re-attempts the pre-activation root-SSH secret push, which activation itself has deliberately locked out — the retry fails with a permission-denied error instead of recognizing the gateway is already converged.

Current behavior:
Stand-up-private's retry path re-drives the deploy from the beginning, including the control-plane row's root-SSH secret push (e.g. sops-nix provisioning). This is correct for retries that occur before activation. But once a prior attempt's activation has succeeded, it deliberately closes the root-SSH door as part of its hardening (the existing security triad) — so a later retry hitting the control-plane row attempts the same pre-activation transport against a door that no longer opens, and fails with Permission denied (publickey,keyboard-interactive). The retry path has no way to detect that the gateway is already converged, and no alternate transport for the rows that come after activation (the ones the later dashboard/brand/admin rows already use).

Desired behavior:
When a stand-up retry reaches the control-plane row against a gateway that has already activated, it must not attempt the pre-activation root-SSH path. Instead, either: (a) probe the gateway's convergence (e.g. the activated system generation, or service health) before attempting the row, and if already converged, mark the row done and continue; or (b) route the row's re-deploy through the post-activation transport channel the later rows already use. A retry against an already-closed root-SSH door must never surface to the operator as a deploy failure — the drive continues on to the following rows (dashboard/brand/admin) either way.

Key interfaces:

  • The stand-up retry path's control-plane row handling — gains a convergence check (or transport switch) that runs before attempting the pre-activation root-SSH secret push.
  • Whatever already reports/tracks the gateway's activation state (system generation, service health) — reused as the convergence signal rather than invented fresh.

Acceptance criteria:

  • Driving founding to a successful activation, then forcing a fault and retrying the stand-up, results in the control-plane row passing (either via converged-skip or the post-activation transport) rather than failing on Permission denied.
  • The drive continues past the control-plane row to dashboard/brand/admin on this retry path.
  • A retry against a gateway that has not yet activated is unchanged — it still uses the pre-activation root-SSH path as today.

Out of scope:

  • #549 (the false-FAIL activation health-check issue this is chained after) — separate ticket, separate fix, assume it's already fixed.
  • Any change to what activation itself does to close the root-SSH door — that hardening is by design and stays.
> *This was generated by AI during triage.* **Verification:** Confirmed the founding stand-up retry/idempotency machinery exists (`internal/founding` — standup/journey code, explicitly documented as re-driving on retry) with no activation-boundary awareness found in it; consistent with the reporter's live-drive evidence (exact `Permission denied` transcript against `root@127.0.0.1` after a real activation). Not already implemented — no convergence-skip or post-activation transport switch found for the control-plane row. ## Agent Brief **Category:** bug **Summary:** Retrying stand-up after the gateway has already activated re-attempts the pre-activation root-SSH secret push, which activation itself has deliberately locked out — the retry fails with a permission-denied error instead of recognizing the gateway is already converged. **Current behavior:** Stand-up-private's retry path re-drives the deploy from the beginning, including the control-plane row's root-SSH secret push (e.g. `sops-nix` provisioning). This is correct for retries that occur *before* activation. But once a prior attempt's activation has succeeded, it deliberately closes the root-SSH door as part of its hardening (the existing security triad) — so a later retry hitting the control-plane row attempts the same pre-activation transport against a door that no longer opens, and fails with `Permission denied (publickey,keyboard-interactive)`. The retry path has no way to detect that the gateway is already converged, and no alternate transport for the rows that come after activation (the ones the later dashboard/brand/admin rows already use). **Desired behavior:** When a stand-up retry reaches the control-plane row against a gateway that has already activated, it must not attempt the pre-activation root-SSH path. Instead, either: (a) probe the gateway's convergence (e.g. the activated system generation, or service health) before attempting the row, and if already converged, mark the row done and continue; or (b) route the row's re-deploy through the post-activation transport channel the later rows already use. A retry against an already-closed root-SSH door must never surface to the operator as a deploy failure — the drive continues on to the following rows (dashboard/brand/admin) either way. **Key interfaces:** - The stand-up retry path's control-plane row handling — gains a convergence check (or transport switch) that runs before attempting the pre-activation root-SSH secret push. - Whatever already reports/tracks the gateway's activation state (system generation, service health) — reused as the convergence signal rather than invented fresh. **Acceptance criteria:** - [ ] Driving founding to a successful activation, then forcing a fault and retrying the stand-up, results in the control-plane row passing (either via converged-skip or the post-activation transport) rather than failing on `Permission denied`. - [ ] The drive continues past the control-plane row to dashboard/brand/admin on this retry path. - [ ] A retry against a gateway that has *not* yet activated is unchanged — it still uses the pre-activation root-SSH path as today. **Out of scope:** - #549 (the false-FAIL activation health-check issue this is chained after) — separate ticket, separate fix, assume it's already fixed. - Any change to what activation itself does to close the root-SSH door — that hardening is by design and stays.
Author
Owner

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

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

close-report for #550 — status success

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

envelope
{
  "issue": 550,
  "status": "success",
  "commits": [
    "256156328dcb3dfb74721e8d7a6edae727f158d4"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/founding/deploy.go",
    "internal/founding/deploy_test.go",
    "internal/founding/export_test.go",
    "internal/founding/standup.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/founding/...",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/founding/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Driving founding to a successful activation, then forcing a fault and retrying the stand-up, results in the control-plane row passing (converged-skip or post-activation transport) rather than failing on Permission denied": "TestIssue550_RetryAfterActivationSkipsPreActivationRootSSHApply (deploy_test.go) — first drive activates then reds post-activation; the retry (reconcileFails=FailConnectivity modelling the closed root-SSH door) reaches DeployLive via the converged-skip, and Deploys()==1 proves the pre-activation apply was NOT re-attempted. runDeploy gates the apply behind !st.Activated (deploy.go).",
    "The drive continues past the control-plane row to dashboard/brand/admin on this retry path": "Same test asserts ds.ControlPlane non-empty and ds.Admin==\"ben@example.nz\" — the drive ran through brand and admin after the control-plane converged-skip.",
    "A retry against a gateway that has not yet activated is unchanged — it still uses the pre-activation root-SSH path as today": "TestIssue550_RetryBeforeActivationStillApplies — a first apply that fails BEFORE activation never sets st.Activated, so the resume re-applies (Deploys()==2) over the still-open door."
  },
  "summary": "runDeploy records a persisted Standup.Activated boundary and skips the pre-activation root-SSH control-plane apply on a retry against an already-activated gateway, letting the convergence probe carry the row so the drive continues instead of faulting Permission denied.",
  "blockers": []
}
**close-report** for #550 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 550, "status": "success", "commits": [ "256156328dcb3dfb74721e8d7a6edae727f158d4" ], "changed_files": [ "STATUS.md", "internal/founding/deploy.go", "internal/founding/deploy_test.go", "internal/founding/export_test.go", "internal/founding/standup.go" ], "tests": [ { "command": "go test ./internal/founding/...", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/founding/...", "exit_code": 0 } ], "criteria": { "Driving founding to a successful activation, then forcing a fault and retrying the stand-up, results in the control-plane row passing (converged-skip or post-activation transport) rather than failing on Permission denied": "TestIssue550_RetryAfterActivationSkipsPreActivationRootSSHApply (deploy_test.go) — first drive activates then reds post-activation; the retry (reconcileFails=FailConnectivity modelling the closed root-SSH door) reaches DeployLive via the converged-skip, and Deploys()==1 proves the pre-activation apply was NOT re-attempted. runDeploy gates the apply behind !st.Activated (deploy.go).", "The drive continues past the control-plane row to dashboard/brand/admin on this retry path": "Same test asserts ds.ControlPlane non-empty and ds.Admin==\"ben@example.nz\" — the drive ran through brand and admin after the control-plane converged-skip.", "A retry against a gateway that has not yet activated is unchanged — it still uses the pre-activation root-SSH path as today": "TestIssue550_RetryBeforeActivationStillApplies — a first apply that fails BEFORE activation never sets st.Activated, so the resume re-applies (Deploys()==2) over the still-open door." }, "summary": "runDeploy records a persisted Standup.Activated boundary and skips the pre-activation root-SSH control-plane apply on a retry against an already-activated gateway, letting the convergence probe carry the row so the drive continues instead of faulting Permission denied.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-15 01:51:31 +00:00
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#550
No description provided.