deploy-archive: the Omeka container never installs — the archive dataset's files dir is rendered owned 82:82, but the pinned erseco image runs as nobody (65534) #1271

Closed
opened 2026-09-06 07:19:28 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260906T065017Z, leg deploy-archive (sig 5401f695e3a1), 6/7 green. artifacts/verdict.json → firstRedLeg: deploy-archive at commit 42980057. The switch dies at exit 4 (masked_exit) because omeka-reconcile.service fails:

omeka-reconcile-start[9597]: Error: no container with name or ID "omeka" found: no such container
omeka-reconcile.service: Main process exited, code=exited, status=125/n/a

That is a symptom, not the cause. The omeka container is absent because it is crash-looping.

The cause

logs/guest-omeka-container.log — every one of the three container starts (07:14:56, 07:15:10, 07:15:17) ends identically:

omeka[9480]: Installing Omeka S via CLI...
omeka[9480]: Installation failed:
omeka[9480]:  - "/var/www/html/files" is not a writable directory.
omeka[9480]: *** Failed with return value: 0
podman-omeka.service: Main process exited, code=exited, status=1/FAILURE
podman-omeka.service: Scheduled restart job, restart counter is at 3.

The image's /docker-entrypoint-init.d/02-configure-omeka.sh runs under set -eu, so the failed install_cli.php kills PID 1. omeka-reconcile's readiness poll (#1254) then races the restart window and podman exec omeka … returns 125 — hence the reconcile failure, hence exit 4. The #1254 gate and the #1255 OMEKA_ADMIN_NAME fix both held; the red moved down one more layer.

The defective line

internal/clan/archive.go:369 (in renderArchiveStore):

fmt.Fprintf(b, "    %q\n", "d "+store+"/files 0750 82 82 -")

with the comment at internal/clan/archive.go:363-365 that flags it as an unconfirmed guess:

// files-dir owner is the Alpine www-data (82) the erseco image serves as; the exact
// uid is confirmed by the deferred clan-lab drive.

This drive is that confirmation, and 82 is wrong. Inspecting the pinned digest docker.io/erseco/alpine-omeka-s@sha256:fb25223179f9…c038a4:

  • Config.User = nobody → uid 65534, gid 65534. The container process never runs as 82.
  • There is no user with uid 82 in the image at all. 82 appears only as a group gid: /etc/group: www-data:x:82:nginx. The comment mistook a gid for a uid.
  • /var/www/html/files is a symlink → volume/files; the image ships /var/www/html/volume/files owned 65534:65534.

So the bind mount from internal/clan/archive.go:332 (<store>/files:/var/www/html/files) lands a host dir owned 82:82 mode 0750 under a process running as 65534 — no rwx, and PHP's is_writable() returns false.

Reproduced locally (matou-workstation, docker)

# host dir prepared exactly as the render's tmpfiles rule: 0750 82 82
drwxr-x--- 2 82 82 /tmp/omeka-files-XXXX

# run as the image's Config.User with that dir bind-mounted:
id → uid=65534(nobody) gid=65534(nobody)
test -w /var/www/html/files         → NOT WRITABLE
php -r 'is_writable("/var/www/html/files")' → bool(false)

# same dir, re-owned 65534:65534, mode unchanged at 0750:
php -r 'is_writable("/var/www/html/files")' → bool(true)

Byte-for-byte the drive's message, and cleared by the ownership change alone.

Suspected layer + what needs ruling

Layer: the archive-module render, internal/clan/archive.go — not the harness. The narrow fix is one constant (82 82 → 65534 65534 at line 369), but it is a deploy-behaviour change: it sets the on-disk ownership of a community's declared Archive dataset (ADR 0080), which P7 backup/restore reads back. The ruling needed is which fix:

  1. d <store>/files 0750 65534 65534 - — pin the image's nobody uid into the community's dataset (smallest change; couples the dataset to an image-internal uid that a future digest bump could move).
  2. Mount the image's real persistence root /var/www/html/volume instead of the symlink path /var/www/html/files, since files is only a symlink into it — this would also persist config/, logs/, modules/, themes/, changing what a restore covers.
  3. Set user/--userns or :U on the container rather than hard-coding a uid in systemd.tmpfiles.rules.

Note the sibling rule d <store>/db 0750 999 999 - (internal/clan/archive.go:368) is correct — MariaDB 11.4 initialised cleanly at 07:14:33–07:14:53; do not churn on it.

Why I refused rather than healed

Refusal rule 3 (product-behaviour surface). internal/clan/archive.go renders the NixOS config deployed to a community's gateway; changing the ownership of the Archive dataset's files directory alters what a deploy does and what a restore reads back. That is a design decision, not a heal — and the three candidate fixes above are not interchangeable. Precedent agrees: the two prior fixes to this same file (#1254, #1255) both landed as sandcastle commits, not healer commits.

No edits were made; the working tree is clean.

drive 20260906T065017Z red at deploy-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 swit
evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260906T065017Z 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 `20260906T065017Z`, leg `deploy-archive` (sig `5401f695e3a1`), 6/7 green. `artifacts/verdict.json` → `firstRedLeg: deploy-archive` at commit `42980057`. The switch dies at exit 4 (`masked_exit`) because `omeka-reconcile.service` fails: ``` omeka-reconcile-start[9597]: Error: no container with name or ID "omeka" found: no such container omeka-reconcile.service: Main process exited, code=exited, status=125/n/a ``` That is a **symptom, not the cause**. The `omeka` container is absent because it is crash-looping. ## The cause `logs/guest-omeka-container.log` — every one of the three container starts (07:14:56, 07:15:10, 07:15:17) ends identically: ``` omeka[9480]: Installing Omeka S via CLI... omeka[9480]: Installation failed: omeka[9480]: - "/var/www/html/files" is not a writable directory. omeka[9480]: *** Failed with return value: 0 podman-omeka.service: Main process exited, code=exited, status=1/FAILURE podman-omeka.service: Scheduled restart job, restart counter is at 3. ``` The image's `/docker-entrypoint-init.d/02-configure-omeka.sh` runs under `set -eu`, so the failed `install_cli.php` kills PID 1. `omeka-reconcile`'s readiness poll (#1254) then races the restart window and `podman exec omeka …` returns 125 — hence the reconcile failure, hence exit 4. The #1254 gate and the #1255 `OMEKA_ADMIN_NAME` fix both held; the red moved down one more layer. ## The defective line `internal/clan/archive.go:369` (in `renderArchiveStore`): ```go fmt.Fprintf(b, " %q\n", "d "+store+"/files 0750 82 82 -") ``` with the comment at `internal/clan/archive.go:363-365` that flags it as an unconfirmed guess: > `// files-dir owner is the Alpine www-data (82) the erseco image serves as; the exact` > `// uid is confirmed by the deferred clan-lab drive.` **This drive is that confirmation, and 82 is wrong.** Inspecting the pinned digest `docker.io/erseco/alpine-omeka-s@sha256:fb25223179f9…c038a4`: - `Config.User` = `nobody` → **uid 65534, gid 65534**. The container process never runs as 82. - There is no user with uid 82 in the image at all. `82` appears only as a *group* gid: `/etc/group: www-data:x:82:nginx`. The comment mistook a gid for a uid. - `/var/www/html/files` is a **symlink → `volume/files`**; the image ships `/var/www/html/volume/files` owned `65534:65534`. So the bind mount from `internal/clan/archive.go:332` (`<store>/files:/var/www/html/files`) lands a host dir owned `82:82` mode `0750` under a process running as 65534 — no rwx, and PHP's `is_writable()` returns false. ## Reproduced locally (matou-workstation, docker) ``` # host dir prepared exactly as the render's tmpfiles rule: 0750 82 82 drwxr-x--- 2 82 82 /tmp/omeka-files-XXXX # run as the image's Config.User with that dir bind-mounted: id → uid=65534(nobody) gid=65534(nobody) test -w /var/www/html/files → NOT WRITABLE php -r 'is_writable("/var/www/html/files")' → bool(false) # same dir, re-owned 65534:65534, mode unchanged at 0750: php -r 'is_writable("/var/www/html/files")' → bool(true) ``` Byte-for-byte the drive's message, and cleared by the ownership change alone. ## Suspected layer + what needs ruling Layer: the archive-module render, `internal/clan/archive.go` — not the harness. The narrow fix is one constant (`82 82` → `65534 65534` at line 369), but it is a **deploy-behaviour** change: it sets the on-disk ownership of a community's declared Archive dataset (ADR 0080), which P7 backup/restore reads back. The ruling needed is *which* fix: 1. `d <store>/files 0750 65534 65534 -` — pin the image's `nobody` uid into the community's dataset (smallest change; couples the dataset to an image-internal uid that a future digest bump could move). 2. Mount the image's real persistence root `/var/www/html/volume` instead of the symlink path `/var/www/html/files`, since `files` is only a symlink into it — this would also persist `config/`, `logs/`, `modules/`, `themes/`, changing what a restore covers. 3. Set `user`/`--userns` or `:U` on the container rather than hard-coding a uid in `systemd.tmpfiles.rules`. Note the sibling rule `d <store>/db 0750 999 999 -` (`internal/clan/archive.go:368`) is **correct** — MariaDB 11.4 initialised cleanly at 07:14:33–07:14:53; do not churn on it. ## Why I refused rather than healed **Refusal rule 3 (product-behaviour surface).** `internal/clan/archive.go` renders the NixOS config deployed to a community's gateway; changing the ownership of the Archive dataset's files directory alters what a deploy does and what a restore reads back. That is a design decision, not a heal — and the three candidate fixes above are not interchangeable. Precedent agrees: the two prior fixes to this same file (#1254, #1255) both landed as sandcastle commits, not healer commits. No edits were made; the working tree is clean. drive `20260906T065017Z` red at `deploy-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 swit` evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260906T065017Z` 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

Ruled by agent under ADR 0174 — veto anytime. Two-way door: a revertible one-constant render change, provable by an existing test + a byte-exact probe of the pinned image. Not on the one-way-door list (no credential, no security-posture widening, no member-/public-facing trust surface, no data destruction, no non-routine spend). The prior refusal correctly declined to heal this in-drive — the three candidate fixes are not interchangeable, so it belongs on a ticket with a stated ruling; that ruling is below. Precedent agrees the file is agent-rulable via a ticket: #1254 and #1255 both landed as sandcastle commits.

The ruling: candidate 1 — own the files subdir by the container's runtime uid

renderArchiveStore now renders d <store>/files 0750 65534 65534 - (internal/clan/archive.go, commit e4698752). 65534 is the erseco image's actual runtime uid (Config.User = nobody), and it matches the established pattern of the sibling db rule (999 999 = MariaDB's runtime uid): own each bind-mount subdir by its consuming container's runtime uid. The old 82 82 mistook the www-data group gid (www-data:x:82:nginx) for a uid — no user has uid 82 in the image at all.

Rejected the other two candidates:

  • Candidate 2 (mount the volume root instead of the files symlink) — changes ADR 0080 / P7 restore coverage: it would persist config/, logs/, modules/, themes/, state the declarative env + OMEKA_MODULES should re-derive on each rebuild, creating drift risk against the declarative model. A behaviour change beyond the bug.
  • Candidate 3 (:U / --userns on the container) — :U recursively chowns the community's whole dataset on every deploy (potentially large digital-heritage media), and fights the restore path. Heavier and riskier than owning the dir once via tmpfiles.

Independently confirmed against the pinned digest (matou-workstation, docker)

Config.User        → nobody
id (runtime user)  → uid=65534(nobody) gid=65534(nobody)
getent group www-data → www-data:x:82:nginx   # 82 is a GID, not a UID
/var/www/html/files → symlink to volume/files, shipped owned 65534:65534

Byte-exact, the rendered rule vs the bug:

dir 0750 65534 65534 , bind-mounted, run as nobody → php is_writable() → bool(true)
dir       82 82      , same                        → php is_writable() → bool(false)

So the fix clears the drive's exact failure ("/var/www/html/files" is not a writable directory) by the ownership change alone; the reconcile 125 and the switch exit-4 masked_exit were downstream symptoms of the crash-loop.

What landed

  • internal/clan/archive.go — renderArchiveStore: files owner 82 82 → 65534 65534; the misleading comment replaced with the confirmed uid rationale (db 999 999 left untouched — MariaDB initialised cleanly).
  • internal/clan/archive_test.go — red-first TestRenderArchive_FilesDirOwnedByContainerRuntimeUid: the render must own files 65534 65534, the stale 82 82 must be gone, db stays 999 999.
  • docs/GOTCHAS.md — entry #177 (own a self-installing image's bind mount by the runtime uid, never a gid that looks like one).
  • STATUS.md — header updated.

Proof: go build ./... + go test ./internal/clan/ ./control-plane/cmd/control-plane/ ./internal/catalogue/ all green. Commit e4698752, pushed to main.

The remaining end-to-end confirmation is the deferred clan-lab archive drive re-running deploy-archive green (the layer this red sat under is now cleared; the #1254 gate and #1255 admin-name fix already held). No new door was needed.

**Ruled by agent under ADR 0174 — veto anytime.** Two-way door: a revertible one-constant render change, provable by an existing test + a byte-exact probe of the pinned image. Not on the one-way-door list (no credential, no security-posture widening, no member-/public-facing trust surface, no data destruction, no non-routine spend). The prior refusal correctly declined to *heal* this in-drive — the three candidate fixes are not interchangeable, so it belongs on a ticket with a stated ruling; that ruling is below. Precedent agrees the file is agent-rulable via a ticket: #1254 and #1255 both landed as sandcastle commits. ## The ruling: candidate 1 — own the files subdir by the container's runtime uid `renderArchiveStore` now renders `d <store>/files 0750 65534 65534 -` (`internal/clan/archive.go`, commit `e4698752`). 65534 is the erseco image's actual runtime uid (`Config.User = nobody`), and it matches the established pattern of the sibling `db` rule (`999 999` = MariaDB's runtime uid): **own each bind-mount subdir by its consuming container's runtime uid.** The old `82 82` mistook the www-data *group* gid (`www-data:x:82:nginx`) for a uid — no user has uid 82 in the image at all. Rejected the other two candidates: - **Candidate 2 (mount the `volume` root instead of the `files` symlink)** — changes ADR 0080 / P7 restore coverage: it would persist `config/`, `logs/`, `modules/`, `themes/`, state the declarative env + `OMEKA_MODULES` should re-derive on each rebuild, creating drift risk against the declarative model. A behaviour change beyond the bug. - **Candidate 3 (`:U` / `--userns` on the container)** — `:U` recursively chowns the community's whole dataset on every deploy (potentially large digital-heritage media), and fights the restore path. Heavier and riskier than owning the dir once via tmpfiles. ## Independently confirmed against the pinned digest (matou-workstation, docker) ``` Config.User → nobody id (runtime user) → uid=65534(nobody) gid=65534(nobody) getent group www-data → www-data:x:82:nginx # 82 is a GID, not a UID /var/www/html/files → symlink to volume/files, shipped owned 65534:65534 ``` Byte-exact, the rendered rule vs the bug: ``` dir 0750 65534 65534 , bind-mounted, run as nobody → php is_writable() → bool(true) dir 82 82 , same → php is_writable() → bool(false) ``` So the fix clears the drive's exact failure (`"/var/www/html/files" is not a writable directory`) by the ownership change alone; the reconcile 125 and the switch exit-4 `masked_exit` were downstream symptoms of the crash-loop. ## What landed - `internal/clan/archive.go` — `renderArchiveStore`: `files` owner `82 82` → `65534 65534`; the misleading comment replaced with the confirmed uid rationale (db `999 999` left untouched — MariaDB initialised cleanly). - `internal/clan/archive_test.go` — red-first `TestRenderArchive_FilesDirOwnedByContainerRuntimeUid`: the render must own files `65534 65534`, the stale `82 82` must be gone, db stays `999 999`. - `docs/GOTCHAS.md` — entry #177 (own a self-installing image's bind mount by the runtime uid, never a gid that looks like one). - `STATUS.md` — header updated. Proof: `go build ./...` + `go test ./internal/clan/ ./control-plane/cmd/control-plane/ ./internal/catalogue/` all green. Commit `e4698752`, pushed to `main`. The remaining end-to-end confirmation is the deferred clan-lab archive drive re-running `deploy-archive` green (the layer this red sat under is now cleared; the #1254 gate and #1255 admin-name fix already held). No new door was needed.
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#1271
No description provided.