deploy-archive: the omeka reconciler's fail-open retry loops don't know "Failed to elevate privileges" — #1274 fixed the wedged install and moved the pre-completion transient's words, so the mint broke out after one try and killed the switch at exit 4 #1358

Closed
opened 2026-09-09 20:49:38 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260909T201808Z (commit 3f261165, sig 5401f695e3a1) redded at deploy-archive, 5/6 legs green — masked_exit, the remote switch dead at exit 4, with omeka-reconcile.service the only genuinely-failed unit:

omeka-reconcile: could not mint or parse the admin API key within 300s —
  last user:create-api-key stdout:  / stderr: Failed to elevate privileges.

That message is self-refuting. logs/guest-omeka-reconcile.log has the unit Starting at 20:42:10 and Failed at 20:42:15 — 4.884s wall clock, 356ms CPU, exactly three podman execs, not one sleep 3. It claims a 300s ceiling it never approached.

The evidence

logs/guest-omeka-container.log times the install window to the second:

20:42:12  Installing Omeka S via CLI...
20:42:16  Installation completed.

The mint fired at 20:42:15 — one second early — into an installer that had created the admin user row but not yet its role. omeka-s-cli calls that state Failed to elevate privileges., not User not found.

Both of renderOmekaReconcile's retry loops are fail-OPEN by design (internal/clan/archive.go): each sleep 3s on a listed keep-waiting string and breaks on anything else.

  • internal/clan/archive.go:580 — the module:enable readiness poll's arm: *"not installed"*|*"doesn't exist or not readable"*|*"Failed to initialize"*|*"no container with name or ID"*|*"no such container"*
  • internal/clan/archive.go:628 — the mint's own #1277 drive-8 gate (internal/clan/archive.go:600-608 documents it): *"User not found"*|*"no container with name or ID"*|*"no such container"*

elevate privileges was in neither list. The poll's *) arm promoted it to ready and broke out; the mint's *) arm broke out after one attempt; set -e took the unit, and with it the switch and the drive.

The proof it was a transient, not a failure: the drive's clean-retry switch ran the same unit at 20:43:20 to Finished (logs/guest-omeka-reconcile.log), and logs/guest-archive-keystore.log reads MINTED size=66 lines=2.

The second journal line in the red — Failed to start Apply the community brand kit (name only) — is downstream, and behaved correctly: archive-brand started 20:42:15, waited its own 63s for the key, refused to fake an apply (the minted admin API key never landed in … — leaving the site title unbranded rather than claiming a phantom apply), then on the retry switch PATCHed o:title: "E2E Drive" and Finished at 20:43:24. One root cause, two symptoms.

The suspected layer

The rendered NixOS reconciler in internal/clan/archive.go — specifically the classification of the CLI's transient vocabulary, not the ceilings, not the mint, not the store handshake.

The deeper shape: GOTCHAS #176 / #1274 fixed the private path's genuinely wedged install (.internal failing Omeka's admin-email validator, no admin user ever created). Under that wedge Failed to elevate privileges meant permanently broken, so treating it as fatal was right. Making the install complete turned the same string into the name of a ~4-second startup window — and the classifier was never re-derived. Recorded as GOTCHAS #215.

The fix

elevate privileges joins User not found and podman's rc-125 no container (GOTCHAS #177) in both keep-waiting arms. Nothing else moves — no ceiling, no verb, no ordering, no store shape.

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

Two-way door. The whole behavioural change is two case arms each gaining one extra *"elevate privileges"* glob — a strict superset of keep-waiting strings. Reverting is git revert 52fd25b7, with no state to unwind: the reconciler is idempotent by its store-presence early exit, so a revert changes only how the next switch classifies one CLI string. No schema, no secrets, no migration, no infra state.

Proven by a test I wrote here. TestRenderArchive_ElevatePrivilegesIsInstallNotReady (internal/clan/archive_test.go) asserts the pattern appears in the readiness poll's arm (between the rendered module:enable "$module" and the mint) and again in the mint's arm after it. It FAILS on HEAD — the pattern is in neither — and passes after. It also re-pins that the loud 300s ceiling message is still rendered, so the fix cannot have been made by softening the failure.

A mechanical repair, not a design decision. The reconciler already meant to ride out install-not-ready — that intent is written out at internal/clan/archive.go:559-569 and :600-608, and it already retries two other strings for exactly this reason. It simply did not know the third string the CLI uses. This is a missing readiness classification — the race category rule 3 names explicitly — and it changes nothing about what a community sees or what the deploy does: same key, same store shape (identity line 1, credential line 2), same PATCH o:title downstream, same admin identity, same ports, same messages at every trust moment.

It cannot hide a real failure. On the genuinely wedged path (#1274's shape) the string never clears, so the loop now spins to its existing 100×3s ceiling and fires the same loud exit 1 naming the CLI's last words — ADR 0100 holds. The change converts a false red into a bounded wait; it can never convert a true red into a green. No assertion, expectation, test or leg was touched (0 removed lines in any test file); all 6 removed lines in the diff are comment-render lines plus the two case arms re-rendered with the added pattern. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260909T201808Z red at deploy-archive (sig 5401f695e3a1) — self-fixed on the fast lane, commit bdef7f92a5ca7268385d0b36135a358b851c486c; checks: targeted (red-first): go test ./internal/clan/ -run TestRenderArchive_ElevatePrivilegesIsInstallNotReady → FAIL before the fix (the pattern is in neither the readiness poll's nor the mint's keep-waiting arm); go test ./internal/clan/ -run TestRenderArchive → ok 0.008s after, all pre-existing TestRenderArchive_* tests (including _MintRidesItsOwnReadinessGate, _ReadinessPollTreatsMissingContainerAsNotReady, _PrivatePathAdminEmailIsValidatorSafe) unchanged and passing. package: go test ./internal/clan/ → ok 18.580s; go vet ./internal/clan/ → clean; gofmt -l on both changed .go files → clean. whole tree: go build ./... → clean; go test ./... → every package ok, zero failures. commit shape: 3 files, 86 insertions / 6 deletions, of which 53/6 are non-test (internal/clan/archive.go 15/6, docs/GOTCHAS.md 38/0 — archive_test.go is +33/-0 and a test file); one commit 52fd25b7, not pushed, working tree clean. rails self-check: all 6 removed lines are in archive.go — four comment-render b.WriteString("# …") lines and the two case arm lines, each re-added with one extra glob; ZERO removed lines in any test file; none of the 6 match expect(/assert/require./t.Fatal/t.Error/toBe/toEqual/func Test/it(/test(/describe(/.skip; zero added .skip/.only/t.Skip; 3 files and 53 non-test changed lines, under the cap; no .sandcastle/rehearsal-* or .forgejo/workflows/ path touched.. evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260909T201808Z on matou-workstation.

## The failure Drive `20260909T201808Z` (commit `3f261165`, sig `5401f695e3a1`) redded at `deploy-archive`, 5/6 legs green — `masked_exit`, the remote switch dead at exit 4, with `omeka-reconcile.service` the only genuinely-failed unit: ``` omeka-reconcile: could not mint or parse the admin API key within 300s — last user:create-api-key stdout: / stderr: Failed to elevate privileges. ``` That message is self-refuting. `logs/guest-omeka-reconcile.log` has the unit `Starting` at **20:42:10** and `Failed` at **20:42:15** — 4.884s wall clock, 356ms CPU, exactly three `podman exec`s, not one `sleep 3`. It claims a 300s ceiling it never approached. ## The evidence `logs/guest-omeka-container.log` times the install window to the second: ``` 20:42:12 Installing Omeka S via CLI... 20:42:16 Installation completed. ``` The mint fired at **20:42:15** — one second early — into an installer that had created the admin user row but not yet its role. `omeka-s-cli` calls that state `Failed to elevate privileges.`, **not** `User not found`. Both of `renderOmekaReconcile`'s retry loops are fail-OPEN by design (`internal/clan/archive.go`): each `sleep 3`s on a listed keep-waiting string and `break`s on anything else. - `internal/clan/archive.go:580` — the module:enable readiness poll's arm: `*"not installed"*|*"doesn't exist or not readable"*|*"Failed to initialize"*|*"no container with name or ID"*|*"no such container"*` - `internal/clan/archive.go:628` — the mint's own #1277 drive-8 gate (`internal/clan/archive.go:600-608` documents it): `*"User not found"*|*"no container with name or ID"*|*"no such container"*` `elevate privileges` was in **neither** list. The poll's `*)` arm promoted it to ready and broke out; the mint's `*)` arm broke out after one attempt; `set -e` took the unit, and with it the switch and the drive. The proof it was a transient, not a failure: the drive's clean-retry switch ran the *same* unit at 20:43:20 to `Finished` (`logs/guest-omeka-reconcile.log`), and `logs/guest-archive-keystore.log` reads `MINTED size=66 lines=2`. The second journal line in the red — `Failed to start Apply the community brand kit (name only)` — is downstream, and behaved correctly: `archive-brand` started 20:42:15, waited its own 63s for the key, refused to fake an apply (`the minted admin API key never landed in … — leaving the site title unbranded rather than claiming a phantom apply`), then on the retry switch PATCHed `o:title: "E2E Drive"` and `Finished` at 20:43:24. One root cause, two symptoms. ## The suspected layer The rendered NixOS reconciler in `internal/clan/archive.go` — specifically the *classification* of the CLI's transient vocabulary, not the ceilings, not the mint, not the store handshake. The deeper shape: GOTCHAS #176 / #1274 fixed the private path's genuinely **wedged** install (`.internal` failing Omeka's admin-email validator, no admin user ever created). Under that wedge `Failed to elevate privileges` meant *permanently broken*, so treating it as fatal was right. Making the install complete turned the same string into the name of a ~4-second startup window — and the classifier was never re-derived. Recorded as GOTCHAS #215. ## The fix `elevate privileges` joins `User not found` and podman's rc-125 `no container` (GOTCHAS #177) in **both** keep-waiting arms. Nothing else moves — no ceiling, no verb, no ordering, no store shape. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) **Two-way door.** The whole behavioural change is two `case` arms each gaining one extra `*"elevate privileges"*` glob — a strict superset of keep-waiting strings. Reverting is `git revert 52fd25b7`, with no state to unwind: the reconciler is idempotent by its store-presence early exit, so a revert changes only how the *next* switch classifies one CLI string. No schema, no secrets, no migration, no infra state. **Proven by a test I wrote here.** `TestRenderArchive_ElevatePrivilegesIsInstallNotReady` (`internal/clan/archive_test.go`) asserts the pattern appears in the readiness poll's arm (between the rendered `module:enable "$module"` and the mint) and again in the mint's arm after it. It FAILS on HEAD — the pattern is in neither — and passes after. It also re-pins that the loud 300s ceiling message is still rendered, so the fix cannot have been made by softening the failure. **A mechanical repair, not a design decision.** The reconciler already *meant* to ride out install-not-ready — that intent is written out at `internal/clan/archive.go:559-569` and `:600-608`, and it already retries two other strings for exactly this reason. It simply did not know the third string the CLI uses. This is a missing readiness classification — the race category rule 3 names explicitly — and it changes nothing about what a community sees or what the deploy does: same key, same store shape (identity line 1, credential line 2), same `PATCH o:title` downstream, same admin identity, same ports, same messages at every trust moment. **It cannot hide a real failure.** On the genuinely wedged path (#1274's shape) the string never clears, so the loop now spins to its existing 100×3s ceiling and fires the *same* loud `exit 1` naming the CLI's last words — ADR 0100 holds. The change converts a false red into a bounded wait; it can never convert a true red into a green. No assertion, expectation, test or leg was touched (0 removed lines in any test file); all 6 removed lines in the diff are comment-render lines plus the two `case` arms re-rendered with the added pattern. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260909T201808Z` red at `deploy-archive` (sig 5401f695e3a1) — self-fixed on the fast lane, commit `bdef7f92a5ca7268385d0b36135a358b851c486c`; checks: targeted (red-first): `go test ./internal/clan/ -run TestRenderArchive_ElevatePrivilegesIsInstallNotReady` → FAIL before the fix (the pattern is in neither the readiness poll's nor the mint's keep-waiting arm); `go test ./internal/clan/ -run TestRenderArchive` → ok 0.008s after, all pre-existing TestRenderArchive_* tests (including `_MintRidesItsOwnReadinessGate`, `_ReadinessPollTreatsMissingContainerAsNotReady`, `_PrivatePathAdminEmailIsValidatorSafe`) unchanged and passing. package: `go test ./internal/clan/` → ok 18.580s; `go vet ./internal/clan/` → clean; `gofmt -l` on both changed .go files → clean. whole tree: `go build ./...` → clean; `go test ./...` → every package ok, zero failures. commit shape: 3 files, 86 insertions / 6 deletions, of which 53/6 are non-test (internal/clan/archive.go 15/6, docs/GOTCHAS.md 38/0 — archive_test.go is +33/-0 and a test file); one commit 52fd25b7, not pushed, working tree clean. rails self-check: all 6 removed lines are in archive.go — four comment-render `b.WriteString("# …")` lines and the two `case` arm lines, each re-added with one extra glob; ZERO removed lines in any test file; none of the 6 match expect(/assert/require./t.Fatal/t.Error/toBe/toEqual/func Test/it(/test(/describe(/.skip; zero added .skip/.only/t.Skip; 3 files and 53 non-test changed lines, under the cap; no `.sandcastle/rehearsal-*` or `.forgejo/workflows/` path touched.. evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260909T201808Z` on matou-workstation. <!-- rehearsal-sig: 5401f695e3a1 -->
Author
Member

close-report for #1358 — status success

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

envelope
{
  "issue": 1358,
  "status": "success",
  "commits": [
    "bdef7f92a5ca7268385d0b36135a358b851c486c"
  ],
  "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_ElevatePrivilegesIsInstallNotReady` → FAIL before the fix (the pattern is in neither the readiness poll's nor the mint's keep-waiting arm); `go test ./internal/clan/ -run TestRenderArchive` → ok 0.008s after, all pre-existing TestRenderArchive_* tests (including `_MintRidesItsOwnReadinessGate`, `_ReadinessPollTreatsMissingContainerAsNotReady`, `_PrivatePathAdminEmailIsValidatorSafe`) unchanged and passing. package: `go test ./internal/clan/` → ok 18.580s; `go vet ./internal/clan/` → clean; `gofmt -l` on both changed .go files → clean. whole tree: `go build ./...` → clean; `go test ./...` → every package ok, zero failures. commit shape: 3 files, 86 insertions / 6 deletions, of which 53/6 are non-test (internal/clan/archive.go 15/6, docs/GOTCHAS.md 38/0 — archive_test.go is +33/-0 and a test file); one commit 52fd25b7, not pushed, working tree clean. rails self-check: all 6 removed lines are in archive.go — four comment-render `b.WriteString(\"# …\")` lines and the two `case` arm lines, each re-added with one extra glob; ZERO removed lines in any test file; none of the 6 match expect(/assert/require./t.Fatal/t.Error/toBe/toEqual/func Test/it(/test(/describe(/.skip; zero added .skip/.only/t.Skip; 3 files and 53 non-test changed lines, under the cap; no `.sandcastle/rehearsal-*` or `.forgejo/workflows/` path touched.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit bdef7f92a5ca7268385d0b36135a358b851c486c"
  },
  "summary": "omeka-reconcile's two fail-open retry loops classified `Failed to elevate privileges` — what omeka-s-cli says in the ~4s before `Installation completed.`, after #1274 made the private-path install actually finish — as a hard error, so the mint broke out after one try and killed the switch at exit 4; added `elevate privileges` to both keep-waiting arms alongside `User not found` and podman's rc-125 `no container`.",
  "blockers": []
}
**close-report** for #1358 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1358, "status": "success", "commits": [ "bdef7f92a5ca7268385d0b36135a358b851c486c" ], "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_ElevatePrivilegesIsInstallNotReady` → FAIL before the fix (the pattern is in neither the readiness poll's nor the mint's keep-waiting arm); `go test ./internal/clan/ -run TestRenderArchive` → ok 0.008s after, all pre-existing TestRenderArchive_* tests (including `_MintRidesItsOwnReadinessGate`, `_ReadinessPollTreatsMissingContainerAsNotReady`, `_PrivatePathAdminEmailIsValidatorSafe`) unchanged and passing. package: `go test ./internal/clan/` → ok 18.580s; `go vet ./internal/clan/` → clean; `gofmt -l` on both changed .go files → clean. whole tree: `go build ./...` → clean; `go test ./...` → every package ok, zero failures. commit shape: 3 files, 86 insertions / 6 deletions, of which 53/6 are non-test (internal/clan/archive.go 15/6, docs/GOTCHAS.md 38/0 — archive_test.go is +33/-0 and a test file); one commit 52fd25b7, not pushed, working tree clean. rails self-check: all 6 removed lines are in archive.go — four comment-render `b.WriteString(\"# …\")` lines and the two `case` arm lines, each re-added with one extra glob; ZERO removed lines in any test file; none of the 6 match expect(/assert/require./t.Fatal/t.Error/toBe/toEqual/func Test/it(/test(/describe(/.skip; zero added .skip/.only/t.Skip; 3 files and 53 non-test changed lines, under the cap; no `.sandcastle/rehearsal-*` or `.forgejo/workflows/` path touched.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit bdef7f92a5ca7268385d0b36135a358b851c486c" }, "summary": "omeka-reconcile's two fail-open retry loops classified `Failed to elevate privileges` — what omeka-s-cli says in the ~4s before `Installation completed.`, after #1274 made the private-path install actually finish — as a hard error, so the mint broke out after one try and killed the switch at exit 4; added `elevate privileges` to both keep-waiting arms alongside `User not found` and podman's rc-125 `no container`.", "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#1358
No description provided.