Plex Requiring Permission Updates After Each Update To Auto-Detect Media

I understand completely but I haven’t placed anything in the Plex share or altered any of the permissions since applying the steps you had me go through yesterday.

I’m hoping to track down the root cause here, if you’re willing to assist.

In one of your earlier screenshots, you show the user = 1027.
That is the typical User ID number Plex gets on a new Synology because:

1-1024 are reserved (Linux reserved - service usernames)
1025 = admin
1026 = Your Synology Username
1027 = Plex

Given it changed, it leaves me curious.
Did I miss something in the steps we did above or have a deficiency in the installation scripts.

10. Control panel - Shared Folders - Delete the (now empty) Plex share.
11. Restart the Synology
12. Install the Plex app again

When the reinstallation of the app was done, user plex (by name) should have appeared. We should never have seen 1027

Sorry for the delay. Just made it home. Here is the screenshot you requested as well as one more from the permissions tab of my user.

I’m willing to assist in any way that I can.

Will send as many logs and screenshots as it takes.

Just tell me what to do.

Thanks.

I’ve been looking at the package installation script.

I think I’ve figured out how this can happen and, even better, how to remedy the problem during package installation as I should.

If I have a package to test, would you be willing to assist?

Of course. I’ll try anything.

I do have this change already approved and being released.
It does a better job of re-establishing ownership for user plex

sh-4.3# pwd
/volume1/Plex
sh-4.3# echo $PLEX_LIBRARY_PATH
/volume1/Plex
sh-4.3# ls -la
total 32
d---------+  6 root  root  4096 Apr 13 14:59 .
drwxr-xr-x  16 root  root  4096 Apr 16 14:33 ..
----------+  1 root  root     0 Apr 13 15:00 1
-rwx------+  1 plex  users    0 Apr 13 15:00 Bitte legen Sie hier keine Mediendateien ab.
drwxrwxrwx+  3 plex  users 4096 Apr  9 09:48 @eaDir
drwx------+  3 chuck  1026 4096 Apr  9 16:39 Library
drwx------+  3 plex  users 4096 Apr  9 09:48 Library.save
-rwx------+  1 plex  users    0 Apr 13 15:00 Please do not place any media files here.
-rwx------+  1 plex  users    0 Apr 13 15:00 Por favor, no coloque ningún archivo multimedia aquí.
----------+  1 root  root  1259 Apr 13 14:12 test
drwx------+  2 chuck  1026 4096 Apr 21 09:04 tmp_transcoding
-rwx------+  1 plex  users    0 Apr 13 15:00 Veuillez ne placer aucun fichier multimédia ici.
-rwx------+  1 plex  users    0 Apr 13 15:00 ここにメディアファイルを置かないでください。
-rwx------+  1 plex  users    0 Apr 13 15:00 请不要在此处放置任何媒体文件。
sh-4.3# # Are Ownership corrections needed?  ( We will do this normally when first creating the share. )
sh-4.3# FixOwner=0;
sh-4.3# 
sh-4.3# # If plex:users is not the current owner of Library,  make it so
sh-4.3# [ -d $PLEX_LIBRARY_PATH/Library ]         && [ "$(stat -c %U $PLEX_LIBRARY_PATH/Library)" != "plex"  ] && FixOwner=1
sh-4.3# [ -d $PLEX_LIBRARY_PATH/Library ]         && [ "$(stat -c %G $PLEX_LIBRARY_PATH/Library)" != "users" ] && FixOwner=1
sh-4.3# 
sh-4.3# [ -d $PLEX_LIBRARY_PATH/tmp_transcoding ] && [ "$(stat -c %U $PLEX_LIBRARY_PATH/tmp_transcoding)" != "plex"  ] && FixOwner=1
sh-4.3# [ -d $PLEX_LIBRARY_PATH/tmp_transcoding ] && [ "$(stat -c %G $PLEX_LIBRARY_PATH/tmp_transcoding)" != "users" ] && FixOwner=1
sh-4.3# 
sh-4.3# # Do we need set owner & group?
sh-4.3# if [ $FixOwner -eq 1 ]; then
>   chown -R plex:users $PLEX_LIBRARY_PATH/tmp_transcoding $PLEX_LIBRARY_PATH/Library &
> fi
[1] 13487
sh-4.3# ls -la
total 32
d---------+  6 root root  4096 Apr 13 14:59 .
drwxr-xr-x  16 root root  4096 Apr 16 14:33 ..
----------+  1 root root     0 Apr 13 15:00 1
-rwx------+  1 plex users    0 Apr 13 15:00 Bitte legen Sie hier keine Mediendateien ab.
drwxrwxrwx+  3 plex users 4096 Apr  9 09:48 @eaDir
drwx------+  3 plex users 4096 Apr  9 16:39 Library
drwx------+  3 plex users 4096 Apr  9 09:48 Library.save
-rwx------+  1 plex users    0 Apr 13 15:00 Please do not place any media files here.
-rwx------+  1 plex users    0 Apr 13 15:00 Por favor, no coloque ningún archivo multimedia aquí.
----------+  1 root root  1259 Apr 13 14:12 test
drwx------+  2 plex users 4096 Apr 21 09:04 tmp_transcoding
-rwx------+  1 plex users    0 Apr 13 15:00 Veuillez ne placer aucun fichier multimédia ici.
-rwx------+  1 plex users    0 Apr 13 15:00 ここにメディアファイルを置かないでください。
-rwx------+  1 plex users    0 Apr 13 15:00 请不要在此处放置任何媒体文件。
[1]+  Done                    chown -R plex:users $PLEX_LIBRARY_PATH/tmp_transcoding $PLEX_LIBRARY_PATH/Library
sh-4.3#

This should be all that’s needed for your situation.

The next change I have till address an oversight on my part – much more minor.

So I don’t have to do anything except for wait until the next update and see if it works?

Pretty much :slight_smile:

Do you see what I’m doing there?

  1. Set a flag which says “No changes”
  2. Check if Library needs the username fixed. If so, set the flag
  3. Check if Library needs the group name fixed. If so, set the flag
  4. Do the same two checks for the tmp_transcoding directory.
  5. Now, if the flag is set, tell linux to start making the fixes.

Yes I totally see it now that you’ve dumbed it down for me.

Hopefully this works. Fingers crossed

With this change, plus the one I’m working on now, there shouldn’t be a way for the Plex share to escape being properly reset by re-installing the package.

1 Like

Hello again? Any idea when the update will get pushed out?

The changes I shared the other day were reviewed over the weekend.
As sometimes happens, the review brought up a point I didn’t consider.
I took the advice and updated to include the recommendation.

At this point, I’m waiting final approval for the final.

This is the final form:

# Set the ACLs to standard
synoacltool -del $PLEX_LIBRARY_PATH
synoacltool -add $PLEX_LIBRARY_PATH group:administrators:allow:rwxpdDaARWc--:fd--
synoacltool -add $PLEX_LIBRARY_PATH user:admin:allow:rwxpdDaARWc:fd--
synoacltool -add $PLEX_LIBRARY_PATH user:plex:allow:rwxpdDaARWcCo:fd--

# Verify the Plex share is visible from File Station for those with access permission
synoshare --setbrowse Plex 1

# Create temp transcoding and "Plex Media Server" directories if required
if [ ! -d $PLEX_LIBRARY_PATH/tmp_transcoding ]; then
  mkdir   $PLEX_LIBRARY_PATH/tmp_transcoding
fi

if [ ! -d  "$PLEX_LIBRARY_PATH/Library/Application Support/Plex Media Server" ]; then
  mkdir -p "$PLEX_LIBRARY_PATH/Library/Application Support/Plex Media Server"
fi

# Are Ownership corrections needed?  ( We will do this normally when first creating the share. )
FixOwner=0;

# If plex:users is not the current owner of Library,  make it so
[ -d $PLEX_LIBRARY_PATH/Library ]         && [ "$(stat -c %U $PLEX_LIBRARY_PATH/Library)" != "plex"  ] && FixOwner=1
[ -d $PLEX_LIBRARY_PATH/Library ]         && [ "$(stat -c %G $PLEX_LIBRARY_PATH/Library)" != "users" ] && FixOwner=1

[ -d $PLEX_LIBRARY_PATH/tmp_transcoding ] && [ "$(stat -c %U $PLEX_LIBRARY_PATH/tmp_transcoding)" != "plex"  ] && FixOwner=1
[ -d $PLEX_LIBRARY_PATH/tmp_transcoding ] && [ "$(stat -c %G $PLEX_LIBRARY_PATH/tmp_transcoding)" != "users" ] && FixOwner=1

# Do we need set owner & group?
if [ $FixOwner -eq 1 ]; then

  # Fix tmp_transcoding, Preferences.xml and Plug-in Support first
  chown -R plex:users $PLEX_LIBRARY_PATH/tmp_transcoding
  chown plex:users "$PLEX_LIBRARY_PATH/Library/Application Support/Plex Media Server/Preferences.xml"
  chown -R plex:users "$PLEX_LIBRARY_PATH/Library/Application Support/Plex Media Server/Plug-in Support"

  # Now launch the blanket fix-everything
  chown -R plex:users $PLEX_LIBRARY_PATH/Library &

  # Give the chown time to execute before starting. (minimize false errors for large libraries)
  sleep 3
fi

While I wait for the new update to get pushed out I’ve been monitoring what’s been going on when I add new media and at this point all movies are being picked up by the auto-scanner but none of the tv shows are. Not sure if that means anything. Just thought I’d mention it.

I can now update that these updates will be in PMS 1.19.4.
There was a minor change to make starting PMS on a completely restored Plex share work more smoothly (fewer erroneous errors being printed to the logs)

I worked with Engineering today to merge then into the production build stream.

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