Server is not working properly after update on raspian pi 4 - cannot play files

Server Version#: 4.30.2
Player Version#: any

I downloaded the deb packeage and installed it.
after that server was not starting because of:
Read/write access is required for path: /var/lib/plexmediaserver/
so I chmod it to 777 (yes it´s bad!)

server runs now but I cannot play any videos on any player.
in the browser it says:

  • /media/pi/wd1TB/Visuals/particles-rotation-yellow-red-002.mp4 not available

what now?

I found it is running as plex so I chmod everything to plex:plex except for the media folder, which is pi:pi but with read/write access to anybody. It was working like this for months!
SO, STILL NOT WORKING.
It seems, that sudo -u plex cat /media/pi/wd1TB/ any file does not work. But why? It worked before the update!

Does the plex user have execute permissions for all the folders in the media folder? If not, it cannot list files inside the folders. It could read the files, it just has no way of knowing which files are in the folder.

Could you post the output of stat /media/pi/wd1TB/ and a few lines from ls -l /media/pi/wd1TB/? That will tell us exactly what your permissions look like.

The folders cannot even be read by plex. When I go to add a new mediafolder it only shows wd1TB with no content.
But why did this work before the update?

stat /media/pi/wd1TB/
  File: /media/pi/wd1TB/
  Size: 131072    	Blocks: 256        IO Block: 4096   directory
Device: 802h/2050d	Inode: 1           Links: 1
Access: (0777/drwxrwxrwx)  Uid: ( 1000/      pi)   Gid: ( 1000/      pi)
Access: 1970-01-01 01:00:00.000000000 +0100
Modify: 1970-01-01 01:00:00.000000000 +0100
Change: 1970-01-01 01:00:00.000000000 +0100
 Birth: -
ls -l /media/pi/wd1TB/
total 896
drwxrwxrwx 1 pi pi 131072 Jun 25 23:12 Documentary
drwxrwxrwx 1 pi pi 131072 Apr 28 05:40 _download
drwxrwxrwx 1 pi pi 131072 Apr 5 09:21 Movies
drwxrwxrwx 1 pi pi 131072 Jun 22 21:18 Music
drwxrwxrwx 1 pi pi 131072 Apr 29 16:13 _neu
drwxrwxrwx 1 pi pi 131072 Apr 23 02:47 Serie
drwxrwxrwx 1 pi pi 131072 Apr 5 01:21 Visuals

Alright, that looks good so far. Just to be sure the permissions are not messed up somewhere down the directory tree, run the following commands:

find /media/pi/wd1TB/ -type f -exec chmod 664 {} \;
find /media/pi/wd1TB/ -type d -exec chmod 775 {} \;

That will set all files and folders to a known state (permission-wise) and these permissions should work for Plex.

And just to be sure: You can play the media files with the pi user, correct?

Still get error in the log:
Jul 16, 2020 00:26:58.070 [0xa7af4450] ERROR - Couldn't check for the existence of file "/media/pi/wd1TB/Documentary/Zotter - Viva el Cacao (12 Min. English).mp4": boost::filesystem::status: Permission denied: "/media/pi/wd1TB/Documentary/Zotter - Viva el Cacao (12 Min. English).mp4"
I can open all files with vlc and with text editor as user pi.
Is there a way to go back to the old version of plex?

Also I might have made a mistake: I found out, that I installed plex via CLI apt-get but I did the upgrade via the link which is shown in the browser. So I clicked it and ran the deb package. Was this wrong?

I now changed the the user and group to pi in the file:
/lib/systemd/system/plexmediaserver.service
all other attempts with PLEX_USER in setting files failed.
So I hope this will not break after the next update.
(where can I turn off the update reminder?)

Not sure if this solves your issue, but I was just having the same issue on a brand new install on a Raspberry Pi 4 with mounted external drives.

After setting up a Library I noticed that nothing was being imported (I should have been tipped off as I was trying to select the folder nothing was showing up in the UI). In the logs ("/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log") I kept seeing the following line:

Aug 15, 2020 14:56:57.364 [0x9d2f6440] ERROR - Couldn't check for the existence of file "/media/pi/gemini1/Media/TV Shows/.grab": boost::filesystem::status: Permission denied: "/media/pi/gemini1/Media/TV Shows/.grab"

This confused me because I had made sure to set permission so that the world could read and execute (I even tried read, write, and execute) on the folder:

pi $ ls -l /media/pi/gemini1/Media/
drwxr-xr-x 7 pi pi 4096 Aug 15 13:14 'TV Shows'

I didn’t believe that this was file system issue until I ran:

pi $ sudo -u plex ls -l /media/pi/gemini1/Media/TV\ Shows/
ls: cannot access '/media/pi/gemini1/Media/TV Shows/': Permission denied

Eventually, I tracked it down to the ‘+’ in the permission of one of the parent folders:

pi $ ls -l /media
total 4
drwxr-x---+ 5 root root 4096 Aug 15 13:39 pi

I have seen the ‘+’ before but have always dismissed it. Turns out that it’s letting you know that there are ACLs on this directory (and it’s sub-directories).

Sure enough:

pi $ getfacl pi
# file: pi
# owner: root
# group: root
user::rwx
user:pi:r-x
group::---
mask::r-x
other::---

Not sure if this was overkill, but I’d been at this for way longer than I cared for, I ran:

pi $ sudo setfacl -m plex:7 pi
pi $ getfacl pi
# file: pi
# owner: root
# group: root
user::rwx
user:plex:rwx
user:pi:r-x
group::---
mask::r-x
other::---

Went back to the UI and clicked ‘Scan Library Files’ and it worked - files started showing up.

Hope this helps others.

FYI: If you don’t have getfacl, setfacl, and tune2fs run the following:

sudo apt-get install nfs4-acl-tools acl

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