I have an odd issue that has just crept up that I think is Sonarr/Sabnzbd related but I can’t figure it out. Have been troubleshooting for hours.
I had an external HDD fail. I’ve replaced it now and it’s formatted with ext4 (old one was NTFS).
My fstab entries look like this:
UUID=0c6df3fd-c3f7-4b4d-a073-1d16119474db /mnt/usb0 ext4 defaults,auto,users,rw,nofail 0 0 UUID=0424-AB15 /mnt/usb1 exfat defaults,uid=1001,gid=1001,umask=0000,rw,nofail 0 0
The disk in question is the first entry.
I’m running sab/sonarr using the correct PUID and PGID, but whenever a download finishes and it imports, the owner of the file is “166536” instead of the user “docker” (which is user 1001, same ID mapped in Docker Compose).
If I download and import a file to the other disk noted in the fstab entry, the owner is “docker” as expected.
I’ve docker exec’d into both containers and checked that the process is running as “abc”, and running cat /etc/passwd shows the user “abc” mapped to the 1001 ID as expected.
I cannot for the life of me figure out why the files end up owned by that random number on the ext4 disk but on the exFAT disk they show up as “docker” like they should. Downloading and importing still works as it should, and I can always chown the folders every so often, but I have to set permissions to 777 on both the Downloads and TV folders otherwise Sab/Sonarr throw permission errors.
It’s my understanding that the internal docker user is mapped to the host ID specified in the Docker Compose file and thus setting permissions for those folders to 775 or even 755 should be sufficient. I’d rather not leave them on 777 and have to chown them regularly, it’s poor practice from multiple standpoints.
Have I misconfigured something or am I misunderstanding permissions somehow?
Edit: Other things I’ve tried: re-pulling image, deleting containers and re-pulling image, downgrading image, trialling the permissions settings in both Sab and Sonarr.
Can provide Docker Compose setups if needed.
Edit 2: Compose lines (snipped the relevant parts out of the stack): File ownership issue - Pastebin.com