deploy-archive: omeka-reconcile races the erseco image's first-boot install — after/requires on podman-omeka.service carries no readiness, so the switch dies at exit 4 #1254
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Reference
Matou/idss#1254
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The failure
Drive
20260906T035418Z(targetarchive, commitddc96c9b) — 6/7 legs green, red atdeploy-archiveafter 561.7 s (artifacts/legs.json,artifacts/verdict.jsonfirstRedLeg: deploy-archive).The unit that killed the switch is
omeka-reconcile.service— the archive port's ADR 0062 part 2 reconciler.logs/guest-failed-units.loglists exactly one failed unit on the box:and
logs/guest-archive-keystore.logreadsNOT-MINTED— no API key ever landed.The evidence: this is a startup race, not a misconfiguration
logs/guest-omeka-reconcile.logrecords TWO starts (the first switch, then the clean-retry switch four seconds later), and the container's own bootstrap visibly progressed between them:podman execlegs printedFailed to initialize Omeka S instance: File '/var/www/html/config/database.ini' doesn't exist or not readableOmeka S is not installed.database.ininow EXISTS; the installer is mid-flightBoth runs ended
omeka-reconcile.service: Main process exited, code=exited, status=255/EXCEPTION. That the error message changed between two attempts four seconds apart is the decisive fact: nothing about the rendered config differs between them, so the reconciler is not wrong about what it does — it is wrong about when.The defect
internal/clan/archive.go:458-459orders the reconciler on the app container's podman unit:That is start-ordering, not readiness.
podman-omeka.servicereaching active proves only that the container was started — the erseco image auto-installs Omeka S asynchronously inside the container after its main process is up (the behaviourarchive.go:60-62documents: "the image auto-installs on first boot"). The reconciler then execs immediately with no gate:internal/clan/archive.go:474—podman exec omeka omeka-s-cli module:enable "$module" || true(tolerated, correctly)internal/clan/archive.go:483—out="$(podman exec omeka omeka-s-cli user:create-api-key "$adminuser" "$label")"(loud by design, #1213/ADR 0100)Under
set -euo pipefail(archive.go:466) the mint leg's non-zero exit fails the unit, and a failed unit in the switch is exit 4. The|| trueonmodule:enableis deliberate and should stay; the loudness on the key path is also deliberate and should stay. What is missing is the readiness gate before either.Suspected layer
The archive port's part-2 render —
renderOmekaReconcileininternal/clan/archive.go:445-498. Not the harness, not the health check.Worth noting for whoever rules: the health check side already handles a late key correctly.
control-plane/cmd/control-plane/archivehealth.go:174-182returns aclan.PendingFaultwhen the store is not yet minted, so the warm-up re-probe rides out exactly this lateness (#1243). Only the reconcile UNIT is intolerant, and it is intolerant at switch time, where intolerance is fatal.Precedent in-tree for the fix
This repo already has the shape: poll until ready, then fail LOUD at a ceiling (never a fabricated success, ADR 0100).
internal/clan/idssidp.go:207-215—healthWait,for i in $(seq 1 60); do … sleep 1; done, thenecho … never became healthy within 60s >&2; exit 1internal/clan/keri.go:339— the samehealthWaitshape, wired asExecStartPostatkeri.go:463,:545,:684Open questions a ruling should settle
archive.go:443-444,:481-482) defer omeka-s-cli's exact stdout shape to the clan-lab drive, and there is no confirmedstatus-style verb on the allowlistTestRenderArchive_ReconcilerOnlyInvokesRealVerbspins. Candidates: poll for/var/www/html/config/database.inipresence AND a non-"not installed" response; poll the serve port (archiveServePort8086); or retrymodule:enableuntil it stops reporting "Omeka S is not installed."healthWaitprecedent, failing loud — or longer, given a cold first-boot install on a fresh droplet also has to fetch the LocalContexts module?ExecStartPre/ExecStartPostonpodman-omeka.service? keri.go usesExecStartPoston the daemon unit; idssidp.go uses it inline.|| truethat #1213 exists to prevent.Any reasonable fix should keep
TestRenderArchive_OmekaReconciler(internal/clan/archive_test.go:203-222) andTestRenderArchive_ReconcilerOnlyInvokesRealVerbsgreen, and should add a render assertion pinning the readiness gate so it cannot silently regress.Refusal
Rule 3 (product-behaviour surface) fired. The fix lands in
internal/clan/archive.go— the NixOS module rendered onto and deployed to the community's own gateway. Adding a readiness gate changes what a deploy does, and the four questions above are deploy-behaviour decisions, not mechanical repairs.A secondary bar also applies: this is not testable on the healer machine.
go test ./internal/clanasserts on rendered text only, so it could prove a gate renders but never that it gates — the fault only reproduces against a real Omeka container mid-install. Per the healer's standing rule on work that cannot be verified here, that alone forbids the self-fix.No edits were made; the tree is clean.
drive
20260906T035418Zred atdeploy-archive:deploy failed (clean-retry): provision: deploy gateway: clan: deploy failed on 1 node(s): gateway: clan: masked_exit on gateway: clan reported success but the log shows a real failure: the remote switevidence:
/home/swarm/swarm/Matou/idss/test-results/private-path/20260906T035418Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRULED (agent, two-way under ADR 0174 — Ben vetoes async): a readiness gate INSIDE the reconciler script, the
healthWaitshape — poll until Omeka reports installed, fail LOUD at a ceiling; no new omeka-s-cli verb, ordering untouched.Diagnosis verified:
logs/guest-omeka-reconcile.logshows two starts (switch + clean-retry, 4 s apart) with the CLI's answer moving fromdatabase.ini doesn't existtoOmeka S is not installed.— the erseco image's first-boot installer was mid-flight both times;after/requiresonpodman-omeka.service(archive.go:458-459) is start-ordering, not readiness; the mint leg is loud by design (#1213) so the unit fails and the switch exits 4. The render's own comment (archive.go:60-62) says the image auto-installs on first boot. Progress marker: #1247 is proven good — the module evaluated, both containers came up, the generator's env file was read (the installer got as far as writingdatabase.ini).The four questions:
TestRenderArchive_ReconcilerOnlyInvokesRealVerbsstays as is): wrapomeka-s-cli module:enable "$module"in a retry loop that treats stdout/stderr matchingnot installed|doesn't exist or not readable|Failed to initializeas NOT-READY (sleep 3, retry) and anything else as ready (the existing|| truetolerance for an already-enabled module stays — the probe only classifies the readiness strings). Only when ready does the script reach the key mint, which stays loud exactly as today. Do NOT poll the serve port (Omeka serves its install page before install) and do NOT polldatabase.inialone (the log proves it exists while the installer is still running).omeka-reconcile: Omeka S first-boot install did not complete within 300s — last: <line>),exit 1— a genuinely broken install (bad DB credentials, a failed module fetch) still reds the deploy at the ceiling, never a fabricated success (ADR 0100). 60 s (thehealthWaitprecedent) is too short for a cold first boot that also fetches the Local Contexts module; 300 s sits inside the deploy leg's budget and the #1243 health warm-up rides out the tail on the control-plane side.idssidp.go:207-215shape), notExecStartPostonpodman-omeka.service: the readiness is Omeka's install state, not the container process, and the reconciler is the only consumer.if [ -s "$store" ]) stays first, so the clean-retry switch and every later switch are no-ops once the key is minted.Rejected:
Restart=on-failureon the oneshot (turns a loud failure into a silent restart loop inside the switch and still exits 4 on the first attempt); a systemd timer that decouples the mint from the switch (#1243's pending fault would then mask a mint that never happens until the 360 s warm-up expires — the deploy must own its own readiness).What to build
renderOmekaReconcile(internal/clan/archive.go:445-498): the gated retry aroundmodule:enableper Q1/Q2, before the mint; keepset -euo pipefail, keep the|| truesemantics for a non-readiness failure ofmodule:enable, keep the loud mint.go test ./internal/clan/green; STATUS.md lead; GOTCHAS entry (start-ordering ≠ readiness for a container that installs itself on first boot).Acceptance
Next #1235 fire:
deploy-archivegreen (switch exit 0,omeka-reconcileactive/exited),guest-omeka-reconcile.logshows the wait then the mint,guest-archive-keystore.log= MINTED; thenarchive-healthyruns the real keep→serve→refuse loop — the next red, if any, is theuser:create-api-keystdout shape (#1213's deferred surprise 2) and gets its own ticket.swarm-claim host=matou-dev-server-01 run=18699
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1254 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
admin@archive.<apex>— under the private path's.idss.internalapex (ADR 0149) Omeka's installer rejects the TLD, aborts the first-boot install half-done, and no admin user ever exists #1274module:enablewent "ready" three seconds before Omeka's installer created the admin user, so the key mint died onUser not foundand starved archive-brand #1320