services-row: the S11 services apply is refused at the sops upload — every non-enrollment inventory write erases #558's IdentityFile query off clan's deploy.targetHost #1497

Closed
opened 2026-09-15 17:19:46 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260915T164205Z (rented-services), leg services-row red at 19 green / 1 red (artifacts/verdict.json, artifacts/legs.json). The founding's own S11 row reports Files did not stand up: "the files row is failed: the deploy did not hold — add Files & documents from the control panel". The community itself came up live — control plane, brand, admin seed, and both public front doors over TLS all green.

The services apply died in ~20 s. logs/founding-state.log → standup.deploy.log:

services  | provisioning the services you placed on the gateway …
preflight | eval preflight passed
update    | the remote build's ssh transport dropped — reconnecting and retrying once
update    | could not reach the node
services  | clan reported: [gateway] root@134.199.145.73: Permission denied (publickey,keyboard-interactive).
            [gateway] failed with error:
            -- 'bash -c '…install -d -m "$1" "$0" && … tar -C "$0" -xzf -' /var/lib/sops-nix 700'

That is clan's sops-nix upload being refused at the ssh door — not a dead box.

The evidence

The rejection is real and narrow. logs/droplet-journal.txt shows the box accepting publickey from the drive host either side of the apply and refusing it only for the two clan-spawned attempts:

  • 17:09:40 Accepted publickey for root … ED25519 SHA256:WagG4Ob…
  • 17:10:01 error: PAM: Authentication failure for root from 134.199.154.244
  • 17:10:03 error: PAM: Authentication failure for root from 134.199.154.244
  • 17:10:04 Accepted publickey for root … ED25519 SHA256:WagG4Ob…

Every IDSS-spawned ssh (which passes -i explicitly) got in; only clan's did not. logs/droplet-do-forensics.txt confirms the box answered throughout (tcp/22: a FRESH connect succeeded, 0% packet loss, no DO power/resize action).

The harvested config repo names the erasure in one commit. state/clan-config git history, inventory.json:

743e162 17:03:28  idss: compose gateway machine dir on gateway
  targetHost: "ssh://root@134.199.145.73?IdentityFile=…/state/rent-operator/id_ed25519&IdentitiesOnly=yes"

68ffaf0 17:09:40  idss: assign gateway the role gateway
- "targetHost": "ssh://root@134.199.145.73?IdentityFile=…&IdentitiesOnly=yes"
+ "targetHost": "root@134.199.145.73"

That is the S11 services provision's own first write, twenty seconds before the apply it disarms. The base gateway deploy (deploy leg, green) survived only because it ran at the enrollment's revision, before that write.

Why it is fatal. internal/clan/render.go:216 re-renders clan's native targetHost through deployTargetHostURI(target, inv.deployIdentity), and inv.deployIdentity is a TRANSIENT per-write field supplied only by the enrollment (internal/clan/enrollment.go:595 writeNodeConfig, internal/clan/enrollment.go:2135 persistTarget). Every other inventory write — AssignRole, SetDeployTarget (internal/clan/config.go:116), the S11 provision's — is a load→mutate→write with no identity in hand, so internal/clan/render.go:340 deployTargetHostURI returned the bare target and the query was dropped. bareTarget (internal/clan/render.go:352) had already discarded it on read.

The steady-state deploy passes no --target-host at all (internal/clan/adapter.go:625-645, updateNode: only --flake, --host-key-check none, --build-host localhost), so the inventory is clan's only channel for that key — exactly what #558 exists to feed. Stripped, clan's second, inventory-resolved sops upload offered only the operator's agent key and was refused.

Suspected layer

internal/clan/render.go — the clan-native inventory render/carry layer (DDR 0010's quarantine). Not the enrollment, not the deploy: both behave as designed; the render simply fails to preserve a field it does not model.

The fix (landed here)

Carry the query as what it is — clan's field, not the IDSS model's — alongside every other unmodelled clan field: clanCarry.identity, captured on parse by a new targetQuery (bareTarget's other half), re-rendered whenever the write brings no identity of its own. A fresh deployIdentity still wins (it is the operation's captured truth); absent one, the file's own query survives. The model still holds only the bare user@host:port (ADR 0126) — render/carry only, no model change. GOTCHAS #235 records the hazard.

Note this is the SECOND red on the same S11 apply: GOTCHAS #234 / #1496's unsandboxed pre-generate fix is what let this run get past the sandbox death (the nextcloud-admin / nextcloud-db vars sealed cleanly at 17:09:46) and reach this one.

Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)

Two-way door, mechanical repair, not a design decision.

Why it is mechanical, not design. #558 already ruled that clan's native deploy.targetHost must carry the founding identity as an IdentityFile+IdentitiesOnly query, because clan's second, inventory-resolved sops upload honours no other channel. That decision is unchanged. The defect is that the render reconstructs the query from a transient field only the enrollment ever populates, so the first non-enrollment write silently erases it — lost state, not a changed intent. The fix makes the code do what #558 already meant. Nothing a community sees, no route, no default, no message at a trust moment, and no secrets-shape or security-posture change: the key path was already persisted in the config repo by the enrollment write (visible in state/clan-config at 743e162); the fix stops it being erased, it does not add, widen, or relocate any trust. The set of keys offered is exactly what #558 specified.

Why it is revertible. One commit touching one non-test source file (internal/clan/render.go, 70 changed lines) inside the DDR 0010 quarantine — nothing outside the package constructs or parses clan's inventory format, so the blast radius is that file. Reverting the commit restores the previous rendering exactly; no migration, no schema change, no on-box state, no persisted artifact that a revert would strand (a repo rendered by the fixed code parses identically under the old code — bareTarget strips the query as it always did).

Proven by which test. clan.TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery (internal/clan/render_test.go): parse a clan inventory whose targetHost carries the identity URI, perform a non-enrollment write (set the role, supply no deployIdentity), assert the URI survives — and assert in the same test that the model still reads bare. Run red before the fix, failing with the drive's exact observed value (clan targetHost = "root@203.0.113.10"), green after. The two existing #558 seam tests (TestRender_DeployIdentitySeedsClanTargetHostButModelStaysBare, TestRender_NoDeployIdentityRendersBareTargetHost) still pass untouched, so neither the enrollment-supplied path nor the genuinely-bare fleet path drifted. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260915T164205Z red at services-row (sig b0b6a45a7146) — self-fixed on the fast lane, commit a887852b3c2a713e8a9f83f311c4f9b9b3c8b7e6; checks: targeted: GOWORK=… go test ./internal/clan/ -run TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery -v — FAIL before the fix (clan targetHost = "root@203.0.113.10", want the identity-carrying URI preserved), PASS after. package: go test ./internal/clan/ — ok (22.6s); go vet ./internal/clan/ — clean; gofmt -l internal/clan/ — clean. wider: go build ./... and go test ./... across the module — all ok, no failures. commit shape: 3 files, 113 changed non-test lines.. evidence: /home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260915T164205Z on matou-workstation.

## The failure Drive `20260915T164205Z` (rented-services), leg `services-row` red at 19 green / 1 red (`artifacts/verdict.json`, `artifacts/legs.json`). The founding's own S11 row reports Files did not stand up: *"the files row is failed: the deploy did not hold — add Files & documents from the control panel"*. The community itself came up live — control plane, brand, admin seed, and both public front doors over TLS all green. The services apply died in ~20 s. `logs/founding-state.log` → `standup.deploy.log`: ``` services | provisioning the services you placed on the gateway … preflight | eval preflight passed update | the remote build's ssh transport dropped — reconnecting and retrying once update | could not reach the node services | clan reported: [gateway] root@134.199.145.73: Permission denied (publickey,keyboard-interactive). [gateway] failed with error: -- 'bash -c '…install -d -m "$1" "$0" && … tar -C "$0" -xzf -' /var/lib/sops-nix 700' ``` That is clan's sops-nix upload being refused at the ssh door — not a dead box. ## The evidence **The rejection is real and narrow.** `logs/droplet-journal.txt` shows the box accepting publickey from the drive host either side of the apply and refusing it only for the two clan-spawned attempts: - `17:09:40` `Accepted publickey for root … ED25519 SHA256:WagG4Ob…` - `17:10:01` `error: PAM: Authentication failure for root from 134.199.154.244` - `17:10:03` `error: PAM: Authentication failure for root from 134.199.154.244` - `17:10:04` `Accepted publickey for root … ED25519 SHA256:WagG4Ob…` Every IDSS-spawned ssh (which passes `-i` explicitly) got in; only clan's did not. `logs/droplet-do-forensics.txt` confirms the box answered throughout (`tcp/22: a FRESH connect succeeded`, 0% packet loss, no DO power/resize action). **The harvested config repo names the erasure in one commit.** `state/clan-config` git history, `inventory.json`: ``` 743e162 17:03:28 idss: compose gateway machine dir on gateway targetHost: "ssh://root@134.199.145.73?IdentityFile=…/state/rent-operator/id_ed25519&IdentitiesOnly=yes" 68ffaf0 17:09:40 idss: assign gateway the role gateway - "targetHost": "ssh://root@134.199.145.73?IdentityFile=…&IdentitiesOnly=yes" + "targetHost": "root@134.199.145.73" ``` That is the S11 services provision's own first write, twenty seconds before the apply it disarms. The base gateway deploy (`deploy` leg, green) survived only because it ran at the enrollment's revision, before that write. **Why it is fatal.** `internal/clan/render.go:216` re-renders clan's native `targetHost` through `deployTargetHostURI(target, inv.deployIdentity)`, and `inv.deployIdentity` is a TRANSIENT per-write field supplied only by the enrollment (`internal/clan/enrollment.go:595` `writeNodeConfig`, `internal/clan/enrollment.go:2135` `persistTarget`). Every other inventory write — `AssignRole`, `SetDeployTarget` (`internal/clan/config.go:116`), the S11 provision's — is a load→mutate→write with no identity in hand, so `internal/clan/render.go:340` `deployTargetHostURI` returned the bare target and the query was dropped. `bareTarget` (`internal/clan/render.go:352`) had already discarded it on read. The steady-state deploy passes **no** `--target-host` at all (`internal/clan/adapter.go:625-645`, `updateNode`: only `--flake`, `--host-key-check none`, `--build-host localhost`), so the inventory is clan's *only* channel for that key — exactly what #558 exists to feed. Stripped, clan's second, inventory-resolved sops upload offered only the operator's agent key and was refused. ## Suspected layer `internal/clan/render.go` — the clan-native inventory render/carry layer (DDR 0010's quarantine). Not the enrollment, not the deploy: both behave as designed; the render simply fails to preserve a field it does not model. ## The fix (landed here) Carry the query as what it is — clan's field, not the IDSS model's — alongside every other unmodelled clan field: `clanCarry.identity`, captured on parse by a new `targetQuery` (`bareTarget`'s other half), re-rendered whenever the write brings no identity of its own. A fresh `deployIdentity` still wins (it is the operation's captured truth); absent one, the file's own query survives. The model still holds only the bare `user@host:port` (ADR 0126) — render/carry only, no model change. GOTCHAS #235 records the hazard. Note this is the SECOND red on the same S11 apply: GOTCHAS #234 / #1496's unsandboxed pre-generate fix is what let this run get past the sandbox death (the `nextcloud-admin` / `nextcloud-db` vars sealed cleanly at 17:09:46) and reach this one. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) Two-way door, mechanical repair, not a design decision. **Why it is mechanical, not design.** #558 already ruled that clan's native `deploy.targetHost` must carry the founding identity as an `IdentityFile`+`IdentitiesOnly` query, because clan's second, inventory-resolved sops upload honours no other channel. That decision is unchanged. The defect is that the render reconstructs the query from a transient field only the enrollment ever populates, so the first non-enrollment write silently erases it — lost state, not a changed intent. The fix makes the code do what #558 already meant. Nothing a community sees, no route, no default, no message at a trust moment, and no secrets-shape or security-posture change: the key path was already persisted in the config repo by the enrollment write (visible in `state/clan-config` at `743e162`); the fix stops it being erased, it does not add, widen, or relocate any trust. The set of keys offered is exactly what #558 specified. **Why it is revertible.** One commit touching one non-test source file (`internal/clan/render.go`, 70 changed lines) inside the DDR 0010 quarantine — nothing outside the package constructs or parses clan's inventory format, so the blast radius is that file. Reverting the commit restores the previous rendering exactly; no migration, no schema change, no on-box state, no persisted artifact that a revert would strand (a repo rendered by the fixed code parses identically under the old code — `bareTarget` strips the query as it always did). **Proven by which test.** `clan.TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery` (`internal/clan/render_test.go`): parse a clan inventory whose `targetHost` carries the identity URI, perform a non-enrollment write (set the role, supply no `deployIdentity`), assert the URI survives — and assert in the same test that the model still reads bare. Run red before the fix, failing with the drive's exact observed value (`clan targetHost = "root@203.0.113.10"`), green after. The two existing #558 seam tests (`TestRender_DeployIdentitySeedsClanTargetHostButModelStaysBare`, `TestRender_NoDeployIdentityRendersBareTargetHost`) still pass untouched, so neither the enrollment-supplied path nor the genuinely-bare fleet path drifted. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260915T164205Z` red at `services-row` (sig b0b6a45a7146) — self-fixed on the fast lane, commit `a887852b3c2a713e8a9f83f311c4f9b9b3c8b7e6`; checks: targeted: `GOWORK=… go test ./internal/clan/ -run TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery -v` — FAIL before the fix (`clan targetHost = "root@203.0.113.10", want the identity-carrying URI preserved`), PASS after. package: `go test ./internal/clan/` — ok (22.6s); `go vet ./internal/clan/` — clean; `gofmt -l internal/clan/` — clean. wider: `go build ./...` and `go test ./...` across the module — all ok, no failures. commit shape: 3 files, 113 changed non-test lines.. evidence: `/home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260915T164205Z` on matou-workstation. <!-- rehearsal-sig: b0b6a45a7146 -->
Author
Member

close-report for #1497 — status success

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

envelope
{
  "issue": 1497,
  "status": "success",
  "commits": [
    "a887852b3c2a713e8a9f83f311c4f9b9b3c8b7e6"
  ],
  "changed_files": [
    "docs/GOTCHAS.md",
    "internal/clan/render.go",
    "internal/clan/render_test.go"
  ],
  "tests": [
    {
      "command": "targeted: `GOWORK=… go test ./internal/clan/ -run TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery -v` — FAIL before the fix (`clan targetHost = \"root@203.0.113.10\", want the identity-carrying URI preserved`), PASS after. package: `go test ./internal/clan/` — ok (22.6s); `go vet ./internal/clan/` — clean; `gofmt -l internal/clan/` — clean. wider: `go build ./...` and `go test ./...` across the module — all ok, no failures. commit shape: 3 files, 113 changed non-test lines.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit a887852b3c2a713e8a9f83f311c4f9b9b3c8b7e6"
  },
  "summary": "The S11 services apply was refused at clan's sops upload because the S11 provision's own `assign role` write re-rendered clan's `deploy.targetHost` bare, erasing #558's IdentityFile query; render.go now carries that query (`clanCarry.identity` + `targetQuery`) across any write that brings no identity of its own.",
  "blockers": []
}
**close-report** for #1497 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1497, "status": "success", "commits": [ "a887852b3c2a713e8a9f83f311c4f9b9b3c8b7e6" ], "changed_files": [ "docs/GOTCHAS.md", "internal/clan/render.go", "internal/clan/render_test.go" ], "tests": [ { "command": "targeted: `GOWORK=… go test ./internal/clan/ -run TestRender_WriteWithoutIdentityKeepsTheClanFileIdentityQuery -v` — FAIL before the fix (`clan targetHost = \"root@203.0.113.10\", want the identity-carrying URI preserved`), PASS after. package: `go test ./internal/clan/` — ok (22.6s); `go vet ./internal/clan/` — clean; `gofmt -l internal/clan/` — clean. wider: `go build ./...` and `go test ./...` across the module — all ok, no failures. commit shape: 3 files, 113 changed non-test lines.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit a887852b3c2a713e8a9f83f311c4f9b9b3c8b7e6" }, "summary": "The S11 services apply was refused at clan's sops upload because the S11 provision's own `assign role` write re-rendered clan's `deploy.targetHost` bare, erasing #558's IdentityFile query; render.go now carries that query (`clanCarry.identity` + `targetQuery`) across any write that brings no identity of its own.", "blockers": [] } ``` </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#1497
No description provided.