deploy-archive: the archive reconciler's readiness gate polls a PROXY verb fail-open — module:enable went "ready" three seconds before Omeka's installer created the admin user, so the key mint died on User not found and starved archive-brand #1320

Closed
opened 2026-09-08 11:27:59 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260908T105026Z (drive 8, #1277, on 409b233e): 5 legs green, red at deploy-archive — masked_exit, the remote switch dead at exit 4 (artifacts/legs.json, artifacts/verdict.json firstRedLeg: deploy-archive).

Two archive-port units failed inside the switch:

11:18:26 omeka-reconcile-start[7834]: User not found: admin@archive.example.com
11:18:27 omeka-reconcile.service: Main process exited, code=exited, status=255/EXCEPTION
11:19:28 archive-brand-start[7861]: archive-brand: the minted admin API key never landed
         in /var/lib/archive/state/api-key — leaving the site title unbranded rather than
         claiming a phantom apply
11:19:28 nixos[6927]: switching to system configuration …-nixos-system-gateway failed (status 4)

Both units succeeded on the clean-retry switch a minute later (Finished … 11:19:32 and 11:19:35, logs/guest-system-journal.log:298-306). That is the tell: nothing was misconfigured — the first switch was simply too early.

Evidence

  • internal/clan/archive.go:559-590 — the #1254 readiness gate polls the reconciler's OWN first verb, module:enable LocalContexts, as a proxy for the erseco image's asynchronous first-boot install.
  • internal/clan/archive.go:580-585 — it classifies with a keep-waiting DENYLIST (not installed, doesn't exist or not readable, Failed to initialize, no container with name or ID, no such container) plus a *) catch-all that promotes everything else to ready=1; break. Fail-open.
  • logs/guest-omeka-container.log — the entrypoint downloads LocalContexts only after the install finishes: Installing Omeka S via CLI... 11:18:22 → Installation completed. 11:18:28 → Processing LocalContexts... 11:18:28 → Module 'LocalContexts' successfully installed. 11:18:33.
  • logs/guest-omeka-reconcile.log — the poll's execs: 11:18:18, 11:18:21 (both classified keep-waiting, sleep 3), then 11:18:25 → catch-all → ready, and the mint at 11:18:26 → User not found. The gate broke out 3 s before Installation completed. and 8 s before the module existed.
  • internal/clan/archive.go:598 (pre-fix) — the mint was one bare exec under set -e, inheriting the proxy poll's verdict with no gate of its own.
  • internal/clan/archive.go:684-695 — archive-brand's 30×2 s store wait then ran out on a key that was never minted and exited 1. A consequence, not a second defect.

The defect

Two compounding faults in one gate. (1) The classification is a denylist with a fail-open default, so the first unanticipated upstream string is read as ready — mid-install module:enable fails because the module directory is absent, not because the install is unfinished, and that string was never listed. (2) The gate protects the wrong operation: module:enable's readiness and the mint's readiness are two different facts about the same install, and the mint's real precondition is that the installer has created the admin user it mints as.

Suspected layer

The declarative render of the archive port's post-start reconciler — renderOmekaReconcile in internal/clan/archive.go. Not the harness, not the health check, not the brand carrier.

The repair

The module:enable poll is left untouched (it remains its own leg's gate). The MINT now rides its own bounded retry on the same 100×3 s = 300 s ceiling, treating the CLI's User not found — and podman's rc-125 transient (GOTCHAS #177) — as install-not-ready, and every other failure as terminal. stderr is captured to its own file so $out stays pure stdout for jq. Loudness is unchanged: at the ceiling the unit still exits non-zero naming the CLI's last words (ADR 0100), so a genuinely broken install still reds the deploy. GOTCHAS #193.

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

Two-way door, and a mechanical repair rather than a design decision. It changes nothing about what the archive port MEANS to do — the reconciler already meant to mint the admin API key only after the first-boot install had created the admin user; that is the whole stated purpose of the #1254 gate it sits behind (internal/clan/archive.go:559-569). The commit makes the code do what it already meant by waiting on the mint's own precondition instead of a proxy verb's fail-open verdict. No new default, no changed message at a trust moment, no route shape, no secrets shape, no security posture: the minted key, its label, its store path, its two-line format and its single-live-key idempotency are all byte-identical, and the unit's loud-at-the-ceiling contract (ADR 0100) is preserved verbatim — only the message now also names the CLI's stdout/stderr. Revertible by git revert dd2dc672 alone: the change is confined to one render function's shell body plus its test and a GOTCHAS entry, with no state, schema, secret or on-box artifact that a revert would strand — a reverted box simply returns to the pre-fix race. Proven here by TestRenderArchive_MintRidesItsOwnReadinessGate (internal/clan/archive_test.go:484-529), written red-first: it failed at archive_test.go:507 before the edit and passes after, pinning that the mint sits inside its own bounded retry rendered after the module:enable ceiling, that User not found and the rc-125 transient are keep-waiting, that jq still parses pure stdout, and that the ceiling still fails loud. The nine existing TestRenderArchive_Reconciler* assertions — including the #1254 gate, the #1213 loudness and idempotency contracts and the #1255 --json parse — are unmodified and still pass, so the fix is additive to what the suite already proves. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260908T105026Z red at deploy-archive (sig 5401f695e3a1) — self-fixed on the fast lane, commit a948f6ed5589e23da8e4681984415d26c2297dd1; checks: targeted (red-first): go test ./internal/clan/ -run TestRenderArchive_MintRidesItsOwnReadinessGate → FAIL before the fix (archive_test.go:507: the key mint must run inside its OWN bounded retry loop, not one bare exec trusting the fail-open module:enable poll (#1277 drive-8)), PASS after. package: go test ./internal/clan/ → ok (18.009s), all TestRenderArchive_* pass including the nine pre-existing Reconciler* gates. trees: go test ./internal/... → no failures; go test ./control-plane/... → no failures. nix syntax on the rendered artifact: dumped RenderArchive(sampleArchive()) and ran nix-instantiate --parse → NIX PARSE OK (the new shell block does not break the Nix indented string). go build ./... → clean; gofmt -l internal/clan/ → clean; go vet ./internal/clan/ → clean. Commit shape: 3 files, 39 changed non-test lines (internal/clan/archive.go 29/2, docs/GOTCHAS.md 8/0), one commit, not pushed; rails self-check → internal/clan/archive_test.go is additions only (47/0), zero removed lines, no removed or edited assertion/expectation, no removed test or leg declaration, no added skip.. evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260908T105026Z on matou-workstation.

## The failure Drive `20260908T105026Z` (drive 8, #1277, on `409b233e`): 5 legs green, red at `deploy-archive` — `masked_exit`, the remote switch dead at exit 4 (`artifacts/legs.json`, `artifacts/verdict.json` `firstRedLeg: deploy-archive`). Two archive-port units failed inside the switch: ``` 11:18:26 omeka-reconcile-start[7834]: User not found: admin@archive.example.com 11:18:27 omeka-reconcile.service: Main process exited, code=exited, status=255/EXCEPTION 11:19:28 archive-brand-start[7861]: archive-brand: the minted admin API key never landed in /var/lib/archive/state/api-key — leaving the site title unbranded rather than claiming a phantom apply 11:19:28 nixos[6927]: switching to system configuration …-nixos-system-gateway failed (status 4) ``` Both units succeeded on the clean-retry switch a minute later (`Finished …` 11:19:32 and 11:19:35, `logs/guest-system-journal.log:298-306`). That is the tell: nothing was misconfigured — the first switch was simply too early. ## Evidence - `internal/clan/archive.go:559-590` — the #1254 readiness gate polls the reconciler's OWN first verb, `module:enable LocalContexts`, as a proxy for the erseco image's asynchronous first-boot install. - `internal/clan/archive.go:580-585` — it classifies with a keep-waiting DENYLIST (`not installed`, `doesn't exist or not readable`, `Failed to initialize`, `no container with name or ID`, `no such container`) plus a `*)` catch-all that promotes **everything else** to `ready=1; break`. Fail-open. - `logs/guest-omeka-container.log` — the entrypoint downloads LocalContexts only **after** the install finishes: `Installing Omeka S via CLI...` 11:18:22 → `Installation completed.` 11:18:28 → `Processing LocalContexts...` 11:18:28 → `Module 'LocalContexts' successfully installed.` 11:18:33. - `logs/guest-omeka-reconcile.log` — the poll's execs: 11:18:18, 11:18:21 (both classified keep-waiting, `sleep 3`), then **11:18:25 → catch-all → ready**, and the mint at 11:18:26 → `User not found`. The gate broke out 3 s before `Installation completed.` and 8 s before the module existed. - `internal/clan/archive.go:598` (pre-fix) — the mint was one bare exec under `set -e`, inheriting the proxy poll's verdict with no gate of its own. - `internal/clan/archive.go:684-695` — `archive-brand`'s 30×2 s store wait then ran out on a key that was never minted and exited 1. A consequence, not a second defect. ## The defect Two compounding faults in one gate. (1) The classification is a denylist with a fail-open default, so the first unanticipated upstream string is read as ready — mid-install `module:enable` fails because the module directory is absent, not because the install is unfinished, and that string was never listed. (2) The gate protects the wrong operation: `module:enable`'s readiness and the mint's readiness are two different facts about the same install, and the mint's real precondition is that the installer has created the admin user it mints as. ## Suspected layer The declarative render of the archive port's post-start reconciler — `renderOmekaReconcile` in `internal/clan/archive.go`. Not the harness, not the health check, not the brand carrier. ## The repair The `module:enable` poll is left untouched (it remains its own leg's gate). The MINT now rides its own bounded retry on the same 100×3 s = 300 s ceiling, treating the CLI's `User not found` — and podman's rc-125 transient (GOTCHAS #177) — as install-not-ready, and every other failure as terminal. stderr is captured to its own file so `$out` stays pure stdout for jq. Loudness is unchanged: at the ceiling the unit still exits non-zero naming the CLI's last words (ADR 0100), so a genuinely broken install still reds the deploy. GOTCHAS #193. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) Two-way door, and a mechanical repair rather than a design decision. It changes nothing about what the archive port MEANS to do — the reconciler already meant to mint the admin API key only after the first-boot install had created the admin user; that is the whole stated purpose of the #1254 gate it sits behind (`internal/clan/archive.go:559-569`). The commit makes the code do what it already meant by waiting on the mint's own precondition instead of a proxy verb's fail-open verdict. No new default, no changed message at a trust moment, no route shape, no secrets shape, no security posture: the minted key, its label, its store path, its two-line format and its single-live-key idempotency are all byte-identical, and the unit's loud-at-the-ceiling contract (ADR 0100) is preserved verbatim — only the message now also names the CLI's stdout/stderr. Revertible by `git revert dd2dc672` alone: the change is confined to one render function's shell body plus its test and a GOTCHAS entry, with no state, schema, secret or on-box artifact that a revert would strand — a reverted box simply returns to the pre-fix race. Proven here by `TestRenderArchive_MintRidesItsOwnReadinessGate` (`internal/clan/archive_test.go:484-529`), written red-first: it failed at `archive_test.go:507` before the edit and passes after, pinning that the mint sits inside its own bounded retry rendered after the module:enable ceiling, that `User not found` and the rc-125 transient are keep-waiting, that jq still parses pure stdout, and that the ceiling still fails loud. The nine existing `TestRenderArchive_Reconciler*` assertions — including the #1254 gate, the #1213 loudness and idempotency contracts and the #1255 --json parse — are unmodified and still pass, so the fix is additive to what the suite already proves. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260908T105026Z` red at `deploy-archive` (sig 5401f695e3a1) — self-fixed on the fast lane, commit `a948f6ed5589e23da8e4681984415d26c2297dd1`; checks: targeted (red-first): `go test ./internal/clan/ -run TestRenderArchive_MintRidesItsOwnReadinessGate` → FAIL before the fix (`archive_test.go:507: the key mint must run inside its OWN bounded retry loop, not one bare exec trusting the fail-open module:enable poll (#1277 drive-8)`), PASS after. package: `go test ./internal/clan/` → ok (18.009s), all `TestRenderArchive_*` pass including the nine pre-existing `Reconciler*` gates. trees: `go test ./internal/...` → no failures; `go test ./control-plane/...` → no failures. nix syntax on the rendered artifact: dumped `RenderArchive(sampleArchive())` and ran `nix-instantiate --parse` → NIX PARSE OK (the new shell block does not break the Nix indented string). `go build ./...` → clean; `gofmt -l internal/clan/` → clean; `go vet ./internal/clan/` → clean. Commit shape: 3 files, 39 changed non-test lines (`internal/clan/archive.go` 29/2, `docs/GOTCHAS.md` 8/0), one commit, not pushed; rails self-check → `internal/clan/archive_test.go` is additions only (47/0), zero removed lines, no removed or edited assertion/expectation, no removed test or leg declaration, no added skip.. evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260908T105026Z` on matou-workstation. <!-- rehearsal-sig: 5401f695e3a1 -->
Author
Member

close-report for #1320 — status success

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

envelope
{
  "issue": 1320,
  "status": "success",
  "commits": [
    "a948f6ed5589e23da8e4681984415d26c2297dd1"
  ],
  "changed_files": [
    "docs/GOTCHAS.md",
    "internal/clan/archive.go",
    "internal/clan/archive_test.go"
  ],
  "tests": [
    {
      "command": "targeted (red-first): `go test ./internal/clan/ -run TestRenderArchive_MintRidesItsOwnReadinessGate` → FAIL before the fix (`archive_test.go:507: the key mint must run inside its OWN bounded retry loop, not one bare exec trusting the fail-open module:enable poll (#1277 drive-8)`), PASS after. package: `go test ./internal/clan/` → ok (18.009s), all `TestRenderArchive_*` pass including the nine pre-existing `Reconciler*` gates. trees: `go test ./internal/...` → no failures; `go test ./control-plane/...` → no failures. nix syntax on the rendered artifact: dumped `RenderArchive(sampleArchive())` and ran `nix-instantiate --parse` → NIX PARSE OK (the new shell block does not break the Nix indented string). `go build ./...` → clean; `gofmt -l internal/clan/` → clean; `go vet ./internal/clan/` → clean. Commit shape: 3 files, 39 changed non-test lines (`internal/clan/archive.go` 29/2, `docs/GOTCHAS.md` 8/0), one commit, not pushed; rails self-check → `internal/clan/archive_test.go` is additions only (47/0), zero removed lines, no removed or edited assertion/expectation, no removed test or leg declaration, no added skip.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit a948f6ed5589e23da8e4681984415d26c2297dd1"
  },
  "summary": "The archive reconciler's readiness gate polled `module:enable` as a proxy for Omeka's first-boot install and classified unlisted failures fail-open, so it went ready at 11:18:25 — three seconds before `Installation completed.` — and the key mint died on `User not found: admin@archive.example.com` (rc 255), killing the switch at exit 4 and starving archive-brand of the key; the mint now rides its own bounded 300 s retry on its OWN precondition (the admin user existing), still loud at the ceiling.",
  "blockers": []
}
**close-report** for #1320 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1320, "status": "success", "commits": [ "a948f6ed5589e23da8e4681984415d26c2297dd1" ], "changed_files": [ "docs/GOTCHAS.md", "internal/clan/archive.go", "internal/clan/archive_test.go" ], "tests": [ { "command": "targeted (red-first): `go test ./internal/clan/ -run TestRenderArchive_MintRidesItsOwnReadinessGate` → FAIL before the fix (`archive_test.go:507: the key mint must run inside its OWN bounded retry loop, not one bare exec trusting the fail-open module:enable poll (#1277 drive-8)`), PASS after. package: `go test ./internal/clan/` → ok (18.009s), all `TestRenderArchive_*` pass including the nine pre-existing `Reconciler*` gates. trees: `go test ./internal/...` → no failures; `go test ./control-plane/...` → no failures. nix syntax on the rendered artifact: dumped `RenderArchive(sampleArchive())` and ran `nix-instantiate --parse` → NIX PARSE OK (the new shell block does not break the Nix indented string). `go build ./...` → clean; `gofmt -l internal/clan/` → clean; `go vet ./internal/clan/` → clean. Commit shape: 3 files, 39 changed non-test lines (`internal/clan/archive.go` 29/2, `docs/GOTCHAS.md` 8/0), one commit, not pushed; rails self-check → `internal/clan/archive_test.go` is additions only (47/0), zero removed lines, no removed or edited assertion/expectation, no removed test or leg declaration, no added skip.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit a948f6ed5589e23da8e4681984415d26c2297dd1" }, "summary": "The archive reconciler's readiness gate polled `module:enable` as a proxy for Omeka's first-boot install and classified unlisted failures fail-open, so it went ready at 11:18:25 — three seconds before `Installation completed.` — and the key mint died on `User not found: admin@archive.example.com` (rc 255), killing the switch at exit 4 and starving archive-brand of the key; the mint now rides its own bounded 300 s retry on its OWN precondition (the admin user existing), still loud at the ceiling.", "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#1320
No description provided.