Skip to content

Docker - Issue with shoppinglist permissions on mounted folder #814

Closed

Description

@jonskoglund

I am having some permission issues with the shopping list which I am unable to fix. Below a screenshot from the terminal in Truenas.
The recipes are using my truenas uid and gid. But the shoppinglist doesn't use the proper uid. GID of shoppinglist is the same as my truenas gid.
Image

Image

My docker compose looks like this:

services:
  cookcli:
    image: ghcr.io/cooklang/cookcli:latest
    user: "1000:1000"
    ports:
      - "9080:9080"
    volumes:
      - /mnt/tn_media/recipes:/recipes
    restart: unless-stopped

the /mnt/tn_media/recipes is a mounted folder. This is a storage location on my truenas server.
The mount is configured like this:

//xxx.xxx.x.x/media/recipes      /mnt/tn_media/recipes    cifs    credentials=/xxx/xxxx/xxxxxxxx/.xxxxxxxxx,uid=1000,gid=1000,file_mode=0664,dir_mode=0775,noperm       0       0

On the docker host the userid is 1000 and the groupid is 1000. That works perfect for the recipes and the rest of my cookcli setup.

I can add recipes to the shoppinglist when using the webserver but the shppinglist doesn't sync to my iPhone. My recipes do sync.

.shopping-checked sync error:

[2026-10-20 08:59:15] ERROR IoError { path: ".shopping-checked", source: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } }
[2026-10-20 08:59:15] WARN Sync failed: Unknown("Check download failed: IO error in file .shopping-checked: Permission denied (os error 13)")
[2026-10-20 08:59:15] ERROR Sync failed: Sync failed: Unknown("Check download failed: IO error in file .shopping-checked: Permission denied (os error 13)")
[2026-10-20 08:59:15] WARN Sync failed (attempt 5/5), retrying in 80s: Sync failed: Unknown("Check download failed: IO error in file .shopping-checked: Permission denied (os error 13)")

.shopping-list sync error:

[2026-11-01 15:38:28] ERROR IoError { path: ".shopping-list", source: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } }
[2026-11-01 15:38:28] WARN Sync failed: Unknown("Check download failed: IO error in file .shopping-list: Permission denied (os error 13)")
[2026-11-01 15:38:28] ERROR Sync failed: Sync failed: Unknown("Check download failed: IO error in file .shopping-list: Permission denied (os error 13)")
[2026-11-01 15:38:28] WARN Sync failed (attempt 4/5), retrying in 40s: Sync failed: Unknown("Check download failed: IO error in file .shopping-list: Permission denied (os error 13)")

When i use iOS to add a recipe to the shoppinglist and let it sync with my webserver the uid doesn't change. But the webserver does change it to docker. Did I made a mistake in my configuration or is it a bug?

Activity

  1. dubadub commented on Nov 2, 2026

    @dubadub
    Member

    Thanks for the detailed report. Your configuration is fine; this was a bug.

    Whenever the web server changed the shopping list, it wrote a new file and renamed it over the old one. On an SMB share the TrueNAS server gives a new file to the account the share is mounted with, docker here. The uid=1000,gid=1000 mount options only change the owner your Docker host shows, not the real one. The sync then can't write the file it no longer owns, so it fails with Permission denied. Recipes kept their owner because sync writes them in place.

    #819 fixes this. When a file is on an SMB/CIFS or NFS share, or a rename would change its owner, CookCLI now writes through the existing file, so it keeps its owner and permissions. The same goes for pantry.conf, aisle.conf, recipes saved in the editor and pictures. Clearing the shopping list now empties .shopping-checked instead of deleting it.

    Two things on your side:

    1. Fix the files you have now. On TrueNAS, give .shopping-list and .shopping-checked in the recipes folder back to your user (or just delete them and add the recipes again).
    2. Files created for the first time are still owned by whatever the TrueNAS server decides, and no client can change that. To make new files come out right, one of these on the share helps:
      • add inherit owner = yes to the share's auxiliary parameters, so new files belong to the folder's owner;
      • mount the share with the credentials of the user who owns the recipes instead of docker;
      • or set up an inherited ACL on the recipes folder that gives your user (and docker) write access, so the owner stops mattering.

    Once #819 is released and the share is set up like this, the shopping list should sync again. Let us know if it doesn't.


    Generated by Claude Code

  2. jonskoglund commented on Nov 2, 2026

    @jonskoglund
    Author
    1. Fix the files you have now. On TrueNAS, give .shopping-list and .shopping-checked in the recipes folder back to your user (or just delete them and add the recipes again).
      ✅ Done.
    2. Files created for the first time are still owned by whatever the TrueNAS server decides, and no client can change that. To make new files come out right, one of these on the share helps:
    • add inherit owner = yes to the share's auxiliary parameters, so new files belong to the folder's owner;
    • mount the share with the credentials of the user who owns the recipes instead of docker; ✅ Done.
    • or set up an inherited ACL on the recipes folder that gives your user (and docker) write access, so the owner stops mattering.

    Will wait for next release and report if I find any errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions