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.
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.
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.
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"