Plex DVR EPG DBs are created without write permissions breaking the Plex DVR (FreeBSD)

Server Version#: 1.21.3.4021
Player Version#: N/A

Discovered in

When the Plex Media Server starts, even if the DB has the proper perms and ownership, the “-loading” DB is deleted and recreated with a new one with unix perms “r-xr-xr-x”, preventing the media server from writing to it. When the original EPG DB is removed, it to is recreated with bad permissions as well.

This creates multiple consequences. The Plex DVR cannot be deleted, any attempt to add, modify, or remove DVRs will cause PMS to start hanging in places, even possibly bringing down Remote Access in cases.

The solution is quite simple. Make sure Plex is setting “rwxrwx—” on the EPG DBs instead.

I will DM logs on request.

I don’t see this issue my side, the files are created with -rw-r--r-- maybe there’s a umask issue here?

No idea. I’m open to getting my hands dirty to help figure this out. But it’s a big problem and resetting Plex to a fresh state doesn’t work either. I tried.

I have confirmed the umask is 0022 for user plex

Maybe problem is with the database directory’s default ACLs? What’s the output of running getfacl . from within the Databases directory?

Here you go.

root@Plex:/Plex Media Server/Plug-in Support/Databases # getfacl .
# file: .
# owner: plex
# group: plex
            owner@:rwxp--aARWcCos:-------:allow
            group@:rwxp--a-R-c--s:-------:allow
         everyone@:------a-R-c--s:-------:allow

Actually the problem is a lot worse it seems. Plex is recreating any missing file with 0555. I ran a ktrace and see that Plex is sending 0555 masks to the FreeBSD OS, when opening file handles on FreeBSD. Opening yet another bug report.

What FreeBSD release are you running? If I get a chance I’d like to try to repro here.

The jail is running FreeBSD 12.2-RELEASE-p3 7851f4a452d(HEAD)

It looks like you got this sorted out in your other thread; but just to close the loop I did test on my FreeBSD 12.2 RELEASE VM here and did not see the issue. A kdump of the ktrace shows:

1049 Plex Media Server CALL  openat(AT_FDCWD,0x80c75c480,0xe01<O_WRONLY|O_CREAT|O_TRUNC|O_EXCL>,0100644<S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH|S_IFREG>)
1049 Plex Media Server NAMI  "/usr/local/plexdata-plexpass/Plex Media Server/Plug-in Support/Databases/tv.plex.providers.epg.cloud-3569b8fe-7360-4cbf-9294-e61fda996743.db"

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