REGRESSION (a887852b/#1497): the carried IdentityFile query rides onto the re-captured loopback deploy target — every control-panel apply on a community founded since 2026-09-15 17:20Z fails "root@127.0.0.1: Permission denied" (Whakatōhea Demo brand… #1504

Closed
opened 2026-09-16 01:19:40 +00:00 by ben · 2 comments
Owner

Symptom

On the Whakatōhea Demo (founded 2026-09-16 00:12Z by the phase-9 journey, kept), applying the brand kit from the control panel fails:

brandkit: deploy applied kit: clan: deploy failed on 1 node(s): gateway: clan: connectivity on gateway: could not reach the node:
[gateway] root@127.0.0.1: Permission denied (publickey,keyboard-interactive).
[gateway] failed with error: -- 'bash -c 'install -d -m "$1" "$0" && find "$0" -mindepth 1 -delete && tar -C "$0" -xzf -' /var/lib/sops-nix 700'

Every control-panel apply on this community — brand kit, add a service (P4), anything that rides clan machines update from the gateway's own control plane — fails identically. It is not demo-specific.

Cause — a regression from a887852b (#1497, the healer's fast-lane landing 2026-09-15 17:20Z)

The box's config repo, inventory.json (/srv/idss/config):

"targetHost": "ssh://root@127.0.0.1:22?IdentityFile=/home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260915T235523Z/state/rent-operator/id_ed25519&IdentitiesOnly=yes"

That is the laptop's rent-operator key path (the founding app's #558 identity), glued onto the loopback target the hand-off re-captures for the control plane's self-deploy (idss: deploy target for gateway re-captured as root@127.0.0.1:22, internal/clan/config.go SetDeployTarget, 00:11:53Z). On the gateway that file does not exist, and IdentitiesOnly=yes forbids ssh from offering root's own /root/.ssh/id_ed25519 (the idss-self-deploy key that IS in /root/.ssh/authorized_keys), so the self-deploy is refused at the first hop (the sops upload).

Before a887852b SetDeployTarget wrote the bare root@127.0.0.1:22, ssh used root's default key, and self-deploys worked (every droplet/member drive's P4 leg). a887852b made every non-enrollment inventory write carry the file's existing ?IdentityFile=… query so the S11 founding apply keeps the laptop's key (correct there: same host, same laptop) — but it carries it across a target change too. SetDeployTarget names a NEW user@host (the box itself) for a NEW principal (the control plane on the box), and the laptop's identity is meaningless there.

Fix (two-way door)

internal/clan/render.go: carry the identity query only when the write leaves the bare target (user@host:port) unchanged; a write that CHANGES the bare target (SetDeployTarget) renders it bare (or with the identity the caller supplies via deployIdentity). Seam test beside TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery: a re-capture from root@<public-ip> to root@127.0.0.1:22 drops the laptop query. GOTCHAS #235 gains the counter-case.

Then the phase-9 journey needs a tooth for this: it founds and proves the gateway's own services but never asks the panel for an apply afterwards, so rented-services went 28/28 on a community whose every later apply was broken. Add a post-hand-off leg (a brand-kit apply from the panel, or the cheapest P4 apply) so the drive reds on a broken self-deploy — the healer's fast lane landed a887852b with only a seam test, exactly the case ADR 0174's veto exists for.

Live repair of the demo box

The Whakatōhea Demo is Ben's standing demo (KEPT, do not release). Its inventory is being hand-repaired to the bare loopback target so the brand kit can apply; the product fix is still needed for every community founded from now on.

Evidence

Demo box /srv/idss/config/inventory.json + git log -- inventory.json (commit ee3c036 re-capture, then five set var spec writes carrying the query); /root/.ssh/authorized_keys line 2 idss-self-deploy; the panel's error text above (Ben, 2026-09-16). Filed from Ben's phase-9 demo session.

## Symptom On the Whakatōhea Demo (founded 2026-09-16 00:12Z by the phase-9 journey, kept), applying the brand kit from the control panel fails: ``` brandkit: deploy applied kit: clan: deploy failed on 1 node(s): gateway: clan: connectivity on gateway: could not reach the node: [gateway] root@127.0.0.1: Permission denied (publickey,keyboard-interactive). [gateway] failed with error: -- 'bash -c 'install -d -m "$1" "$0" && find "$0" -mindepth 1 -delete && tar -C "$0" -xzf -' /var/lib/sops-nix 700' ``` Every control-panel apply on this community — brand kit, add a service (P4), anything that rides `clan machines update` from the gateway's own control plane — fails identically. It is not demo-specific. ## Cause — a regression from a887852b (#1497, the healer's fast-lane landing 2026-09-15 17:20Z) The box's config repo, `inventory.json` (`/srv/idss/config`): ``` "targetHost": "ssh://root@127.0.0.1:22?IdentityFile=/home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260915T235523Z/state/rent-operator/id_ed25519&IdentitiesOnly=yes" ``` That is the **laptop's** rent-operator key path (the founding app's #558 identity), glued onto the **loopback** target the hand-off re-captures for the control plane's self-deploy (`idss: deploy target for gateway re-captured as root@127.0.0.1:22`, `internal/clan/config.go` `SetDeployTarget`, 00:11:53Z). On the gateway that file does not exist, and `IdentitiesOnly=yes` forbids ssh from offering root's own `/root/.ssh/id_ed25519` (the `idss-self-deploy` key that IS in `/root/.ssh/authorized_keys`), so the self-deploy is refused at the first hop (the sops upload). Before a887852b `SetDeployTarget` wrote the bare `root@127.0.0.1:22`, ssh used root's default key, and self-deploys worked (every droplet/member drive's P4 leg). a887852b made every non-enrollment inventory write **carry the file's existing `?IdentityFile=…` query** so the S11 founding apply keeps the laptop's key (correct there: same host, same laptop) — but it carries it across a **target change** too. `SetDeployTarget` names a NEW user@host (the box itself) for a NEW principal (the control plane on the box), and the laptop's identity is meaningless there. ## Fix (two-way door) `internal/clan/render.go`: carry the identity query only when the write leaves the bare target (`user@host:port`) unchanged; a write that CHANGES the bare target (`SetDeployTarget`) renders it bare (or with the identity the caller supplies via `deployIdentity`). Seam test beside `TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery`: a re-capture from `root@<public-ip>` to `root@127.0.0.1:22` drops the laptop query. GOTCHAS #235 gains the counter-case. Then the **phase-9 journey needs a tooth for this**: it founds and proves the gateway's own services but never asks the panel for an apply afterwards, so `rented-services` went 28/28 on a community whose every later apply was broken. Add a post-hand-off leg (a brand-kit apply from the panel, or the cheapest P4 apply) so the drive reds on a broken self-deploy — the healer's fast lane landed a887852b with only a seam test, exactly the case ADR 0174's veto exists for. ## Live repair of the demo box The Whakatōhea Demo is Ben's standing demo (KEPT, do not release). Its inventory is being hand-repaired to the bare loopback target so the brand kit can apply; the product fix is still needed for every community founded from now on. ## Evidence Demo box `/srv/idss/config/inventory.json` + `git log -- inventory.json` (commit `ee3c036` re-capture, then five `set var spec` writes carrying the query); `/root/.ssh/authorized_keys` line 2 `idss-self-deploy`; the panel's error text above (Ben, 2026-09-16). Filed from Ben's phase-9 demo session.

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

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

close-report for #1504 — status success

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

envelope
{
  "issue": 1504,
  "status": "success",
  "commits": [
    "6ec5d4c3"
  ],
  "changed_files": [
    "STATUS.md",
    "app/tests/e2e/fixtures/demoProfile.test.ts",
    "app/tests/e2e/fixtures/demoProfile.ts",
    "app/tests/e2e/fixtures/rentedServices.test.ts",
    "app/tests/e2e/fixtures/rentedServices.ts",
    "app/tests/e2e/journey.rented-services.spec.ts",
    "docs/GOTCHAS.md",
    "internal/clan/render.go",
    "internal/clan/render_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/ -run TestRender",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "npx vitest run tests/e2e/fixtures/rentedServices.test.ts tests/e2e/fixtures/demoProfile.test.ts",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc -p tsconfig.json --noEmit",
      "exit_code": 0
    },
    {
      "command": "npx eslint (changed e2e files)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "render.go: carry the identity query only when the write leaves the bare target unchanged; a write that CHANGES the bare target (SetDeployTarget) renders it bare (or with deployIdentity)": "internal/clan/render.go — clanCarry.identityHost records the parse-time bare target per machine; renderClan drops carry.identity[name] when carry.identityHost[name] != m.Deploy.TargetHost, so a same-target write carries it (#1497) and a target change renders bare unless a fresh deployIdentity is supplied",
    "Seam test beside TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery: a re-capture from root@<public-ip> to root@127.0.0.1:22 drops the laptop query": "internal/clan/render_test.go TestRender_TargetChangeDropsTheCarriedIdentityQuery — parses ssh://root@203.0.113.10?IdentityFile=…, changes TargetHost to root@127.0.0.1:22, asserts the render carries no IdentityFile; red before the render.go fix, green after (go test ./internal/clan/ -run TestRender exit 0)",
    "GOTCHAS #235 gains the counter-case": "docs/GOTCHAS.md #235 — new Counter-case paragraph on carrying the identity too far across a target change, naming identityHost + the two seam poles + the panel-apply tooth",
    "phase-9 journey needs a tooth: add a post-hand-off apply leg (a brand-kit apply from the panel) so the drive reds on a broken self-deploy": "app/tests/e2e/journey.rented-services.spec.ts — new standing-drive panel-apply leg calls reapplyBrandKitInSettings (synchronous ApplyBrandKit self-deploy, ADR 0107) after the hand-off; RENTED_SERVICES_LEGS gains panel-apply (19->20), demoLegs drops the standing-only tail so the kept demo keeps its brand; unit pins updated and green"
  },
  "summary": "render.go drops the carried IdentityFile query on a target-changing write (SetDeployTarget loopback re-capture) so post-hand-off panel applies work; phase-9 drive gains a panel-apply self-deploy tooth.",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1504 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1504, "status": "success", "commits": [ "6ec5d4c3" ], "changed_files": [ "STATUS.md", "app/tests/e2e/fixtures/demoProfile.test.ts", "app/tests/e2e/fixtures/demoProfile.ts", "app/tests/e2e/fixtures/rentedServices.test.ts", "app/tests/e2e/fixtures/rentedServices.ts", "app/tests/e2e/journey.rented-services.spec.ts", "docs/GOTCHAS.md", "internal/clan/render.go", "internal/clan/render_test.go" ], "tests": [ { "command": "go test ./internal/clan/ -run TestRender", "exit_code": 0 }, { "command": "go vet ./internal/clan/", "exit_code": 0 }, { "command": "npx vitest run tests/e2e/fixtures/rentedServices.test.ts tests/e2e/fixtures/demoProfile.test.ts", "exit_code": 0 }, { "command": "npx vue-tsc -p tsconfig.json --noEmit", "exit_code": 0 }, { "command": "npx eslint (changed e2e files)", "exit_code": 0 } ], "criteria": { "render.go: carry the identity query only when the write leaves the bare target unchanged; a write that CHANGES the bare target (SetDeployTarget) renders it bare (or with deployIdentity)": "internal/clan/render.go — clanCarry.identityHost records the parse-time bare target per machine; renderClan drops carry.identity[name] when carry.identityHost[name] != m.Deploy.TargetHost, so a same-target write carries it (#1497) and a target change renders bare unless a fresh deployIdentity is supplied", "Seam test beside TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery: a re-capture from root@<public-ip> to root@127.0.0.1:22 drops the laptop query": "internal/clan/render_test.go TestRender_TargetChangeDropsTheCarriedIdentityQuery — parses ssh://root@203.0.113.10?IdentityFile=…, changes TargetHost to root@127.0.0.1:22, asserts the render carries no IdentityFile; red before the render.go fix, green after (go test ./internal/clan/ -run TestRender exit 0)", "GOTCHAS #235 gains the counter-case": "docs/GOTCHAS.md #235 — new Counter-case paragraph on carrying the identity too far across a target change, naming identityHost + the two seam poles + the panel-apply tooth", "phase-9 journey needs a tooth: add a post-hand-off apply leg (a brand-kit apply from the panel) so the drive reds on a broken self-deploy": "app/tests/e2e/journey.rented-services.spec.ts — new standing-drive panel-apply leg calls reapplyBrandKitInSettings (synchronous ApplyBrandKit self-deploy, ADR 0107) after the hand-off; RENTED_SERVICES_LEGS gains panel-apply (19->20), demoLegs drops the standing-only tail so the kept demo keeps its brand; unit pins updated and green" }, "summary": "render.go drops the carried IdentityFile query on a target-changing write (SetDeployTarget loopback re-capture) so post-hand-off panel applies work; phase-9 drive gains a panel-apply self-deploy tooth.", "blockers": [], "no_code_change": "" } ``` </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#1504
No description provided.