Jump to content

Permission Denied w/ Synology + Docker


corey

Recommended Posts

I have a Synology DS716+ (latest software) with the Docker package installed.

 

I've launched the container and mounted the shared folders on the NAS to specified mount points using the Synology Docker launch wizard. When I hit Emby and try and set up my media folders I get a permission denied error in the Emby logs.

 

What I find most interesting is that when I installed Docker it created a shared folder named "docker". I've mounted that to my Emby container and Emby has no problem writing the necessary configuration files there. However, as I mentioned above Emby cannot write to any other folder I mount to the container. 

 

I've reviewed the permissions for both the "docker" folder and my media folders and I don't see any glaring differences that would prevent reading my media folders.

 

It's also worth noting that when I use the terminal as root in the container I can view my media folders just fine so it's only the default "appuser" that cannot access my media folders. I've also tried setting the APP_UID and APP_GUID to one of my Synology users and that didn't work either.

 

Has anyone seen this behavior? Am I missing anything?

 

Thanks!

Edited by corey
Link to comment
Share on other sites

I have a similar problem - Emby on Docker on DS716+. I thought I fixed the folder acces (via ssh and chmod for relevant shares), but after an Emby server restart the folder with config files was suddenly unacessible again to Emby - therefore it doesn't start anymore.

What's weird here is that I didn't change any permission settings or Docker parameters ... I just restarted the server inside Docker. I have absolutely no idea what caused the permission change and how to fix it yet.

Link to comment
Share on other sites

corey

Interesting, I haven't observed any problems with the Emby docker container having problems writing to anything in the "/docker" created shared by Synology (where I'm putting my config now), but exposing any other NAS share is not writable by the "appuser" in the container. It's writable by root in the container though...

 

I was thinking of mounting the shares manually in the container with a user and password defined in Synology but that seems like a backwards way to achieve this.

Link to comment
Share on other sites

hurricanehrndz

Please read the the wiki or the docker page and use the appropriate environment variables within the docker so that the permissions are compatible with your setup. The variables that you might be most interested in are

APP_UID
APP_GID
Edited by hurricanehrndz
Link to comment
Share on other sites

hurricanehrndz

I have a similar problem - Emby on Docker on DS716+. I thought I fixed the folder acces (via ssh and chmod for relevant shares), but after an Emby server restart the folder with config files was suddenly unacessible again to Emby - therefore it doesn't start anymore.

What's weird here is that I didn't change any permission settings or Docker parameters ... I just restarted the server inside Docker. I have absolutely no idea what caused the permission change and how to fix it yet.

 

I have a Synology DS716+ (latest software) with the Docker package installed.

 

I've launched the container and mounted the shared folders on the NAS to specified mount points using the Synology Docker launch wizard. When I hit Emby and try and set up my media folders I get a permission denied error in the Emby logs.

 

What I find most interesting is that when I installed Docker it created a shared folder named "docker". I've mounted that to my Emby container and Emby has no problem writing the necessary configuration files there. However, as I mentioned above Emby cannot write to any other folder I mount to the container. 

 

I've reviewed the permissions for both the "docker" folder and my media folders and I don't see any glaring differences that would prevent reading my media folders.

 

It's also worth noting that when I use the terminal as root in the container I can view my media folders just fine so it's only the default "appuser" that cannot access my media folders. I've also tried setting the APP_UID and APP_GUID to one of my Synology users and that didn't work either.

 

Has anyone seen this behavior? Am I missing anything?

 

Thanks!

Sorry didn't see this. If you are able to figure out what is going on, please let me know and I will try and fix any issues with the container itself.

 

PS Do you know the version of Docker running on your synology device and is there any userns mapping going on?

Edited by hurricanehrndz
Link to comment
Share on other sites

corey

My Synology is saying that the version of Docker that is installed is 1.6.2-0036. Through the terminal it's reported as:

 

Docker version 1.6.2, build a263667

Edited by corey
Link to comment
Share on other sites

corey

So, I haven't made any changes tonight but I made this observation through the terminal on my Synology:

 

Here's the ls output for the volume I mounted that the Emby container CAN WRITE to:

ds716nas> ls -l /volume1/
drwxr-xr-x    1 root     root            24 Feb  3 19:37 @S2S
drwxrwxrwx    1 root     root            36 Feb  6 00:19 @appstore
drwxr-xr-x    1 admin    users           44 Feb  3 19:37 @database
drwxr-xr-x    1 root     root           144 Feb 28 23:23 @docker
drwxr-xr-x    1 root     root            20 Feb 28 23:22 docker
d---------    1 root     root           382 Feb  5 22:07 media
ds716nas> 

755 for @docker and 000 for media which happens to house the film and TV folder that I'm trying to read/write from the Emby container.

 

A ls on those folders produces:

ds716nas> ls -l /volume1/media
drwxrwxrwx    1 root     root           160 Feb 27 12:06 @eaDir
d---------    1 mediaser users          258 Feb 28 22:35 TV
d---------    1 mediaser users         8000 Mar  2 22:14 film

So I suspect this is part of my problem. However, I'm a bit apprehensive with regards to changing permissions via the terminal when obviously the Synology DSM has set them up this way for a reason.

 

Any thoughts?

Link to comment
Share on other sites

corey

Problem solved!

 

I found the Synology group that had access to this volume (not users as reported above) and set the GID of that group to APP_GID and Emby in the container is now able to view the contents of the directories.

Link to comment
Share on other sites

Reinstalled Emby from scratch, set the username of the daemon owner to a different one during install and now everything seems to work again.

Till next time, when I find something else to break. :)

Edited by peroksid
Link to comment
Share on other sites

  • 1 month later...
tariqmirza

can anyone post easy steps to follow, im not an expert and would like to run Emby using docker on my DS716+

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...