Page uploads fail with permission denied: CIFS volumes mounted without uid=1654 (reads work, writes fail) #81
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?
Since the 2026-08-15/16 app update, new page uploads fail while all reads work.
Symptom (production log, 2026-08-16 15:32):
GET /api/images/… → 200 in the same minute; the app runs as uid 1654 (
idin the container confirms).Root cause: the three external media volumes (
doujinshi_images,doujinshi_thumbnails,doujinshi_backup) arelocal-driver volumes withtype=cifs(NAS share//192.168.68.80/Doujinshi/…), created withoutuid=/gid=mount options. The kernel therefore presents every file and directory asroot:rootwith fake0755modes — readable by all, writable by none except root.chown -R 1654:1654is a silent no-op on CIFS (exits 0, changes nothing — verified with a probe file). Writes worked until 2026-08-10 because the container ran as root; PR #66's uid-1654 image broke every write to these volumes, with thumbnails andVACUUM INTObackups failing silently in parallel.Why the documented repair didn't apply: DEPLOYMENT.md §8.1 covers chown repairs for bind mounts and daemon-local volumes; CIFS-backed volumes ignore chown entirely — ownership is fixed at mount time. The docs also only showed the
type=nonebind variant in §4.1, not the CIFS layout production actually uses.Fix (applied in production 2026-08-16, verified):
docker volume rm+docker volume createeach media volume withuid=1654,gid=1654,file_mode=0644,dir_mode=0755in the-ooptions (same share, same data — only the volume object is rebuilt).Docs PR documents the mount options in §4.1, adds §8.1 item 4 (CIFS ≠ chown-able; recreate with uid/gid), and a troubleshooting row for the read-works-write-fails fingerprint.