newsletters-brand: the community logo never reaches the Newsletters port — the media upload 500s because /var/lib/listmonk/uploads is never created, and app.logo_url / app.favicon_url stay empty while branded-chrome goes green #1612

Closed
opened 2026-09-18 22:21:16 +00:00 by matou-build-agent · 1 comment

The fault

Separate from the OIDC-secret clobber healed in 30db5680, and concretely shown by the same run's evidence: the brand oneshot's logo upload fails on every deploy, so the Newsletters port never wears the community's logo.

Evidence, from the kept box

journalctl -u listmonk.service -b, both brand runs:

22:06:10 listmonk[14033]: media.go:72: error uploading file: open uploads/a8qv4221hi8d8lpps21iyxif6225mrak-logo: no such file or directory
22:06:58 listmonk[14033]: media.go:72: error uploading file: open /var/lib/listmonk/uploads/a8qv4221hi8d8lpps21iyxif6225mrak-logo: no such file or directory

The first is relative (before newsletters-smtp set upload.filesystem.upload_path), the second absolute — the directory simply is not there:

# ls -ld /var/lib/listmonk /var/lib/listmonk/uploads
lrwxrwxrwx root root /var/lib/listmonk -> private/listmonk
ls: cannot access '/var/lib/listmonk/uploads': No such file or directory

And the settings rows the upload was supposed to fill:

app.logo_url|""
app.favicon_url|""
upload.provider|"filesystem"
upload.filesystem.upload_path|"/var/lib/listmonk/uploads"
app.site_name|"Roles Proof"

The community name and palette landed; the logo did not.

Cause

renderNewslettersBrand POSTs the materialised logo to Listmonk's media API and captures the returned uri (internal/clan/newsletters.go:708-710), then sets app.logo_url / app.favicon_url only if $logo != "" (newsletters.go:722). The POST is curl -sf … || true, so the 500 is swallowed, $logourl stays empty, the merge silently skips both slots and the oneshot finishes green.

The upload path is declared as store + "/uploads" (newsletters.go:401, DefaultNewslettersStorePath = /var/lib/listmonk, newsletters.go:100) but nothing ever creates that subdirectory — grep -n 'tmpfiles\|StateDirectory\|install -d\|mkdir' internal/clan/newsletters.go returns nothing. The nixpkgs listmonk module runs the daemon under a StateDirectory (hence /var/lib/listmonk -> private/listmonk), which creates the state dir but not the uploads child, and Listmonk's media handler opens the file rather than creating the tree.

Why the drive does not catch it

branded-chrome was green on this drive — it proves the name and palette, not the logo object — so DDR 0225's "applied" reads true for a surface whose logo slots are empty. Nothing reds; the fault is only visible in the daemon's journal and in the two empty settings rows.

Suspected fix

A systemd.tmpfiles rule (or the oneshot's own install -d) creating the declared uploads directory under the Newsletters dataset with the daemon's ownership, plus not swallowing the media POST's failure — the same "never a phantom apply" rule the settings gate already enforces (newslettersSettingsReadyGate, newsletters.go:447-464, ADR 0100 / GOTCHAS #2): a brand apply that cannot upload the logo should say so rather than finish green with empty slots.

drive 20260918T211405Z red at operator-newsletters: newsletters (oidc) showed its OWN login form to proof-operator at https://newsletters.roles-proof.idss.nz/auth/oidc?code=eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIiwia2lkIjoiOGNiMWU3NTQ4NWQxIn0.45_u_HI
evidence: /home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260918T211405Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The fault Separate from the OIDC-secret clobber healed in `30db5680`, and concretely shown by the same run's evidence: the brand oneshot's logo upload fails on every deploy, so the Newsletters port never wears the community's logo. ## Evidence, from the kept box `journalctl -u listmonk.service -b`, both brand runs: ``` 22:06:10 listmonk[14033]: media.go:72: error uploading file: open uploads/a8qv4221hi8d8lpps21iyxif6225mrak-logo: no such file or directory 22:06:58 listmonk[14033]: media.go:72: error uploading file: open /var/lib/listmonk/uploads/a8qv4221hi8d8lpps21iyxif6225mrak-logo: no such file or directory ``` The first is relative (before `newsletters-smtp` set `upload.filesystem.upload_path`), the second absolute — the directory simply is not there: ``` # ls -ld /var/lib/listmonk /var/lib/listmonk/uploads lrwxrwxrwx root root /var/lib/listmonk -> private/listmonk ls: cannot access '/var/lib/listmonk/uploads': No such file or directory ``` And the settings rows the upload was supposed to fill: ``` app.logo_url|"" app.favicon_url|"" upload.provider|"filesystem" upload.filesystem.upload_path|"/var/lib/listmonk/uploads" app.site_name|"Roles Proof" ``` The community name and palette landed; the logo did not. ## Cause `renderNewslettersBrand` POSTs the materialised logo to Listmonk's media API and captures the returned uri (`internal/clan/newsletters.go:708-710`), then sets `app.logo_url` / `app.favicon_url` only `if $logo != ""` (`newsletters.go:722`). The POST is `curl -sf … || true`, so the 500 is swallowed, `$logourl` stays empty, the merge silently skips both slots and the oneshot finishes green. The upload path is declared as `store + "/uploads"` (`newsletters.go:401`, `DefaultNewslettersStorePath = /var/lib/listmonk`, `newsletters.go:100`) but nothing ever creates that subdirectory — `grep -n 'tmpfiles\|StateDirectory\|install -d\|mkdir' internal/clan/newsletters.go` returns nothing. The nixpkgs listmonk module runs the daemon under a StateDirectory (hence `/var/lib/listmonk -> private/listmonk`), which creates the state dir but not the `uploads` child, and Listmonk's media handler opens the file rather than creating the tree. ## Why the drive does not catch it `branded-chrome` was green on this drive — it proves the name and palette, not the logo object — so DDR 0225's "applied" reads true for a surface whose logo slots are empty. Nothing reds; the fault is only visible in the daemon's journal and in the two empty settings rows. ## Suspected fix A `systemd.tmpfiles` rule (or the oneshot's own `install -d`) creating the declared uploads directory under the Newsletters dataset with the daemon's ownership, plus not swallowing the media POST's failure — the same "never a phantom apply" rule the settings gate already enforces (`newslettersSettingsReadyGate`, `newsletters.go:447-464`, ADR 0100 / GOTCHAS #2): a brand apply that cannot upload the logo should say so rather than finish green with empty slots. drive `20260918T211405Z` red at `operator-newsletters`: `newsletters (oidc) showed its OWN login form to proof-operator at https://newsletters.roles-proof.idss.nz/auth/oidc?code=eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIiwia2lkIjoiOGNiMWU3NTQ4NWQxIn0.45_u_HI` evidence: `/home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260918T211405Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: be8cfadc5b90 -->
Owner

Plugged in c4de5cb4: the daemon's ExecStartPre makes <store>/uploads as the unit's own dynamic user; the logo upload retries across Listmonk's settings-save reload; a logo that still will not upload fails newsletters-brand after the name and palette land, instead of finishing green with empty slots. Render test + nix-instantiate --parse checked; GOTCHAS #257. Render-proven, live-unproven until the next roles-proof fire. One thing left as found: the materialised logo object has no file extension (…-logo), so Listmonk makes no thumbnail and serves it by sniffed content type — it passed Listmonk's extension check on the kept box (the default list carries *), so it is not a blocker.

Plugged in `c4de5cb4`: the daemon's `ExecStartPre` makes `<store>/uploads` as the unit's own dynamic user; the logo upload retries across Listmonk's settings-save reload; a logo that still will not upload fails `newsletters-brand` after the name and palette land, instead of finishing green with empty slots. Render test + `nix-instantiate --parse` checked; GOTCHAS #257. Render-proven, live-unproven until the next roles-proof fire. One thing left as found: the materialised logo object has no file extension (`…-logo`), so Listmonk makes no thumbnail and serves it by sniffed content type — it passed Listmonk's extension check on the kept box (the default list carries `*`), so it is not a blocker.
ben 2026-09-18 22:43:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1612
No description provided.