Unable to set the permission right on config directory

Server Version#: plexinc/pms-docker:latest

I am unable to get things started properly with plex.

After running the docker, here are the logs I see.

[santosh@SRCS docker_mounts]$ docker logs plex
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 40-plex-first-run: executing…
chown: cannot read directory ‘/config’: Permission denied
chown: cannot read directory ‘/transcode’: Permission denied
Creating pref shell
mkdir: cannot create directory ‘/config/Library’: Permission denied
/var/run/s6/etc/cont-init.d/40-plex-first-run: line 82: /config/Library/Application Support/Plex Media Server/Preferences.xml: No such file or directory
chown: cannot access ‘/config/Library/Application Support/Plex Media Server’: No such file or directory
failed to load external entity “/config/Library/Application Support/Plex Media Server/Preferences.xml”
failed to load external entity “/config/Library/Application Support/Plex Media Server/Preferences.xml”
failed to load external entity “/config/Library/Application Support/Plex Media Server/Preferences.xml”
failed to load external entity “/config/Library/Application Support/Plex Media Server/Preferences.xml”
failed to load external entity “/config/Library/Application Support/Plex Media Server/Preferences.xml”
failed to load external entity “/config/Library/Application Support/Plex Media Server/Preferences.xml”
failed to load external entity “/config/Library/Application Support/Plex Media Server/Preferences.xml”
Attempting to obtain server token from claim token
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 50-plex-update: executing…
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting Plex Media Server.
[cont-finish.d] executing container finish scripts…
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 40-plex-first-run: executing…
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 50-plex-update: executing…
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting Plex Media Server.

More debugging:

[santosh@SRCS docker_mounts] docker exec -it -u plex:plex plex /bin/bash plex@Media:/ ls -l
total 44
drwxr-xr-x. 2 root root 8192 Mar 4 2016 bin
drwxr-xr-x. 2 root root 6 Apr 12 2016 boot
drwxr-xr-x. 2 plex plex 4096 Aug 26 20:40 config
drwxr-xr-x. 9 plex users 134 May 4 2018 data
drwxr-xr-x. 5 root root 360 Aug 26 20:44 dev
drwxrwxr-x. 54 root root 4096 Aug 26 20:44 etc
-rwxrwxr-x. 1 root root 158 Aug 22 00:13 healthcheck.sh
drwxr-xr-x. 2 root root 6 Apr 12 2016 home
-rwxr-xr-x. 1 root root 369 Mar 5 2016 init
-rwxrwxr-x. 1 root root 490 Aug 22 00:13 installBinary.sh
drwxr-xr-x. 8 root root 96 Sep 13 2015 lib
drwxr-xr-x. 2 root root 34 Jul 20 06:50 lib64
drwxr-xr-x. 2 root root 28 Mar 4 2016 libexec
drwxr-xr-x. 2 root root 6 Jul 20 06:50 media
drwxr-xr-x. 2 root root 6 Jul 20 06:50 mnt
drwxr-xr-x. 2 root root 6 Jul 20 06:50 opt
-rwxrwxr-x. 1 root root 1512 Aug 22 00:13 plex-common.sh
dr-xr-xr-x. 465 root root 0 Aug 26 20:44 proc
drwx------. 2 root root 37 Jul 20 06:51 root
drwxr-xr-x. 4 root root 80 Aug 26 20:44 run
drwxr-xr-x. 2 root root 4096 Mar 4 2016 sbin
drwxr-xr-x. 2 root root 6 Jul 20 06:50 srv
dr-xr-xr-x. 13 root root 0 Aug 26 20:11 sys
drwxrwxrwt. 2 root root 40 Aug 26 20:44 tmp
drwxr-xr-x. 3 plex plex 23 Aug 22 23:29 transcode
drwxr-xr-x. 10 root root 105 Mar 4 2016 usr
drwxr-xr-x. 11 root root 139 Jul 20 06:51 var
-rw-r–r--. 1 root root 22 Aug 22 00:14 version.txt
plex@Media:/$

plex@Media:/$ ls /config

ls: cannot open directory ‘/config’: Permission denied

plex@Media:/$ id whoami

uid=1000(plex) gid=1000(plex) groups=1000(plex),44(video),100(users)

plex@Media:/$

I started the contained with a macvlan driver like so:

docker run -d --name plex --net=srv_net --ip=172.16.11.6 --dns=172.16.11.10 -e TZ=“America/Los_Angeles” -e PLEX_CLAIM=“claim-XXXX” -e ADVERTISE_IP=“http://ple:32400/” -h Media -v /srv/docker_mounts/plex:/config:rw -v /media/transcode:/transcode:rw -v /media/data:/data:ro plexinc/pms-docker

permisson on /srv/docker_mounts/plex:

drwxr-xr-x. 2 santosh docker 4096 Aug 26 20:40 plex
santosh@SRCS docker_mounts]$ id whoami

uid=1000(santosh) gid=100(users) groups=100(users),1000(docker)

The uid and gid inside and outside the container matches.

Ive tried numerous iterations and even reinstalled image etc… wtih no luck. Would appreciate any help!!

You don’t mention what OS is running on the host so I will guess Ubuntu or derivative. Under Ubuntu the /media folder has special permissions that protect files on a per user basis. Config and transcode need RWX not just RW. Unless you are actually trying to connect to a specific Vlan, I would just use the HOST network option at first to minimize setup problems.

Hi Thanks for responding. The host is running fedora 25. This specific configuration worked well for me in the past. In fact I can ping this container with no issues. I had a power reset and when the server came back up I ran into a crash. In attempt to fix that, I ended up blowing away all the files in config directory, removed the container and created a new one. Have been having this problem ever since. I dont think rwx is an issue because once Im in the container, I cant even ls the config directory. What can explain that?

I can try running as host first and see if that works. Anything else I could try? Can I get more information generated in the logs?

In your run file do you have?

PLEX_UID=1000 \
PLEX_GID=100 \

And was your user added to the docker group?

Yes. My user “santosh” belongs to docker group. I didnt use PLEX_UID and PLEX_GID since the directory outside the container belongs to UID=1000 and GID=1000 and within the container plex user seems to have the same UID and GID. You think that might be the issue? Why 100? Ill try that out today.

docker run -d --name plex --net=srv_net --ip=172.16.11.6 --dns=172.16.11.10 -e TZ=“America/Los_Angeles” -e PLEX_CLAIM=“claim-XXXXXXXXX” -e ADVERTISE_IP=“http://plex:32400/” -e PLEX_UID=1000 -e PLEX_GID=100 -h Media -v /srv/docker_mounts/plex:/config:rw -v /media/transcode:/transcode:rw -v /media/data:/data:ro plexinc/pms-docker

[santosh@SRCS ~]$ docker logs plex

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.

[s6-init] ensuring user provided files have correct perms…exited 0.

[fix-attrs.d] applying ownership & permissions fixes…

[fix-attrs.d] done.

[cont-init.d] executing container initialization scripts…

[cont-init.d] 40-plex-first-run: executing…

Creating pref shell

Attempting to obtain server token from claim token

Token obtained successfully

Plex Media Server first run setup complete

[cont-init.d] 40-plex-first-run: exited 0.

[cont-init.d] 50-plex-update: executing…

[cont-init.d] 50-plex-update: exited 0.

[cont-init.d] done.

[services.d] starting services

[services.d] done.

Starting Plex Media Server.

[santosh@SRCS ~]$

[santosh@SRCS ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d91f05cbf5d7 plexinc/pms-docker “/init” About a minute ago Up About a minute (unhealthy) plex

[santosh@SRCS ~]$ docker exec -it plex /bin/bash
root@Media:/# ls -l
total 44
drwxr-xr-x. 2 root root 8192 Mar 4 2016 bin
drwxr-xr-x. 2 root root 6 Apr 12 2016 boot
drwxrwxr-x. 2 plex 1000 4096 Aug 26 20:40 config
drwxr-xr-x. 9 plex users 134 May 4 2018 data
drwxr-xr-x. 5 root root 360 Aug 27 22:37 dev
drwxrwxr-x. 54 root root 4096 Aug 27 22:37 etc
-rwxrwxr-x. 1 root root 158 Aug 22 00:13 healthcheck.sh
drwxr-xr-x. 2 root root 6 Apr 12 2016 home
-rwxr-xr-x. 1 root root 369 Mar 5 2016 init
-rwxrwxr-x. 1 root root 490 Aug 22 00:13 installBinary.sh
drwxr-xr-x. 8 root root 96 Sep 13 2015 lib
drwxr-xr-x. 2 root root 34 Jul 20 06:50 lib64
drwxr-xr-x. 2 root root 28 Mar 4 2016 libexec
drwxr-xr-x. 2 root root 6 Jul 20 06:50 media
drwxr-xr-x. 2 root root 6 Jul 20 06:50 mnt
drwxr-xr-x. 2 root root 6 Jul 20 06:50 opt
-rwxrwxr-x. 1 root root 1512 Aug 22 00:13 plex-common.sh
dr-xr-xr-x. 467 root root 0 Aug 27 22:37 proc
drwx------. 2 root root 37 Jul 20 06:51 root
drwxr-xr-x. 4 root root 80 Aug 27 22:37 run
drwxr-xr-x. 2 root root 4096 Mar 4 2016 sbin
drwxr-xr-x. 2 root root 6 Jul 20 06:50 srv
dr-xr-xr-x. 13 root root 0 Aug 26 20:11 sys
drwxrwxrwt. 2 root root 40 Aug 27 22:37 tmp
drwxr-xr-x. 3 plex 1000 23 Aug 22 23:29 transcode
drwxr-xr-x. 10 root root 105 Mar 4 2016 usr
drwxr-xr-x. 11 root root 139 Jul 20 06:51 var
-rw-r–r–. 1 root root 22 Aug 22 00:14 version.txt

[santosh@SRCS ~]$ docker exec -it -u plex:100 plex /bin/bash

plex@Media:/$ id whoami

uid=1000(plex) gid=100(users) groups=100(users),44(video)

plex@Media:/$ ls config

ls: cannot open directory ‘config’: Permission denied

Setting GID to 100 doesnt seem right based on above. So I even tried 1000, that had the same result. So back to square 1 :slight_smile:

Same issue with host networking…

[santosh@SRCS ~] docker run -d --name plex --net=host -e TZ="America/Los_Angeles" -e PLEX_CLAIM="claim-a_PxsKHq2zQVRF2EA7_-" -h Media -v /srv/docker_mounts/plex:/config:rw -v /media/transcode:/transcode:rw -v /media/data:/data:ro plexinc/pms-docker 527eeab98df96177cf7f774391b4927a978a4b0080cf2e3c05c116daafa4f02e [santosh@SRCS ~] docker logs plex
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 40-plex-first-run: executing…
Creating pref shell
Attempting to obtain server token from claim token
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 50-plex-update: executing…
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting Plex Media Server.
[santosh@SRCS ~] docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 527eeab98df9 plexinc/pms-docker "/init" 27 seconds ago Up 22 seconds (health: starting) plex 47a51caac9eb docker.io/sameersbn/bind "/sbin/entrypoint.sh " 4 weeks ago Up 26 hours dns a1d192a6216f gogs/gogs "/app/gogs/docker/sta" 4 weeks ago Up 26 hours git 1885118092bb mysql/mysql-server:5.7.18 "/entrypoint.sh mysql" 4 weeks ago Up Less than a second mysql [santosh@SRCS ~] docker exec -it -u plex:plex plex /bin/bash
plex@SRCS:/ ls -l total 44 drwxr-xr-x. 2 root root 8192 Mar 4 2016 bin drwxr-xr-x. 2 root root 6 Apr 12 2016 boot drwxrwxr-x. 2 plex plex 4096 Aug 26 20:40 config drwxr-xr-x. 9 plex users 134 May 4 2018 data drwxr-xr-x. 5 root root 360 Aug 27 22:51 dev drwxrwxr-x. 54 root root 4096 Aug 27 22:51 etc -rwxrwxr-x. 1 root root 158 Aug 22 00:13 healthcheck.sh drwxr-xr-x. 2 root root 6 Apr 12 2016 home -rwxr-xr-x. 1 root root 369 Mar 5 2016 init -rwxrwxr-x. 1 root root 490 Aug 22 00:13 installBinary.sh drwxr-xr-x. 8 root root 96 Sep 13 2015 lib drwxr-xr-x. 2 root root 34 Jul 20 06:50 lib64 drwxr-xr-x. 2 root root 28 Mar 4 2016 libexec drwxr-xr-x. 2 root root 6 Jul 20 06:50 media drwxr-xr-x. 2 root root 6 Jul 20 06:50 mnt drwxr-xr-x. 2 root root 6 Jul 20 06:50 opt -rwxrwxr-x. 1 root root 1512 Aug 22 00:13 plex-common.sh dr-xr-xr-x. 467 root root 0 Aug 27 22:51 proc drwx------. 2 root root 37 Jul 20 06:51 root drwxr-xr-x. 4 root root 80 Aug 27 22:51 run drwxr-xr-x. 2 root root 4096 Mar 4 2016 sbin drwxr-xr-x. 2 root root 6 Jul 20 06:50 srv dr-xr-xr-x. 13 root root 0 Aug 26 20:11 sys drwxrwxrwt. 2 root root 40 Aug 27 22:51 tmp drwxr-xr-x. 3 plex plex 23 Aug 22 23:29 transcode drwxr-xr-x. 10 root root 105 Mar 4 2016 usr drwxr-xr-x. 11 root root 139 Jul 20 06:51 var -rw-r--r--. 1 root root 22 Aug 22 00:14 version.txt plex@SRCS:/ ls config
ls: cannot open directory ‘config’: Permission denied
plex@SRCS:/$

[santosh@SRCS ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
527eeab98df9 plexinc/pms-docker “/init” 2 minutes ago Up 2 minutes (unhealthy) plex

Found the problem. This is a selinux issue which was preventing access to the directory. Whats the cleanest way to avoid this. I temporarily disabled selinux to get past this.

Is using the Z option the best thing here?

Thanks!

The solution:

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