All libraries are gone....

Hi, i’ve actual big problems with my Plex Setup. Last week suddenly all my libraries were not available anymore. I searched in the logs but didn’t find the problem. Then I configured a new plex server:
Plex on Docker (plexinc/pms-docker) - 1.12.1.4885
Linux: Debian
Platform: Linux 4.9.0-0.bpo.5-amd64
Python Version: 2.7.14 (default, Dec 14 2017, 15:51:29) [GCC 6.4.0

Yesterday everything worked fine. I configured the different agents and added my new libraries. Also I restarted several times and no problems. Today morning all my libraries are gone again!

Permission on the different folder should looks as this:
drwxr-xr-x 3 dockeradm dockergrp 4.0K Mar 30 11:04 plexmediaserver

But today morning I saw the following message in the docker logs plex:
OSError: [Errno 13] Permission denied: ‘/config/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs’

And my permission was reseted (probably from plex?). I set the permission again to dockergrp and dockeradm and now can the plex server start, but without libraries:
drwxr-xr-x 3 root root 4.0K Mar 30 11:04 Library

Here the output from the actual docker logs plex:
/opt/plex# 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…
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.

Which additional logs do you need? Thanks for you help.

Any help? Nobody else has this problem with the docker container?

Here are my plex logs.

What is your host OS?
How does your start command or your docker-compose.yml for your container look like?
How do your folder permissions and owner’s uid and gid for the host folders mapped into the container look like?

Hi kopfpilot, here are my answers:

Host OS: Debian 8, 4.9.0-0.bpo.5-amd64 (OpenMediaVault with Backport Kernel)

docker-compose.yml:
`version: ‘2’

services:

plex:
image: plexinc/pms-docker
container_name: plex
restart: always
network_mode: host
environment:
- PLEX_UID=1001
- PLEX_GID=1000
- TZ=Europe/Zurich
volumes:
- /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174/plexmediaserver:/config
- /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174/tvshows:/tvshows
- /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174/movies:/movies
- /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174/movies3d:/movies3d
- /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174/movies4k:/movies4k
`

Folder Permission:
drwxr-xr-x 3 dockeradm dockergrp 4.0K Mar 30 11:04 plexmediaserver
drwxr-sr-x 5 dockeradm dockergrp 40K Mar 31 08:21 movies
drwxr-sr-x 5 dockeradm dockergrp 4.0K Mar 31 16:57 movies3d
drwxr-sr-x 2 dockeradm dockergrp 4.0K Mar 30 12:05 movies4k
drwxr-sr-x 76 dockeradm dockergrp 4.0K Mar 30 15:20 tvshows

Thank you in advance for your help.

Uid:gid of the folders please :slight_smile:

please use ‘ls -l /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174’ instead of just ‘ls /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174’

Is there a reason the media folders have a netmask of 2755?

I used a ls -lha in the above command.

The dockeradm (user) and dockergrp (group) are the group / users. Here is the output from id:
id dockeradm
uid=1001(dockeradm) gid=100(users) groups=100(users),1000(dockergrp)

Netmask 2755? Ah the 755 do you mean? No for this is not a special reason. What would you recommend?

What i can see so far:

  • your docker-compose.yml looks fine to me.
  • PLEX_UID=1001 and PLEX_GID=1000 match with the uid:gid of the owner of the mapped volume folders.
  • your settings folder has drwxr-xr-x = 755 permission mask.
  • your media folders have drwxr-sr-x 5 = 2755 permission mask. Kind of odd, but should allow group members to read whoever writes whatever into the folder.

Appart from the permssion mask for your media folders, nothing looks suspicous.

Are you sure all subfolders are also owned by the same uid:gid? if not, does the behavior change after ‘chown -R dockeradm:dockergrp /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174’?

Did you mount your shares/disks for the media before you started the docker container?

Actualy i wanted ‘ls -ln’ and forget the -n switch. Though, you presented the output of ‘id’, which helped to see that the permission mapping and file owner do match.

Now i understand what you mean with 2755. I’ve change this to the same config, like the config directory (0755) And also verified the uid:gid on the subfolders. But there was the permission also correct. Same behavior as before.
Yes the disk is mounted before i start the container.

Tanks a lot for review my setup!
This setup worked for more than 1.5 year. First with the linuxserver container and since release with the official container.

@plex docker container devs, you have not changed anything recently?

Here the latest docker logs plex output:
IOError: [Errno 2] No such file or directory: ‘/config/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.system.log’
Logged from file runtime.py, line 717
Traceback (most recent call last):
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/handlers.py”, line 76, in emit
if self.shouldRollover(record):
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/handlers.py”, line 154, in shouldRollover
self.stream = self._open()
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/init.py”, line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: ‘/config/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.system.log’
Logged from file runtime.py, line 814
Traceback (most recent call last):
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/handlers.py”, line 76, in emit
if self.shouldRollover(record):
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/handlers.py”, line 154, in shouldRollover
self.stream = self._open()
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/init.py”, line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: ‘/config/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.system.log’
Logged from file storage.py, line 60
Traceback (most recent call last):
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/handlers.py”, line 76, in emit
if self.shouldRollover(record):
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/handlers.py”, line 154, in shouldRollover
self.stream = self._open()
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/init.py”, line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: ‘/config/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.system.log’
Logged from file runtime.py, line 889
Traceback (most recent call last):
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/handlers.py”, line 76, in emit
if self.shouldRollover(record):
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/handlers.py”, line 154, in shouldRollover
self.stream = self._open()
File “/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/logging/init.py”, line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: ‘/config/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.system.log’
Logged from file runtime.py, line 924

I think there are problems with permissions. The Log directory and files should plex create by itself?

I am using plexinc/pms-docker:beta myself. I didn’t experience any permission problems lately.
Though, according to your settings they should not exist on your system either :wink:

The Log directory and files should be created by plex.

Appart from different uid:gid and user/group name my configuration looks not any differnt than yours.
All my sub folders of /config (in the container) have a 755 permission mask.

What happens if you open a shell in the container, can you browse the location?
‘docker exec -ti “container name or id” /bin/sh’

I do remember that OMV allows to change permission and ACL settings for shares. Can the problem be related to recent changes to the ACL settings? I must admit on my XPEnology-Box I do not use the ACL settings and stick with unix permissions instead.

Yesterday I recreated the whole plex docker setup again (like last week). But now it works and look stable. I restarted the Debian several times and also updated the container - new plex docker update this morning - and also no problems. I don’t know what is the difference between the actual setup and the setup last week, but at the moment it works. I will observe this behavior.

Thanks a lot for your help!

I am currious if you just deleted /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174/plexmediaserver, recreated the folder and recreated a new container. Did you change anything on your media folers?

Pitty, that you didn’t pipe the output of ‘ls -lnR /media/9c5fd0e3-1d4c-45d7-88a7-ffbfbe786174/plexmediaserver’ to a text file. You could do the same after the reparation and check for permission differences of files.

Glad that it worked out for you :slight_smile:

I’ve change the media directory permissions from 2755 to 0755 and removed the special ACL. Maybe this was the problem… Thanks again for your help.

2755 isn’t a problem but the ACL could be depending on what it is.

The ACL was the default ACL from OpenMediaVault.

Not sure what you mean by OMV default ACL. I run OMV here and there are no ACLs (extended permissions) set anywhere,