deploy-archive: a mid-clone TCP reset fetching the pinned clan-cli (git+…/clan-core) is stolen by the generic eval case and filed config_eval — the one-shot transport retry never fires and the operator is told to fix a flake that is fine #1272

Closed
opened 2026-09-06 09:03:26 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260906T084213Z (run dir /home/swarm/swarm/Matou/idss/test-results/private-path/20260906T084213Z) redded at deploy-archive after 70.8 s, 6 legs green before it (artifacts/legs.json, artifacts/verdict.json → firstRedLeg: deploy-archive, commit 742e00c0). Signature 5401f695e3a1.

provision: deploy gateway: clan: deploy failed on 1 node(s): gateway:
clan: config_eval on gateway: the node's config does not evaluate:
Receiving objects: 0% (1/98281) … 96% (94350/98281), 19.87 MiB | 398.00 KiB/s
error: RPC failed; curl 56 Recv failure: Connection reset by peer
error: 49211 bytes of body are still expected
error:
error: Failed to fetch git repository 'https://git.clan.lol/clan/clan-core'

Evidence

  • logs/guest-control-plane.log:145 — the fault is raised by the gateway's own control plane (idss-control-plane-start[2885], msg="provision deploy failed"), 08:58:02, its first clan invocation of the drive (the plane came up 08:56:36, line 144).
  • artifacts/provision-archive.live-*/error-context.md — the Playwright leg dies on the same text wrapped as deploy failed (clean-retry).
  • logs/guest-failed-units.log — 0 failed units; logs/guest-journal.log shows no OOM and no network fault. The guest was healthy; only the forge transfer died.
  • state/clan-config/flake.lock — every input (clan-core, data-mesher, nix-select, nixpkgs) is pinned "type": "tarball". Nothing in the community flake fetches a git repository, so the 98,281-object clone can only be the toolpin.

The chain

  1. internal/clan/vmguest.go:779 — the idss-control-plane unit's path = [ pkgs.bash pkgs.git pkgs.nix pkgs.openssh ]. No clan on PATH, deliberately (the comment at vmguest.go:765-768 names "the pinned clan CLI's nix-run fallback").
  2. internal/clan/toolpin.go:37-45 — resolveTool therefore resolves ToolClan to nix run <PinnedClanRef> --, where PinnedClanRef (toolpin.go:29) is git+https://git.clan.lol/clan/clan-core?rev=d098fa2e…#clan-cli. A git+https ref: nix clones the whole clan-core repo (~20 MiB, 98,281 objects) over the guest's link before the CLI can run. This is the first deploy on the box, so nothing is warm in its store or git cache.
  3. The clone is reset by the peer at 96%. Nix git fetches are not resumable, so the whole invocation dies non-zero with the text above.
  4. internal/clan/errors.go — Classify reads it: the ssh/connectivity case (:167-176) matches nothing (connection refused/timed out/no route to host/ssh:); the substituter-DNS case (:186-194) matches nothing (could not resolve host/temporary failure in name resolution); the exit-255 transport case (:220-227) does not apply (nix exits 1). It lands in the generic eval case at errors.go:285-293 on the bare error: substring → FailConfigEval, summary "the node's config does not evaluate", remedy "fix the config so the node evaluates, then retry".
  5. Two absorbers that exist for exactly this class are consequently disarmed:
    • updateNode's one-shot transport retry (internal/clan/adapter.go:648-654) is gated on f.Kind == FailConnectivity. config_eval → no retry. The deploy is idempotent and a second attempt would very likely have cloned clean.
    • isTransientFlakeFetch (adapter.go:1040-1048) over transientFetchSignatures (adapter.go:1028-1032: timeout was reached, resolving timed out, failed to open archive) — all three are cold-resolver DNS shapes from #542. A mid-transfer Recv failure: Connection reset by peer on a warm resolver matches none, so no warm-up hold either.

Net: a transient forge transfer reset is reported to the operator as a broken community config, with a remedy that cannot possibly help, and the retry machinery the codebase already owns sits idle.

Suspected layer

The clan seam's failure classifier and its retry gating — internal/clan/errors.go (Classify) and internal/clan/adapter.go (transientFetchSignatures / isTransientFlakeFetch, updateNode). Not the harness, not the fixtures, not the config: the config evaluates fine, and the same code path has succeeded on prior drives.

This is the fourth occurrence of the documented bare-substring theft in this classifier — #374 (disk), #563 (transport), #1210 (secrets), all narrated at internal/clan/errors.go:196-283 — and the third time the generic error: case has been the thief.

Two candidate fixes — this needs a ruling on which

(a) Narrow — classify and retry the shape. Add a git/HTTP transfer-death case to Classify ahead of the generic eval case (anchored on self-identifying phrases that a Nix evaluation never prints: rpc failed, recv failure, failed to fetch git repository, bytes of body are still expected) returning FailConnectivity with the existing resumable reconnect-and-retry remedy — which re-arms updateNode's one-shot retry for free — and/or widen transientFetchSignatures with the same markers. Cheap, in the grain of the #563 fix, and GOTCHAS #36's standing rule (docs/GOTCHAS.md:1032-1038) already says "widen the signature list" for this family. Wants a hazard entry and the usual seam tests (a reset-mid-clone log must classify connectivity, a genuine attribute … missing must still red terminal within seconds — never spin on a real config fault).

(b) Root — stop cloning a 20 MiB git repo from an external forge on the critical path of every gateway deploy. The community flake pins clan-core as a tarball (state/clan-config/flake.lock), but PinnedClanRef (toolpin.go:29) pins the CLI as git+https, which is the expensive and fragile form. Options: pin the CLI through the same archive URL the lock already uses; or carry the clan-cli closure in the ADR 0133 warm store the control plane already holds (adapter.go:642-643 notes the plane holds that store), so a real community's first co-host deploy does not depend on a healthy forge transfer at that moment. This is the fault a real community hits on a bad link, not just the drive.

(a) and (b) are not exclusive — (a) is the honest-fault fix regardless of (b).

Why the healer refused

Refusal rule 3 — product-behaviour surface. Both candidate fixes reach into internal/clan, the seam that drives real deploys: (a) changes what a deploy does (a gateway deploy that reds today would hold and retry) and what a community's operator sees (the S5 fault card's summary and remedy flip from "your config does not evaluate" to a connectivity fault). (b) is a supply-chain/pinning decision. Neither is harness, fixture, scripts/ or test plumbing. Filed for a ruling rather than healed in-lane; confident: false because the choice between (a), (b), or both is a design call, not a mechanical one.

No edits were made — the checkout is clean at 742e00c0.

drive 20260906T084213Z red at deploy-archive: deploy failed (clean-retry): provision: deploy gateway: clan: deploy failed on 1 node(s): gateway: clan: config_eval on gateway: the node's config does not evaluate: Receiving objects: 0% (1/98281) Re
evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260906T084213Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure Drive `20260906T084213Z` (run dir `/home/swarm/swarm/Matou/idss/test-results/private-path/20260906T084213Z`) redded at `deploy-archive` after 70.8 s, 6 legs green before it (`artifacts/legs.json`, `artifacts/verdict.json` → `firstRedLeg: deploy-archive`, commit `742e00c0`). Signature `5401f695e3a1`. ``` provision: deploy gateway: clan: deploy failed on 1 node(s): gateway: clan: config_eval on gateway: the node's config does not evaluate: Receiving objects: 0% (1/98281) … 96% (94350/98281), 19.87 MiB | 398.00 KiB/s error: RPC failed; curl 56 Recv failure: Connection reset by peer error: 49211 bytes of body are still expected error: error: Failed to fetch git repository 'https://git.clan.lol/clan/clan-core' ``` ## Evidence - `logs/guest-control-plane.log:145` — the fault is raised by the **gateway's own control plane** (`idss-control-plane-start[2885]`, `msg="provision deploy failed"`), 08:58:02, its first clan invocation of the drive (the plane came up 08:56:36, line 144). - `artifacts/provision-archive.live-*/error-context.md` — the Playwright leg dies on the same text wrapped as `deploy failed (clean-retry)`. - `logs/guest-failed-units.log` — **0 failed units**; `logs/guest-journal.log` shows no OOM and no network fault. The guest was healthy; only the forge transfer died. - `state/clan-config/flake.lock` — every input (`clan-core`, `data-mesher`, `nix-select`, `nixpkgs`) is pinned `"type": "tarball"`. **Nothing in the community flake fetches a git repository**, so the 98,281-object clone can only be the toolpin. ## The chain 1. `internal/clan/vmguest.go:779` — the `idss-control-plane` unit's `path = [ pkgs.bash pkgs.git pkgs.nix pkgs.openssh ]`. No `clan` on PATH, deliberately (the comment at `vmguest.go:765-768` names "the pinned clan CLI's nix-run fallback"). 2. `internal/clan/toolpin.go:37-45` — `resolveTool` therefore resolves `ToolClan` to `nix run <PinnedClanRef> --`, where `PinnedClanRef` (`toolpin.go:29`) is `git+https://git.clan.lol/clan/clan-core?rev=d098fa2e…#clan-cli`. A **`git+https` ref**: nix clones the whole clan-core repo (~20 MiB, 98,281 objects) over the guest's link before the CLI can run. This is the first deploy on the box, so nothing is warm in its store or git cache. 3. The clone is reset by the peer at 96%. Nix git fetches are not resumable, so the whole invocation dies non-zero with the text above. 4. `internal/clan/errors.go` — `Classify` reads it: the ssh/connectivity case (`:167-176`) matches nothing (`connection refused`/`timed out`/`no route to host`/`ssh:`); the substituter-DNS case (`:186-194`) matches nothing (`could not resolve host`/`temporary failure in name resolution`); the exit-255 transport case (`:220-227`) does not apply (nix exits 1). It lands in the generic eval case at **`errors.go:285-293`** on the bare `error: ` substring → `FailConfigEval`, summary "the node's config does not evaluate", remedy "fix the config so the node evaluates, then retry". 5. Two absorbers that exist for exactly this class are consequently disarmed: - **`updateNode`'s one-shot transport retry** (`internal/clan/adapter.go:648-654`) is gated on `f.Kind == FailConnectivity`. `config_eval` → no retry. The deploy is idempotent and a second attempt would very likely have cloned clean. - **`isTransientFlakeFetch`** (`adapter.go:1040-1048`) over `transientFetchSignatures` (`adapter.go:1028-1032`: `timeout was reached`, `resolving timed out`, `failed to open archive`) — all three are *cold-resolver DNS* shapes from #542. A mid-transfer `Recv failure: Connection reset by peer` on a warm resolver matches none, so no warm-up hold either. Net: a transient forge transfer reset is reported to the operator as a broken community config, with a remedy that cannot possibly help, and the retry machinery the codebase already owns sits idle. ## Suspected layer The clan seam's failure classifier and its retry gating — `internal/clan/errors.go` (`Classify`) and `internal/clan/adapter.go` (`transientFetchSignatures` / `isTransientFlakeFetch`, `updateNode`). Not the harness, not the fixtures, not the config: the config evaluates fine, and the same code path has succeeded on prior drives. This is the **fourth** occurrence of the documented bare-substring theft in this classifier — #374 (disk), #563 (transport), #1210 (secrets), all narrated at `internal/clan/errors.go:196-283` — and the third time the generic `error: ` case has been the thief. ## Two candidate fixes — this needs a ruling on which **(a) Narrow — classify and retry the shape.** Add a git/HTTP *transfer-death* case to `Classify` ahead of the generic eval case (anchored on self-identifying phrases that a Nix *evaluation* never prints: `rpc failed`, `recv failure`, `failed to fetch git repository`, `bytes of body are still expected`) returning `FailConnectivity` with the existing resumable reconnect-and-retry remedy — which re-arms `updateNode`'s one-shot retry for free — and/or widen `transientFetchSignatures` with the same markers. Cheap, in the grain of the #563 fix, and GOTCHAS #36's standing rule (`docs/GOTCHAS.md:1032-1038`) already says "widen the signature list" for this family. Wants a hazard entry and the usual seam tests (a reset-mid-clone log must classify connectivity, a genuine `attribute … missing` must still red terminal within seconds — never spin on a real config fault). **(b) Root — stop cloning a 20 MiB git repo from an external forge on the critical path of every gateway deploy.** The community flake pins clan-core as a **tarball** (`state/clan-config/flake.lock`), but `PinnedClanRef` (`toolpin.go:29`) pins the CLI as `git+https`, which is the expensive and fragile form. Options: pin the CLI through the same archive URL the lock already uses; or carry the `clan-cli` closure in the ADR 0133 warm store the control plane already holds (`adapter.go:642-643` notes the plane holds that store), so a real community's first co-host deploy does not depend on a healthy forge transfer at that moment. This is the fault a real community hits on a bad link, not just the drive. (a) and (b) are not exclusive — (a) is the honest-fault fix regardless of (b). ## Why the healer refused **Refusal rule 3 — product-behaviour surface.** Both candidate fixes reach into `internal/clan`, the seam that drives real deploys: (a) changes what a deploy *does* (a gateway deploy that reds today would hold and retry) and what a community's operator *sees* (the S5 fault card's summary and remedy flip from "your config does not evaluate" to a connectivity fault). (b) is a supply-chain/pinning decision. Neither is harness, fixture, `scripts/` or test plumbing. Filed for a ruling rather than healed in-lane; `confident: false` because the choice between (a), (b), or both is a design call, not a mechanical one. No edits were made — the checkout is clean at `742e00c0`. drive `20260906T084213Z` red at `deploy-archive`: `deploy failed (clean-retry): provision: deploy gateway: clan: deploy failed on 1 node(s): gateway: clan: config_eval on gateway: the node's config does not evaluate: Receiving objects: 0% (1/98281) Re` evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260906T084213Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 5401f695e3a1 -->
Author
Member

Close-report — ruled and landed by agent under ADR 0174 (veto anytime).

Ruling on the two candidates: adopted (a) now (the honest-fault classifier fix — a two-way door: revertible commit, seam-unit-proven), and filed (b) as follow-up #1273 (needs-triage). (a) is the honest-fault fix regardless of (b), exactly as the ticket notes. (b) is a supply-chain / pinning decision whose only real proof is a live gateway deploy drive, and mis-pinning PinnedClanRef would break every deploy — too large a blast radius to land unproven in an unattended session, so it is routed to a session with lab-drive access rather than self-authorized here.

What landed (commit 1592694b on main):

  • internal/clan/errors.go — Classify gains a git/HTTP transfer-death case AHEAD of the eval/disk/secret cases, anchored on rpc failed / recv failure / bytes of body are still expected / failed to fetch git repository (phrases a Nix evaluation never prints) → FailConnectivity with the resumable reconnect-and-retry remedy. This re-arms updateNode's one-shot transport retry (adapter.go, gated on FailConnectivity) for free — the absorber that was disarmed by the config_eval misclassification.
  • internal/clan/adapter.go — transientFetchSignatures gains the same four markers, so a reset during the eval-preflight (evalReadiness) or the enroll-activate apply also takes the warm-up/retry (GOTCHAS #36's standing rule for this family: widen the signature list).
  • docs/GOTCHAS.md — new entry #178 (the fourth bare-substring theft; #374/#563/#1210 the prior three).
  • STATUS.md — new lead.

Proof (red-first, TDD):

  • internal/clan/errors_gitfetch_test.go (+3 tests): a reset-mid-clone log (the exact drive 20260906T084213Z shape) classifies connectivity, not config_eval; each transfer-death phrase classifies connectivity in isolation; and a genuine attribute … missing fault still classifies config_eval terminal — the fail-loud guard (never spin on a real config fault; updateNode's retry is one-shot and evalReadiness's is bounded).
  • All tests were red before the fix, green after. go build ./..., go vet ./internal/clan, go test ./internal/clan ./internal/provision all green; gofmt clean.

Scope honesty: this makes the transient survivable (a re-clone on a warm/recovered link succeeds); it does not remove the 20 MiB forge clone from the deploy critical path. That root fix is #1273.

Signature 5401f695e3a1. Closing.

**Close-report — ruled and landed by agent under ADR 0174 (veto anytime).** **Ruling on the two candidates:** adopted **(a)** now (the honest-fault classifier fix — a two-way door: revertible commit, seam-unit-proven), and **filed (b)** as follow-up **#1273** (`needs-triage`). (a) is the honest-fault fix regardless of (b), exactly as the ticket notes. (b) is a supply-chain / pinning decision whose only real proof is a **live gateway deploy drive**, and mis-pinning `PinnedClanRef` would break *every* deploy — too large a blast radius to land unproven in an unattended session, so it is routed to a session with lab-drive access rather than self-authorized here. **What landed** (commit `1592694b` on `main`): - `internal/clan/errors.go` — `Classify` gains a git/HTTP transfer-death case AHEAD of the eval/disk/secret cases, anchored on `rpc failed` / `recv failure` / `bytes of body are still expected` / `failed to fetch git repository` (phrases a Nix *evaluation* never prints) → `FailConnectivity` with the resumable reconnect-and-retry remedy. This re-arms `updateNode`'s one-shot transport retry (`adapter.go`, gated on `FailConnectivity`) for free — the absorber that was disarmed by the `config_eval` misclassification. - `internal/clan/adapter.go` — `transientFetchSignatures` gains the same four markers, so a reset during the eval-preflight (`evalReadiness`) or the enroll-activate apply also takes the warm-up/retry (GOTCHAS #36's standing rule for this family: widen the signature list). - `docs/GOTCHAS.md` — new entry **#178** (the fourth bare-substring theft; #374/#563/#1210 the prior three). - `STATUS.md` — new lead. **Proof** (red-first, TDD): - `internal/clan/errors_gitfetch_test.go` (+3 tests): a reset-mid-clone log (the exact drive `20260906T084213Z` shape) classifies **connectivity**, not `config_eval`; each transfer-death phrase classifies connectivity in isolation; **and** a genuine `attribute … missing` fault still classifies `config_eval` terminal — the fail-loud guard (never spin on a real config fault; `updateNode`'s retry is one-shot and `evalReadiness`'s is bounded). - All tests were **red before the fix, green after**. `go build ./...`, `go vet ./internal/clan`, `go test ./internal/clan ./internal/provision` all green; `gofmt` clean. **Scope honesty:** this makes the transient *survivable* (a re-clone on a warm/recovered link succeeds); it does **not** remove the 20 MiB forge clone from the deploy critical path. That root fix is **#1273**. Signature `5401f695e3a1`. Closing.
matou-build-agent 2026-09-06 10:27:16 +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.

Reference
Matou/idss#1272
No description provided.