After update: Plex only works as admin on Synology despite having permissions

Server Version#: 1.18.6.2368-97add474d
Player Version#:

Hi!
My Plex Server on a Ds918+ was not responding anymore, so I turned to plex.tv for advice. It said I should check for the newest version, so I downloaded the above version from plex.tv and installed it manually, without deinstalling the previous. Did not help, so I restarted the DS918 and voila, the server was back. BUT it didn’t find my movies, only showed them in the library. It also found my /video share, but not /video/movies where my movies are actually stored. I found out this is a permissions issue, and checked the permissions in the GUI for the plex user (they were r/w for /video). Additionally I went to the file station and set the owner of /video/movies to admin and the group to users (the plex user is in the groups video and users), and set the permissions to rwxrwxrwx including the subfolders.
I checked the permissions via ssh, they are just as I set them via the GUI.

none of this helped. Only when I put the plex user in the admin group I can use my library as usual!

I tried to change the owner of /video, but thats not possible in file station, only /video/movies lets me do that. Why is that and might that be the Problem? Is it because /video is a Folder that was created by synology?

I understand that plex changed the requirement for the plex user to be an admin a while ago, which is why you had to change permissions for plex. I did all that, why isn’t it working…?

thanks for your help
Markus

Do you mean this?

The only thing I maintain is the Plex share itself. It is for exclusive use with PMS data. Media doesn’t go in there.

What do you mean by “Only works as ‘admin’” ? If you had to put it back as it was because you didn’t apply the share permission changes then I suggest you revert to non-privileged and allow the DSM mechanisms to work as intended.

I mean I have to make the plex user an admin to make it work, which is basically the old way plex did it before the changes in the article you mentioned. But now, with the new version, I should be able to make plex a standard user und give it r/w permissions (or even just read permission) for the media folder and r/w permission for the plex folder. But it just won‘t work, even if i make plex the owner of the media folder.
What did I miss?

You don’t need to. If you do then something else is wrong.

May I have the Log files which capture it not working?
May I also see screenshots of the share Permissions (Control Panel - Shared Folders - Permissions tab)
And may I see any custom permissions you’ve applied through File Station?

which log file would you need? dont want to post all of them openly…

Sorry the pics are in German, hope you can guess out of context

these are the groups the plex user is in:

these are the permissions the plex user has. My media is in a subfolder of the /video share:

this are owner and group of the /video/films directory, where the media is stored:

These are the custom permissions of the same folder and subfolders:

Open FileStation:

In the Plex share, navigate: Library / Application Support / Plex Media Server

Right-Click Logs -> Compress to Logs.zip

Please attach this ZIP file here in the forum.

I also need to ask if you have applied custom permissions to your media using File Station or if you used the Synology Control Panel -> Shared Folders to control access?

Under normal Linux, and depending on the distribution, extra manual permissions are required.

On Synology, however, they are not. In all cases, once folders are manually set, a never ending need to manually set them is created. The only remedy is to revert all permission management back to Synology’s control which they are quite ‘insistent’ on as you’re finding out.

I will post again in a few moments after I verify the procedure to revert permissions still works with current DSM

I have confirmed:

In each media share:

  1. chmod -R 000 /volumeX/<share name>
  2. Open File Station & scroll down to “Share Name”
  3. Right click → Properties.
  4. Permissions tab
  5. Add all the appropriate users and user plex to the allowed users list.
  6. Check the “Apply to this folder, sub-folders, and files” box.

DSM has special ACL kernel code to handle 000. This is indicated by the + in the directory listing out.

sh-4.3# ls -la
total 36
d---------+  8 root root 4096 Feb 11 14:48 .
drwxr-xr-x  37 root root 4096 Jan 21 19:21 ..
d---------+  2 root root 4096 Dec 12 19:56 Abominable (2019)
d---------+  2 root root 4096 Feb  8  2018 Aladdin (1992)
d---------+  2 root root 4096 Dec 12 17:43 Alvin and the Chipmunks (2007)
d---------+  2 root root 4096 Sep 16  2017 Atlantis The Lost Empire (2001)
drwxrwxrwx+  3 root root 4096 Dec 31 13:27 @eaDir
d---------+  2 root root 4096 Jun  1  2019 #recycle
sh-4.3# 

Now “Scan Files” to verify PMS still sees everything correctly.
Every other Synology local user (apps / containers) listed in the permissions tab will also have the designated access.

Sorry it took so long, I misread your answer and thought I had to wait for you to check something…

I tried the chmod command via ssh as admin, but the answer was to every single directory „permission denied“ and with files „Operation not permitted“.

Also, when I go to the permissions tab, there is no „apply to all subfolders“ box.

Thanks for your help, what did I do wrong?

My Plex Media is in a subfolder of the „Video“ share, maybe that is the problem. „Video“, „Audio“ and „Photo“ shares are „preinstalled“ by Synology, and have a different permissions tab than the other shares, missing the „apply to subfolders“ box. All the other shares look exactly like your screenshot.
Should I move all my media to a different share?

Despite getring errors after executing the command, plex now does no longer play any file, even when it is in the admin group.

I know why the command did not work, had to use the sudo -1 command to get root rights first. I tried again and now I got no error messages. But when I open the permissions tab it shows the same permissions as before.
Ah, now I tried chmod 755, now it works, even if plex is not admin. But that is not how you wrote it. could it be you meant chmod 777 instead of 000? And then all the permissions are set in the synology system?

I have just seen that the + is missing at some of my shares, for instance the /video share. So the acl does not work. Is there a possibility to get the + back?

First, the predefined /video share from Synology has been problematic since Plex was first ported . Their Video Station product always has conflicted.

I’m also seeing problems with ACLs on other packages (like transmission).

Something has changed with these last few updates of DSM regarding security.
I’m working today & tomorrow (now that TMDB is resolved) on seeing if I can create a script which will restore valid ACLs on those files & directories which were put into “Linux mode” (as reported by synoacltool)

Ok, so I should just not use the /video share. Btw, by setting it to 775, it does not matter anymore what i set in DSM permissions, Plex plays anything even if it doesn‘t have any rights in DSM. Only the file station respects the settings in DSM if the permissions are not 000 with the +

Setting to 755 / 644 is “linux mode” and does completely bypass ACLs.
The only problem with this is that most don’t want to work in the shell all the time to maintain them.

I have two options, both of which I’m working on now using my test system.

  1. To restore those ACLs to your username and allow Plex
  2. To setup inheritance (setgid bit) maintenance which will bypass ACLs permanently.

If I can make both of these easily implementable then everyone will be able to choose whichever method works best for them.

I would like to ask everyone reading here,

If I can write the procedure to:

  1. Reset all Linux permissions to a default / sane value (755/644)
  2. Restore the base ACL with your username (as named in my script) as the primary owner
  3. Add user plex as a read-only user
  4. Have all these changes again visible and manageable in the Syno GUI

Is this acceptable ?

That would be exactly what I am looking for!

I will state that as this runs, it’s going to re-establish a baseline of permissions.

It will mean that any other considerations / permissions granted for other tools (3rd party) will need to be added again.

@spamschatulle_gmail_com

Ready to try this out on one of your media shares? It looks ok for me.

I, as the owner, will have “Custom” permissions after this is done which is expected.
Everyone will have ACL-granted R-O.

Please change and quote the shared folder paths in the main for loop.

sh-4.3# cat /volume2/ResetACLs 
#
# This script will reset and assert permissions in the each of the listed directories 
# in this "for" loop.   DO NOT assert permissions on any Synology/system-reserved folders.   This could render your data inaccessible.

# Which shares are we going to work on
for D in "/volume1/Animated" #"/volume2/movies" 
do

  # Revoke all previous permissions to a sane value
  find "$D" -type d -exec chmod 755 {} \;
  find "$D" -type f -exec chmod 644 {} \;

  # Now assert Synology ACLs so the current file owner has control
  find "$D" -type d -exec synoacltool -add {} 'owner:*:allow:rwxpdDaAaRWcCo:fd--' \;

  # Grant Read-only to everyone else
  find "$D" -type d -exec synoacltool -add {} 'everyone:*:allow:r-x------R-c-o:fd--' \;

done
sh-4.3#

The resultant permissions are:

sh-4.3# pushd /volume1/Animated/
/volume1/Animated /volume1/Animated
sh-4.3# stat BURN·E\ \(2008\)/
  File: ‘BURN·E (2008)/’
  Size: 4096      	Blocks: 16         IO Block: 4096   directory
Device: fd00h/64768d	Inode: 71696402    Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1026/   chuck)   Gid: (  100/   users)
Access: 2019-05-30 16:57:49.636322494 -0500
Modify: 2017-09-16 23:21:35.000000000 -0500
Change: 2020-03-26 14:49:50.054069030 -0500
 Birth: -
sh-4.3# ls -la | grep BURN
drwxr-xr-x+   2 chuck users 4096 Sep 16  2017 BURN·E (2008)
sh-4.3#