Docker / Sonarr permission issues

Sonarr version (exact version): 2.0.0.5338
Mono version (if Sonarr is not running on Windows): 5.20.1.34
OS: Synology NAS 1815+ - DSM 6.2.2-24922 Update 4
Debug logs: https://controlc.com/a4a25d88
Description of issue:

I had a complete setup between SABnzbd, Sonarr and Radarr running as an application on DSM. It all worked well. Then i decided to move all three services into Docker. I’m new to Docker but i like the flexibility and frequency of services updates. But since moving all three services across, I’ve run into permission issues. I’ll concentrate on SABnzbd and Sonnarr…

SETUP

SABnzbd runs as a Docker container with the following setup;

Sonarr runs as a Docker container with the following setup;

The PGID and PUID is correct. All three services are utilising an admin account that’s a part of the Administrators Group. The folders locations are as following and are all assigned with RW permissions.

SABnzbd see’s the Downloads location and files. It downloads to them no problem.
Sonarr also can see the Downloads location and TV Shows folder, which means i have mapped them correctly when setting up the Docker container. But for some strange reason, it cannot import ANY files…this is the error message that continues to appear;

Can someone please tell me where I’ve gone wrong with this setup? the PUID user has all the correct permissions assigned to all the folders, I just can’t seem to work this out…

ssh into dsm and run the following

sudo -i
enter your admin password again
docker exec -it "CONTAINERNAME" bash

that will get you into the container (presuming the image has bash, the linuxserver ones do) and allow you to take a look around

connect to the sonarr container and check the /downloads folder, can you actually see the correct structure under it?

also check the permissions from filestation in dsm. make sure the owner is set, and the permissions have the group set - and that it actually flows down to the lower levels (manually check some folders and if they dont have the correct permissions then reset it at the top level and tick the boxes to apply it to sub folders, then apply)

eg; (media is my user, and media management is my group that i run my containers as)

image

1 Like

Thanks for the reply. I’m still learning SSH but I managed to get a list of directories and ownership of each …

I’m now confused … the folder downloads and tv are assigned to some random user - wtf?! How do I change the ownership of these folders via WinSCP or DSM ?

And why does it say that Recycle is my home directory? :face_with_symbols_over_mouth:

the weird owner is the user inside the container that stuff runs as. you’d have to get its id and then check what id it matches in your system - it should match the PUID user you set. same for the group.

the container is prepopulated with that user and it has all the permissions required, every time you start the container it sets the id of the abc user to be the PUID (if youre using a linuxserver image)

dont know about the recycle thing but i wouldnt worry about it

what happens if you do an ls -l /downloads? can you see all the files/folders under there, and does the abc user/group have permissions

1 Like

I see … i would have thought, if i set the PUID and PGID, all the contents of the Container would be under the permissions and ownership of that user/group.

I just managed to fix it. I used WinSCP to change ownership and permissions to the user/group i desired. Applied it and now everything is working.

I still find it strange thst Docker didn’t assign the user/group that i specified in the setup.

Thanks for your help. Its much appreciated.

they are, its just that because you have the ability to change the ids theres code in the boot up sequence to set the abc user and group ids to match the incoming PUID and PGIDs.

this is why you have to check what id (number) the abc user and group are currently assigned, they should match the PGID and PUID you passed in, which then match the user and group on the host system

How do i check what PUID and PGID the user abc is?

i think its id -u abc for the user and id -g abc for the group

from within the container

Thanks for yoru help. Its much appreciated.

This is what i get when i try that command;

Its very confusing. Whats even more confusing now is, it went from being the uer i assgined, admin:administrators back to abc. Now I’m getting this error in the logs:

the image seems to show you left the container so were running the id command on your host, where the abc user doesnt exist. try again and make sure the prompt has root@sonarr (that should indicate you are inside the container)

its always going to be user abc and group abc from inside the container, thats how the container works. it remaps the PUID and PGID you pass in to the abc user and group.

same permissions error you got before?

presuming the PUID is coming in correctly, and the volumes are setup ok (they appear to be), what are the permissions for Downloads/complete and dbnMedia/TV-Shows on the host? do they match the PUID and PGID you are passing in?

Hey there… I was having some permission issues and I found this thread and was following your advice… but I don’t see ABC ABC. I see (for example) 995 ABC. Within the container, 995 says unknown user (but 995 is the correct ID on the outside!) and group ABC maps correctly to 1001.

Why might I be seeing 995 inside the container instead of ABC?

make sure the PUID is set to 995, then delete and recreate the container

if you had it wrong previously and fixed it, then it wont take effect until you delete the container and re-create it again

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.