Automatic/Partial Scanning has stopped

Server Version#: 1.21.3.4021
Player Version#: Web 4.51.1

It appears that in the last ~1 week my Plex server has lost the ability to automatic scan folder as I change them.
The largest thing that I did recently was migrate Volumes on Synology. I added Volume 2 and made it my main volume. To move the App install locations, I followed the instructions here:
https://veducate.co.uk/synology-moving-a-package-between-volumes/

So Plex now lives on Volume 2 with all apps, and the media is on that same volume in its own folder. Around this time, (though I am not sure if immediately following) it appears that PMS server lost the ability to automatic scan. Manual scanning works fine and it is able to record/add manually/do pretty much everything else ok.

I was thinking maybe a whole refresh of PMS would fix the issue, so I deleted the entire Plex Share/user/everything from plex and reinstalled again on Volume 2, but the same result after letting it rebuild libraries overnight. I find this particularly annoying as a I have a separate script that runs on another computer and converts automatically with handbrake the recorded media from MPEG to MKV.

I was not able to find anything on the forums about PMS having an error with automatic scanning on the most recent versions so it leads me to believe it was something that I did.

Has anyone run into a similar synology issue before, and if so what did you do to solve?

@A_Bot

How many folders are being used to store the media (inclusive of all subfolders) ?

Linux has a default limit of 8192.
If you exceed this, PMS won’t be able to automatically detect changes.

It’s easy to increase the number of folders PMS can monitor on Synology.

Please read here and see if this applies to you.

Good point, I had seen that number crop up before but forgot to look before posting.
I did test and it appears I am under the limit:
image

I should do some cleanup there anyways as I don’t think I should have that many folders, but I don’t think it’s hitting that 8192 directory limit yet.

May I ask where you got that number?

Synology is normally displayed on a white background and a text-based ā€œfind | wcā€ command doesn’t print in such verbose text. That also looks like a windows ā€œDirā€ command ?

Correct, that was using a dir /w /s command from a windows computer that has access to the media folder.
I just ran, the find | wc command on the same folder just through SSH on the Synology box and it showed a different result:
image

I also just checked the Synology properties itself and it only shows 1770 folder for the same media folder.

Looking in the Plex share – not appropriate unless you put media there (which you shouldn’t do) – but if you did, add the specific media-containing folders to the list below.

let’s now qualify that find command and get an accurate result since you’re ok with using the SSH command line (some aren’t)

If you use /volume1/media and /volume2/media for all your media files,

then

find /volume1/media /volume2/media -type d -print | wc -l

You can add as many directories as you want before the -type command.

Use that number and follow the rest of the procedure as I’ve shown in the How-To

Got it, I think I misled you in my previous answer. Wasn’t using the Plex share for media storage, just a separate shared folder where all media is (in two folders: Movies, TV Shows) that is an SMB share that windows can see.
In any case, I ran the find command as you showed above through SSH on that same top level folder where all media is stored and got the result of 7576. This was higher than I expected, so I went through some folders and did a little tidying and ended up with 7314.
image

I am still not 100% sure that the folder limit is the problem here, but I will do the how-to in any case since clearly I will be nearing that limit soon.

One thing that will trip you up (it did me until I beat the heck out of it and proved it)…

  • Server (share) side network share changes are not reflected through the notify.

On Linux, if the local file system changes, the kernel sees it and reacts.
However, if those changes are made on a remote host, independent of THIS kernel, it will not know it changed.

Is everything on the Synology or is there data elsewhere off-Syno?

Regarding those two directories you show.

7576 + 7314 = 14890 which is greater than 8192.

Am i reading this correct? You have Plex indexing media in both shared folders?

If I am correct, then I suggest you set the user_watches to 32768 to allow room for growth. 32K worth of notify slots = a little over 16 MB. The default is 4 MB of memory so it’s not a big increase.

All the media is located on the Synology:
image

So I believe any changes I make to these two folders via Windows through SMB will be reflected on the Synology filesystem and therefore plex (and indeed this is how I’ve had the media conversion script working since like 2018).

Regarding those two numbers I sent, they were both on the same XXXXXX-Media folder that I sent here, so are not added. (Sorry for being confusing) I ran the find command once before and once after deleting some empty folders with the the -Media subfolders. So the result of the find command on the XXXXXX-Media folder and all subfolders is 7314.
image

I am going to try the How-To now in any case and will report back.

EDIT:
Tried the increase, rebooted synology and moved some items around. No change.
I did want to add that this new volume is btrfs whereas the old one that I moved the files from ext4. Based on a quick google that shouldn’t cause any problems for plex.

Updated today to Version 1.21.3.4046.
Afterwards, I added a new piece of media and Plex was able to recognize, scan and add the media to the library. Good news!
However, I attempted to move an episode of a show out of the scanned media folders, and that did not trigger an automatic scan which is something that it used to do.
I did make sure that automatically empty trash after each scan was enabled, but it just seems like files being removed is not triggering a scan.

If you moved out one file,
and have ā€œPartialā€ enabled,
the scan is usually so quick that Plex/web doesn’t have time to react.

I’ve seen it do that to me in a lot of cases. Dropping media is a quick operation.
Adding media is what takes a bit of time (the analysis)

Could that be what’s happening here?

I’m not sure I understand what you mean.
It seems to react in that when I click on the tv episode/movie it is listed as ā€œunavailableā€ and will not play, but the normal action of removing it from the library does not appear to happen. If I put the file back, plex is again perfectly happy.

However, after some additional testing, I’ve noticed that this is only happening for certain media. Some shows if I delete an episode, plex sees this, partial scans folder, and empties trash. Not for others though.

ā€œUnavailableā€ means the top level is inaccessible.

Think of having media on a USB drive.
If the USB gets unplugged, should all the references to the media be deleted?
– No , it shouldn’t.

Plex handles this case by saying ā€œUnavailableā€.

Knowing this is how it behaves. Somewhere from the very top-most folder – traveling down to the media, Plex can’t advance.

On Synology, a few things can happen:

  1. User Plex doesn’t have permission to the share / top-most path
  2. This doesn’t matter if internal or external USB.

It has to be a permissions problem.

I will ask Trumpy81 to help out . He solves these easily.

Thank you both again for you help so far.
@trumpy81 I followed your steps as listed above (twice actually for fear I did it wrong the first time).
However, I am still seeing the sort of half removal I talked about before.
For example:
The Great North, a Fox broadcast show I recorded from Plex DVR (and subsequently converted to MKV).
If we look in the Synology File Station, I have moved S01E03 away someplace else that Plex can’t see.

Plex saw that this happened but all it did was display the show still in the library with the UNAVAILABLE instead of the play button.

From past experience, if I were to scan the library manually this would remove itself, but it’s been ~45 minutes since I removed it and it still shows in this state after several plex player refreshes.

May I have the DEBUG logs ZIP file please?

  1. Scan files
  2. Empty Trash
  3. Clean Bundles
  4. Scan Files again
  5. when all are finished
  6. Download logs ZIP file
  7. Attach please.

Done and attached.
Thanks!

Plex Media Server Logs_2021-02-23_21-04-08.zip (3.3 MB)

Thanks for the logs.

I found a few things:

  1. You have two adapters on the same network.
  2. PMS will get confused because Synology uses them interchangably .
  3. Best results is to go into Settings - Server - Network - Show Advanced
  4. Select which adapter (192.168.1.168, or 192.168.1.169) you want as the Preferred adapter for PMS

Next:

  1. Permission denied errors . User Plex doesn’t have access to the media. Specifically looks like Synology dropped permission for user Plex on the /volume2/Reekris-Media shared folder. (it does this often in DSM 6)
Feb 23, 2021 16:01:55.273 [0x7f706c4ee700] DEBUG - HTTP 200 response from GET https://plex.tv/api/v2/release_channels?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx
Feb 23, 2021 16:01:55.274 [0x7f706c4ee700] DEBUG - Running database fix-ups.
Feb 23, 2021 16:01:55.275 [0x7f706c4ee700] DEBUG - Database Fixups: Destroyed 0 transient items.
Feb 23, 2021 16:01:55.281 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Zootopia (2016) [1080p] [YTS.AG]" (13: Permission denied)
Feb 23, 2021 16:01:55.288 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Requiem For A Dream" (13: Permission denied)
Feb 23, 2021 16:01:55.288 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Next Day Air" (13: Permission denied)
Feb 23, 2021 16:01:55.318 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/The Last Samurai" (13: Permission denied)
Feb 23, 2021 16:01:55.343 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/McFarland, USA (2015) [1080p]" (13: Permission denied)
Feb 23, 2021 16:01:55.343 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/The Wild and Wonderful Whites of West Virginia" (13: Permission denied)
Feb 23, 2021 16:01:55.343 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/The Lord of the Rings The Return of the King (2003) [2160p] [HDR] (bluray) [WMAN-LorD]" (13: Permission denied)
Feb 23, 2021 16:01:55.350 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Iron Man 2" (13: Permission denied)
Feb 23, 2021 16:01:55.356 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Despicable Me 3 (2017) [1080p] [YTS.AG]" (13: Permission denied)
Feb 23, 2021 16:01:55.356 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Pineapple Express" (13: Permission denied)
Feb 23, 2021 16:01:55.356 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Life of Pi (2012) [1080p]" (13: Permission denied)
Feb 23, 2021 16:01:55.356 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Despicable Me 2 (2013) [1080p]" (13: Permission denied)
Feb 23, 2021 16:01:55.356 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Rain Man" (13: Permission denied)
Feb 23, 2021 16:01:55.356 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Invictus" (13: Permission denied)
Feb 23, 2021 16:01:55.357 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Bad Words (2013) [1080p]" (13: Permission denied)
Feb 23, 2021 16:01:55.357 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Red Cliff" (13: Permission denied)
Feb 23, 2021 16:01:55.357 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Till We Meet Again (2016) [1080p] [YTS.AG]" (13: Permission denied)
Feb 23, 2021 16:01:55.364 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/The Martian 2015 1080p WEB-DL x264 AC3-JYK" (13: Permission denied)
Feb 23, 2021 16:01:55.364 [0x7f706f12f700] ERROR - [Notify] Failed to add watch for "/volume2/Reekris-Media/Movies/Under An Arctic Sky (2017) [WEBRip] [1080p] [YTS.AM]" (13: Permission denied)
Feb 23, 2021 16:01:55.368 [0x7f706c4ee700] DEBUG - Collections: Found 0 collections tags in section 1.

Once that happens , there is a bunch of secondary errors. I suggest taking care of this first.

  1. Restart PMS
  2. Rescan files, etc.
  3. Retest .

Is there more to test for permission that what was listed above?

  • I went through Control Panel and gave Plex RW to Reekris-Media
    image
    image
  • Then I also checked in the File Station at the top level to make sure Plex had RW, clicked Apply to All Subfolder and Files, hit OK
  • Reboot
  • Wait
  • Scanned Media

Feb 23, 2021 22:43:14.333 [0x7fe099a3b700] DEBUG - LibraryUpdateManager will start watching /volume2/Reekris-Media/Movies
Feb 23, 2021 22:43:14.333 [0x7fe099a3b700] DEBUG - LibraryUpdateManager will start watching /volume2/Reekris-Media/Shows
Feb 23, 2021 22:43:14.333 [0x7fe099a3b700] DEBUG - [Notify] Initializing.
Feb 23, 2021 22:43:14.333 [0x7fe099a3b700] DEBUG - Done waiting for all plug-ins to start.
Feb 23, 2021 22:43:14.333 [0x7fe099a3b700] DEBUG - PluginRepository::setStartState: 3, complete
Feb 23, 2021 22:43:14.333 [0x7fe07fd11700] ERROR - [Notify] Failed to add watch for ā€œ/volume2/Reekris-Media/Moviesā€ (13: Permission denied)
Feb 23, 2021 22:43:14.334 [0x7fe07dfc5700] DEBUG - [Notify] Waiting for inotify notifications…

Is there some deeper level of permission that I’ve broken when migrating synology volumes?

So just for fun, I created an additional test Share Folder from scratch on Volume2.
image
Owned by the account I use, and Plex RW permissions.
image

Made a folder called Shows2, dumped a few shows in there, and added it to the TV library in Plex.
image

Works perfectly. Anything I add/move/delete is instantly recognized and treated appropriately including emptying trash.

EDIT: I suppose barring anything else its not the end of the world to make ā€œTest-Mediaā€ the new plex folder and just fire the old one into the sun.