deploy-services: the pinned apply dialled node-req-0003.clan — the defect is ALREADY FIXED on main by cf7c40b7 (landed after the drive); verify, close, re-drive #1209

Closed
opened 2026-09-04 01:37:17 +00:00 by matou-build-agent · 3 comments

Summary

Drive 20260904T004019Z (--target device, 27 green / 1 red) redded at deploy-services. The defect is diagnosed and confirmed below — and it is already repaired at origin/main. The drive ran at commit 1041a1d5 (artifacts/verdict.json); cf7c40b7 landed afterwards and fixes precisely this failure, naming this drive in its own message. No new code work is needed. Action: confirm the fix against this diagnosis, close, and re-arm the drive.

The failure

provision: deploy node-req-0003: clan: deploy failed on 1 node(s):
  node-req-0003: clan: connectivity on node-req-0003: could not reach the node:
  [node-req-0003] ssh: Could not resolve hostname node-req-0003.clan: Name or service not known
  -- 'bash -c 'install -d -m "$1" "$0" && ... tar -C "$0" -xzf -'' /var/lib/sops-nix 700'

Evidence: artifacts/legs.json (leg deploy-services, red, 142154ms), artifacts/journey.json (fault), logs/gateway-journal.txt:1893 (the in-guest control plane's own provision deploy failed record, device=node-req-0003), artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.md.

The error wraps as provision: deploy <node> — the applyRevision path (internal/provision/deploy.go:524) — not provision: seed <node> (internal/provision/deploy.go:492). So StepSeedClosures passed and StepDeployServices failed. That split is the whole diagnosis.

Root cause (as it stood at the drive commit 1041a1d5)

  1. deployServicesOnly records the applied revision at the end of the selection-commit step — internal/provision/deploy.go:434 (run.Revision = string(rev)).
  2. It then captures the member's SSH door after that, committing a further revision — internal/provision/deploy.go:459 (SetDeployTarget → m.Deploy.TargetHost, internal/clan/config.go:97). At 1041a1d5 the returned commit was discarded (if _, err := ...), so run.Revision still pointed at the pre-capture commit.
  3. Supply.Seed resolves its door from the working tree (loadInventory(repo.Dir()), internal/clan/supply.go:26-38) and archives through the unpinned ref flakeRef(dir, "") (internal/clan/supply.go:55). It therefore saw the just-captured root@<wt0> and succeeded — as did the RotateHostKey host-key learn at that same door (deploy.go:481-487).
  4. updateNode applies the pinned ref flakeRef(dir, d.req.Revision) (internal/clan/adapter.go:633 → git+file://<dir>?rev=<rev>, internal/clan/adapter.go:1199-1204). At that revision the machine had no deploy.targetHost, so clan-cli fell back to its <name>.clan hostname and could not resolve node-req-0003.clan while uploading the sops-nix secrets.

Commit-then-apply (ADR 0102) is the mechanic: a config commit made after the revision is recorded is invisible to the apply. The seed/apply asymmetry (working tree vs. pinned rev) is exactly why this presented as "the door is fine, the deploy can't find it".

The fix already on main

cf7c40b7 — internal/provision/deploy.go:459-473 keeps the capture's commit and advances run.Revision to it. The advance is monotone: ConfigRepo.Mutate returns the current tip on a no-op apply (internal/clan/configrepo.go:80-84), so an unchanged target returns the standing tip rather than an empty revision. TestDeploy_VMModeDrivesClanDeployServicesOnlyNeverEnroll (internal/provision/deploy_test.go:227-241) now pins commit-4 — the capture inside the applied revision.

Verified in this checkout at 432ffed1: CGO_ENABLED=0 go test ./internal/provision/ → ok git.matou.nz/Matou/idss/internal/provision 0.014s. (Plain go test build-fails here: gcc not in $PATH — a machine gap, not a code fault.)

I reviewed the fix for gaps and found none: the advance is skipped only on the two branches that also skip the capture (d.MeshAddress == "", and the gateway's founding-owned root@127.0.0.1 self-target), and the gateway's own row was captured at founding (idss: deploy target for gateway re-captured as root@127.0.0.1:22, cc2a70d in the harvested bundle), so it is an ancestor of every later revision. No other config mutation sits between the revision record and the apply.

Evidence that was absent (stated for the record)

  • No state/clan-config — the drive writes state/clan-config-snapshot/ (logs/clan-config-snapshot.log, config.bundle, HEAD, tree.txt).
  • No droplet-journal.txt — this drive harvests gateway-journal.txt (621KB) and device-journal.txt (185KB) instead.
  • logs/state-logs.log is an ENOENT record: no state logs directory at .../standing-rented/state/logs.
  • The captured config snapshot is the wrong repo for this red. captureConfigFlake snapshots clanConfigRepoDir(live) = the drive host's <stateDir>/clan-config (app/tests/e2e/fixtures/evidence.ts:249-262). On a post-flip --target device drive the failing deploy runs in the gateway droplet's in-guest control plane, whose config repo is on that box. The harvested bundle is 31 commits, all founding/gateway, with zero node-req-0003 commits — so the revision/targetHost ordering could not be confirmed from the captured repo and had to be reconstructed from source. Worth considering as a follow-up in the same class as 5996e36d (which made the guest probes target-aware but deliberately left the local state probes; evidence.ts:459-473). Not filed as a separate defect — it is an evidence-fidelity gap, not a fault that reds a leg.
  • Related, already fixed post-drive: the guest collectors probed the drive host (logs/guest-unit-file.log: no ~/.config/systemd/user/idss-guest.service; logs/qemu.log: no qemu process; host.json records qemu: ENOENT). That is the fault 5996e36d repaired.

Layer

Product code — internal/provision (the commit-then-apply revision pin), not harness or fixture. No refusal rule fired; I am not healing because the defect is already fixed and no defective line remains in the checkout to edit.

drive 20260904T004019Z red at deploy-services: deploy failed (clean-retry): provision: deploy node-req-0003: clan: deploy failed on 1 node(s): node-req-0003: clan: connectivity on node-req-0003: could not reach the node: [node-req-0003] ssh: Could
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260904T004019Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Summary Drive `20260904T004019Z` (`--target device`, 27 green / 1 red) redded at `deploy-services`. The defect is diagnosed and confirmed below — **and it is already repaired at `origin/main`**. The drive ran at commit `1041a1d5` (`artifacts/verdict.json`); `cf7c40b7` landed afterwards and fixes precisely this failure, naming this drive in its own message. No new code work is needed. **Action: confirm the fix against this diagnosis, close, and re-arm the drive.** ## The failure ``` provision: deploy node-req-0003: clan: deploy failed on 1 node(s): node-req-0003: clan: connectivity on node-req-0003: could not reach the node: [node-req-0003] ssh: Could not resolve hostname node-req-0003.clan: Name or service not known -- 'bash -c 'install -d -m "$1" "$0" && ... tar -C "$0" -xzf -'' /var/lib/sops-nix 700' ``` Evidence: `artifacts/legs.json` (leg `deploy-services`, red, 142154ms), `artifacts/journey.json` (`fault`), `logs/gateway-journal.txt:1893` (the in-guest control plane's own `provision deploy failed` record, `device=node-req-0003`), `artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.md`. The error wraps as `provision: deploy <node>` — the `applyRevision` path (`internal/provision/deploy.go:524`) — **not** `provision: seed <node>` (`internal/provision/deploy.go:492`). So `StepSeedClosures` passed and `StepDeployServices` failed. That split is the whole diagnosis. ## Root cause (as it stood at the drive commit `1041a1d5`) 1. `deployServicesOnly` records the applied revision at the end of the selection-commit step — `internal/provision/deploy.go:434` (`run.Revision = string(rev)`). 2. It then captures the member's SSH door **after** that, committing a further revision — `internal/provision/deploy.go:459` (`SetDeployTarget` → `m.Deploy.TargetHost`, `internal/clan/config.go:97`). At `1041a1d5` the returned commit was discarded (`if _, err := ...`), so `run.Revision` still pointed at the pre-capture commit. 3. `Supply.Seed` resolves its door from the **working tree** (`loadInventory(repo.Dir())`, `internal/clan/supply.go:26-38`) and archives through the unpinned ref `flakeRef(dir, "")` (`internal/clan/supply.go:55`). It therefore saw the just-captured `root@<wt0>` and **succeeded** — as did the `RotateHostKey` host-key learn at that same door (`deploy.go:481-487`). 4. `updateNode` applies the **pinned** ref `flakeRef(dir, d.req.Revision)` (`internal/clan/adapter.go:633` → `git+file://<dir>?rev=<rev>`, `internal/clan/adapter.go:1199-1204`). At that revision the machine had no `deploy.targetHost`, so clan-cli fell back to its `<name>.clan` hostname and could not resolve `node-req-0003.clan` while uploading the sops-nix secrets. Commit-then-apply (ADR 0102) is the mechanic: a config commit made after the revision is recorded is invisible to the apply. The seed/apply asymmetry (working tree vs. pinned rev) is exactly why this presented as "the door is fine, the deploy can't find it". ## The fix already on main `cf7c40b7` — `internal/provision/deploy.go:459-473` keeps the capture's commit and advances `run.Revision` to it. The advance is monotone: `ConfigRepo.Mutate` returns the current tip on a no-op apply (`internal/clan/configrepo.go:80-84`), so an unchanged target returns the standing tip rather than an empty revision. `TestDeploy_VMModeDrivesClanDeployServicesOnlyNeverEnroll` (`internal/provision/deploy_test.go:227-241`) now pins `commit-4` — the capture inside the applied revision. Verified in this checkout at `432ffed1`: `CGO_ENABLED=0 go test ./internal/provision/` → `ok git.matou.nz/Matou/idss/internal/provision 0.014s`. (Plain `go test` build-fails here: `gcc` not in `$PATH` — a machine gap, not a code fault.) I reviewed the fix for gaps and found none: the advance is skipped only on the two branches that also skip the capture (`d.MeshAddress == ""`, and the gateway's founding-owned `root@127.0.0.1` self-target), and the gateway's own row was captured at founding (`idss: deploy target for gateway re-captured as root@127.0.0.1:22`, `cc2a70d` in the harvested bundle), so it is an ancestor of every later revision. No other config mutation sits between the revision record and the apply. ## Evidence that was absent (stated for the record) - **No `state/clan-config`** — the drive writes `state/clan-config-snapshot/` (`logs/clan-config-snapshot.log`, `config.bundle`, `HEAD`, `tree.txt`). - **No `droplet-journal.txt`** — this drive harvests `gateway-journal.txt` (621KB) and `device-journal.txt` (185KB) instead. - **`logs/state-logs.log` is an ENOENT record**: `no state logs directory at .../standing-rented/state/logs`. - **The captured config snapshot is the wrong repo for this red.** `captureConfigFlake` snapshots `clanConfigRepoDir(live)` = the drive host's `<stateDir>/clan-config` (`app/tests/e2e/fixtures/evidence.ts:249-262`). On a post-flip `--target device` drive the failing deploy runs in the **gateway droplet's** in-guest control plane, whose config repo is on that box. The harvested bundle is 31 commits, all founding/gateway, with **zero** `node-req-0003` commits — so the revision/`targetHost` ordering could not be confirmed from the captured repo and had to be reconstructed from source. Worth considering as a follow-up in the same class as `5996e36d` (which made the *guest* probes target-aware but deliberately left the local state probes; `evidence.ts:459-473`). Not filed as a separate defect — it is an evidence-fidelity gap, not a fault that reds a leg. - Related, already fixed post-drive: the guest collectors probed the drive host (`logs/guest-unit-file.log`: no `~/.config/systemd/user/idss-guest.service`; `logs/qemu.log`: no qemu process; `host.json` records `qemu: ENOENT`). That is the fault `5996e36d` repaired. ## Layer Product code — `internal/provision` (the commit-then-apply revision pin), not harness or fixture. No refusal rule fired; I am not healing because the defect is already fixed and no defective line remains in the checkout to edit. drive `20260904T004019Z` red at `deploy-services`: `deploy failed (clean-retry): provision: deploy node-req-0003: clan: deploy failed on 1 node(s): node-req-0003: clan: connectivity on node-req-0003: could not reach the node: [node-req-0003] ssh: Could` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260904T004019Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: db4e706c778c -->
Author
Member

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

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

Confirmed — cf7c40b7 (landed by session before this ticket was filed): the target capture now ADVANCES run.Revision, so the pinned-flake apply evaluates a machine that knows its own door. The hot-path pin holds rotate-hostkey → seed → deploy with the applied revision = the capture's commit. Closing so drive 12 fires.

Confirmed — `cf7c40b7` (landed by session before this ticket was filed): the target capture now ADVANCES `run.Revision`, so the pinned-flake apply evaluates a machine that knows its own door. The hot-path pin holds `rotate-hostkey → seed → deploy` with the applied revision = the capture's commit. Closing so drive 12 fires.
ben closed this issue 2026-09-04 01:39:18 +00:00
Author
Member

close-report for #1209 — status success

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

envelope
{
  "issue": 1209,
  "status": "success",
  "commits": [],
  "changed_files": [],
  "tests": [
    {
      "command": "CGO_ENABLED=0 go test ./internal/provision/",
      "exit_code": 0
    },
    {
      "command": "CGO_ENABLED=0 go test ./internal/provision/ -run TestDeploy_VMModeDrivesClanDeployServicesOnlyNeverEnroll -v",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The deploy-services red (node-req-0003.clan unresolved) is diagnosed as the commit-then-apply revision-pin asymmetry": "Confirmed against source: SetDeployTarget committed after run.Revision was recorded, so the pinned apply (flakeRef with rev) evaluated a machine with no deploy.targetHost and fell to clan's <name>.clan fallback (internal/provision/deploy.go, internal/clan/adapter.go, ADR 0102)",
    "The defect is already fixed on origin/main": "cf7c40b7 is an ancestor of origin/main (git merge-base --is-ancestor cf7c40b7 origin/main -> YES); deployServicesOnly now advances run.Revision to the capture's commit (internal/provision/deploy.go:473: run.Revision = string(rev))",
    "The fix is verified in this checkout": "CGO_ENABLED=0 go test ./internal/provision/ -> ok 0.017s; TestDeploy_VMModeDrivesClanDeployServicesOnlyNeverEnroll pins commit-4 (the capture inside the applied revision) and PASSES"
  },
  "summary": "Confirmed the deploy-services red is the commit-then-apply revision-pin defect already repaired on main by cf7c40b7; the fix is present in this checkout and its guarding test passes green — no new code needed, closing so the drive can be re-armed.",
  "reason": "The defect was fixed post-drive by cf7c40b7 (landed after the drive commit 1041a1d5); no defective line remains in the checkout to edit.",
  "blockers": [],
  "no_code_change": "Verify-and-close ticket: the defect is already fixed on origin/main by cf7c40b7 (run.Revision now advances to the deploy-target capture's commit, internal/provision/deploy.go:473). Verified reachable from origin/main and the guarding test TestDeploy_VMModeDrivesClanDeployServicesOnlyNeverEnroll passes green. Nothing to change; the ticket asks only to confirm, close, and re-arm the drive."
}
**close-report** for #1209 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1209, "status": "success", "commits": [], "changed_files": [], "tests": [ { "command": "CGO_ENABLED=0 go test ./internal/provision/", "exit_code": 0 }, { "command": "CGO_ENABLED=0 go test ./internal/provision/ -run TestDeploy_VMModeDrivesClanDeployServicesOnlyNeverEnroll -v", "exit_code": 0 } ], "criteria": { "The deploy-services red (node-req-0003.clan unresolved) is diagnosed as the commit-then-apply revision-pin asymmetry": "Confirmed against source: SetDeployTarget committed after run.Revision was recorded, so the pinned apply (flakeRef with rev) evaluated a machine with no deploy.targetHost and fell to clan's <name>.clan fallback (internal/provision/deploy.go, internal/clan/adapter.go, ADR 0102)", "The defect is already fixed on origin/main": "cf7c40b7 is an ancestor of origin/main (git merge-base --is-ancestor cf7c40b7 origin/main -> YES); deployServicesOnly now advances run.Revision to the capture's commit (internal/provision/deploy.go:473: run.Revision = string(rev))", "The fix is verified in this checkout": "CGO_ENABLED=0 go test ./internal/provision/ -> ok 0.017s; TestDeploy_VMModeDrivesClanDeployServicesOnlyNeverEnroll pins commit-4 (the capture inside the applied revision) and PASSES" }, "summary": "Confirmed the deploy-services red is the commit-then-apply revision-pin defect already repaired on main by cf7c40b7; the fix is present in this checkout and its guarding test passes green — no new code needed, closing so the drive can be re-armed.", "reason": "The defect was fixed post-drive by cf7c40b7 (landed after the drive commit 1041a1d5); no defective line remains in the checkout to edit.", "blockers": [], "no_code_change": "Verify-and-close ticket: the defect is already fixed on origin/main by cf7c40b7 (run.Revision now advances to the deploy-target capture's commit, internal/provision/deploy.go:473). Verified reachable from origin/main and the guarding test TestDeploy_VMModeDrivesClanDeployServicesOnlyNeverEnroll passes green. Nothing to change; the ticket asks only to confirm, close, and re-arm the drive." } ``` </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.

Reference
Matou/idss#1209
No description provided.