Plex stopped automatically recognizing new files

Server Version#: 1.20.3.3421
Player Version#: 4.44.1 (but doesn’t matter in this case)

Here is my story.

I’m using a Synology DS1019+ on which my Plex server runs. The folder in which all my media files are stored was encrypted but I decided to no longer have it encrypted. So I stopped the Plex server, deencrypted the folder, checked the user permissions for the Plex user and then started the Plex server again. Everything worked fine again but although I didn’t change any settings the server does no longer recognize new files I put in one of the folders of my media libraries.
In the settings under “Library” the three checkboxes for “Scan my library automatically”, “Run a partial scan when changes are detected” and “Include music libraries in automatic updates” are checked. I tried to uncheck them and then check them again. But still the server no longer recognizes new files I add to my libraries.
If I go to the library and click on “Scan Library Files” the server starts to search for new files and finds them. It just won’t work automatically anymore and I don’t know why.

Can anybody help me please? Any logs I can provide? This is really annoying.

Edit:
Reinstalling the Plex server didn’t work. Also if I remove a file from one of my libraries the Plex server won’t recognize the change unless I make it scan the library files again manually.

You may be running into the inotify watch limit, especially if you have it enabled for music libraries. Try unchecking “Include music libraries in automatic updates” and see if that helps.

Also if you can provide logs it makes things a lot easier to help diagnose problems (Server -> Troubleshooting -> Download Logs).

Thanks for the reply.

Sadly unchecking “Include music libraries in automatic updates” didn’t help.

Here are the logs:
Plex Media Server Logs_2020-10-12_19-39-17.zip (1004.7 KB)

Your logs are filled with these errors:

Oct 12, 2020 18:14:12.748 [0x7f69611d7700] ERROR - [Notify] Failed to add watch for "/volume1/Medien/Anime Serien" (13: Permission denied)

Doesn’t look like Plex has the correct permissions to your media directories.

The Plex user had just read permissions before. I just gave it read/write permissions but it still doesn’t help. :frowning: And like I said it recognizes newly added files if I make Plex scan manually.

See FAQ #16. It covers how to check if you need to increase the number of folders Plex can monitor.

Oof, this is some technical stuff. Gotta look into this when I have the time.

Okay, this sadly didn’t help either. I just have 444 folders in my Plex library anyway which isn’t so much I think. Thank you anyway. :slight_smile:

Try resetting the file/folder permissions for your media folders. This is different than just adding RW. It removes, then restores RO or RW permissions. Apparently Synology can sometimes lose track of permissions. This resets things completely.

You might want to first disable Scan automatically, Scan when changes detected, and scan periodically in Settings → Library. This would keep Plex from starting a library scan when it had no read permissions, which would remove existing listings from your libraries. The window for that to happen is small. Just me being paranoid. Alternately, you could also shutdown PMS, then restart it after resetting permissions.

See this post for steps:
https://forums.plex.tv/t/4k-buffering-on-synology-218/632606/6

If I may augment here?

If doing this manually at the Linux command line level (unadvised on Synology),

  1. Folder (Directory) permissions must include the ‘execute’ bit. Reading the directory does not allow operating on anything in or below it because one cannot traverse (execute through) it.
  2. Best directory permissions are Owner- RWX, Group (R-X), Others (R-X) == 755
  3. Subsequently, Best file permissons are Owner RW, Group R, Other R == 644

after exiting this popup,

Be certain to check the box underneath: “Apply to this folder, sub-folders, and files” before clicking OK

I disabled “Scan my library automatically” and “Run a partial scan when changes are detected”, stopped PMS, removed any permissions given to the Plex user on my media share, gave the user full permission (even administration permissions) to the share and its subfolders, startet PMS and enabled both options again. Still the problem persists. Something is seriously broken here…

Edit:
Gotta repeat what I said earlier: The PMS CAN find and analyse newly added files even with just read permissions. It just doesn’t do it automatically anymore. I have to trigger it manually… So I don’t think the user permissions are the problem here.

  1. Have you customized max_user_watches value (per the Syno FAQ) ?
  2. How many directories do you have to be monitored if automatic were enabled?

“1. Have you customized max_user_watches value (per the Syno FAQ) ?”
Yes, this was my answer: Plex stopped automatically recognizing new files - #8 by Vcxy
That didn’t work.

“2. How many directories do you have to be monitored if automatic were enabled?”
Currently 444 folders as mentioned in the same post in the linked comment.

Restoring a BTRFS Snapshot of the shared folder “Plex” from when everything worked fine didn’t help either. Also it does not automatically detect new files in a new library I just created.
Isn’t there something else suspicious in the logs I uploaded here? Plex stopped automatically recognizing new files - #3 by Vcxy

Edit:
I just found this thread. maybe BTRFS is the problem here?

Looks like not even the staff knows how to help…

FWIW, I run PMS on a DS918+ w/ BTRFS. No problems with Plex automatically recognizing new files.

Do you use encrypted folders? When I used them encrypted everything worked fine.
I assumed it had something to do with that because the NAS had to de- and encrypt the files when I moved them from a shared folder to another shared folder. That makes the file system tell PMS that there is a change in the file and folder structure. Because now that my folders are no longer encrypted, BTRFS just changes the inodes of the files to point them where they are but does not move the file itself because they are on the same RAID and volume.
It’s just a theory though. I hope we can find a solution.

I do not.

So the theory is if you copy or move a file from a formerly encrypted folder to a different location, Plex will not automatically recognize it, due to the way BTRFS handles inodes?

That is well beyond my general user-level knowledge of BTRFS.

You could possibly test it by pointing a Plex library at a shared folder that had never been encrypted. Make sure the user Plex has necessary permissions to the folder.

Then move two or three movies from the NAS to your PC and delete them from the NAS & empty the NAS trash.

Copy the movies one at a time from your PC to the new Plex library. See if Plex auto-recognizes the files.

If it does not, then pull the log files. See if they contain the same “Failed to add watch” error message as before.

That was worth a try, but sadly didn’t do the trick…

I created a new shared folder (unencrypted), gave the Plex user read only permissions and made it a media library in PMS. After that I downloaded a random video file and moved it there but PMS didn’t do anything until I triggered the library scan manually. :frowning:

I just found out something interesting what wasn’t the case when my media shared folder was still encrypted:

The automatic scan works if the media library is the root of the shared folder of my NAS. This means the following example would work fine being a media library:
/volume1/Movies/

But if I make a sub folder of a shared folder a media library it does NOT work. For example:
/volume1/Media/Movies/

This means for every Plex media library I’d have to make an individual shared folder. I don’t know why this worked when my shared folders were still encrypted but now that they are no longer encrypted this problem occurs.

Maybe that’s a good hint for any developer here… in case any developer is still looking into this issue. But since I haven’t heard anything from them in days I think they will ignore it.

1 Like