Issues with Synology Permissions

Server Version#: 1.20.3.3437
Player Version#: Not sure where to find

So I’m having a strange issue and can’t find out how to fix. I’ve asked around on Discord and Reddit and no one can seem to figure out what’s going on.

Essentially movies and TV shows are added to my Plex library folders. TV Shows import just fine, movies however, import sometimes and sometimes do not import.

The only fix I can find is that I go to my Synology, right click the Share and/or the movies folder inside the share and check the box that says “Apply this to subfolders” to re-apply Plex’s permissions. Then the file that exists in the library folder already will import to Plex. This isn’t the case for every movie, but every couple of movies, I have to do this.

I’m sure it’s an issue with my permissions and how they’re set up, but I’ve tried making Plex an Admin, adding Plex to a group and giving that group r/w access. Making sure Plex has r/w access to the Share, to all the folders inside the share, etc.

Any tips or tricks would be GREATLY appreciated.

Some info in Syno FAQ Synology FAQ - Questions, Answers, and a few How-To's

To add to BigWheel,

If you’re using the Synology-provided shared folders, you will need to make new shared folders, named as you like.

There has always been conflict between the Synology-provided shared folders and Plex because Synology claims access control (permissions) regardless whether their Video / Audio or Photo Station products are installed.

You can make one shared folder with sub folders or multiple shared folders – whatever you like and makes most sense to how you organize.

In the Syno FAQ, you’ll find a nice setup How-To at the bottom of the first post.

In that FAQ post are tips and suggested How To for a setup.

Thank you both! I have all those settings applied from the FAQ. Also, this is a new created share, not a default share from Synology.

At the bottom of the FAQ it reads “It is possible, as you add media, you will again encounter individual files which aren’t seen. By applying the last part of this procedure surgically on those folders/files, you can open up their permissions and allow Plex to see them.” – which seems to be the problem I’m having with movies from time to time. Any idea on how to fix this?

UPDATE - Just added a movie which didn’t work, so here’s an example.

My Shared Folder is called “torrents”, dumb name, I know- but you’ll see Plex has R/W access. Inside that is a “TV Shows” and “Movies” folder, Plex has R/W access to those, I even made Plex the owner of Movies to try and help? Inside that folder is a movie folder “The Perfect Weapon (2020)”, which Plex has R/W access to but the owner is a different user (johnkatez), AND the movie file inside is owned by this user (johnkatez) and Plex does not have R/W access. See screenshots.

It’s almost like the “Apply to sub folders and files” is getting reset for new files?

Permissions for Shared Folder:

Permissions for Movies folder inside shared folder:

Permissions for The Perfect Weapon (2020) inside Movies folder:

Permissions for the file itself:

Are you signed in as a user with administrator privilege?

The screenshots indicate you aren’t.

Yes, my user that I’m signed in with is in the administrators group and has admin rights as far as I’m aware. Even tried to make Plex an admin to help.

Also, when I look at permissions inspector for the Movies folder, Plex is good to go:

But the The Perfect Weapon (2020) folder INSIDE the Movies folder does not inherit those settings… even though I keep checking the Apply to sub folders check box.

If I check the Apply to sub folders, the issue is temporarily fixed and Plex will find and add the file UNTIL I add a new movie and I have to repeat the process.

Plex runs as an unprivileged user (effective PMS 1.15.4.994).

How are you writing the files to the Syno?
NFS or SMB ?

I’m using Radarr and NZBGet.

IDK if this has anything to do with anything but Reddit told me to check the privileges via htop on Terminal and it looks like the user doesn’t have R/W access even though it does on Synology.

you are running htop on the synology?

It’s not related to this problem. HTOP is about processes not permissions

i’m starting to suspect you’ve had your containers write linux file permissions incorrectly. In doing so, they’ve broken the Synology ACL mechanism

How good are you at the command line?

Also, which user does Sonarr/Radarr and NZBget run as?

I wouldn’t say I"m good at the command like, I runner Sonarr/Radarr and NZBGet via Docker, but I can modify the containers. Any suggestions?

It’s fortunate you use Synology. They have, by far, the best Docker UI. It’s the only one which allows changing configuration after the container is created. (changing the config after creation is trivial because those settings are all applied/used when the container starts. I wish every vendor did this.)

  1. The PUID should be your Syno UID
  2. The PGID should be 100 (users group)
  3. Directory permissions (in your apps’ settings) 755.
  4. File permissions (in your apps’ settings) 644.

The above does the following:

  1. Your username is the owner of all files which allows the Syno GUI to work
  2. The users group allows basic file access permission for any process which can access the share (Control Panel - Shared Folders - Permissions tab)
  3. Directories and Files are given permissions such that your PUID/ UID is owner and full permissions (the Syno Permissions UI works)
  4. User plex can read the files, but not modify them, if you grant access to the shared folder the files reside in.

To fix this is going to take some work.

  1. Install Putty on Windows (or use ssh) on Linux / Mac
  2. Control Panel - Terminal & SNMP - Enable SSH
  3. Enable and assign a password to user admin (using this temporarily)
  4. Putty / ssh to the IP of the syno using user admin and sign in.
  5. You will see the prompt. (looks like this)
[chuck@lizum ~.362]$ gom
admin@moesern's password: 
admin@moesern:~$ 

Now to elevate your privilege level to root (the super user)
Use your administrator (master account) password. This is the account you first assigned when installing and should be the one for your username.

admin@moesern:~$ sudo -su root
Password: 
sh-4.3#

Now to fix the permissions.

  1. Assuming the media files are in /volume1/movies and /volume2/tv,
  2. The command sequence is as I show below.
  3. Use whichever names you’ve used. You may list more or few directory names on the command lines. Simply edit my example to match what you have
find /volume1/movies /volume2/tv -type d -exec chmod 755 {} \;
find /volume1/movies /volume2/tv -type f -exec chmod 644 {} \;
chown -R chuck:users /volume1/movies /volume2/tv 

What the above 3 command do is:

  1. Changes all existing directory permissions to grant the owner RW permission
  2. Changes all existing file permissions to grant the owner RW permission
  3. Changes all existing files & directories to be owned by chuck who is in the users group

Now your Syno username will have proper control again in FileStation.

The last piece of info you will need for your Docker configuration is the UID to use.

sh-4.3# grep chuck /etc/passwd
chuck:x:1026:100::/var/services/homes/chuck:/bin/sh
sh-4.3#

I am user 1026, in group 100 (users)

2 Likes

Thank you! So once I’ve done all the terminal commands, make sure I’m using 1026 and 100 in all my docker containers or could my numbers be different…?

NO!

I’m sorry I did things out of order.

  1. Go get your Synology username’s UID (the grep command at the end of my post)
  2. Next make the PUID change to match that UID. - which is where the change is documented.
  3. Before running anything, complete the permissions repair for all files.

I’ve followed all of Chuck’s steps and so far I’ve tested with 6 movies and they’ve all worked! I think we may be in business. :slight_smile: Thanks all!

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