Library Scan Issue

Over the last several versions when I add new movies and plex picks up on scan it seems the scan never stops. I’ve left if for days and it keeps spinning. Looking at the log today I see this which seems like it could be a problem.

Sep 10, 2018 16:02:32.973 ERROR LPE: unknown item 63650.
Sep 10, 2018 16:02:32.973 ERROR Versions: failed to generate query for path library://e28ea1b2-94bf-4fae-9116-8d0d6aa424b5/directory/%2Flibrary%2Fmetadata%2F63650%2Fchildren
Sep 10, 2018 16:02:32.973 WARN Versions: generator American Pickers - Season 2018 has an empty version set query, assuming generator is no longer valid
Sep 10, 2018 16:02:31.299 ERROR LPE: unknown item 63650.
Sep 10, 2018 16:02:31.299 ERROR Versions: failed to generate query for path library://e28ea1b2-94bf-4fae-9116-8d0d6aa424b5/directory/%2Flibrary%2Fmetadata%2F63650%2Fchildren

LPE usually comes from SYNC issues.

Make certain to scan all the files and verify the SYNC’d files are up to date. Delete those entries in the Sync list which are no longer needed.

LPE (Local Path Evaluator) is telling us the file is already gone (downloaded / sync’d)

Everything is managed from the web ui or client. What should I be looking for.

Now Playing -> Sync.

You’ll see what’s been sync’d to your devices.

I’ve deleted all synced content from all devices. Does the error mean something got corrupted?

What about the other part of my post where the library scan runs forever? Related?

Something probably did get corrupted in Sync.
Sync has been problematic and engineering is spending some serious effort on it right now.
That’s all I’m allowed to say about what they’re doing but from what I read, it looks good.

Scans running forever usually indicate media didn’t match -OR- you have ‘automatically detect changes’ and something is writing in one of the directories which PMS is monitoring. (most common cause)

I’ve never run into this constant scan issue until the last few updates. If there wasn’t a match it should give up not get hung. As for something accessing the directory plex is watching, doubtful. The file path on the nas is only used for plex. Would the logs narrow it down?

Logs will show nothing.

As verification of iNotify being triggered, Turn off automatic. Observe the behavior

This option is off. Antivirus off. File indexing off. Scan keeps restarting. It is now on a library that hasn’t had anything new in quite some time.

Then there must be something about the naming which it is not liking.

Please do the following.

  1. Verify DEBUG logging only
  2. Start the scan on that section
  3. Let it run 1-2 minutes (so you see it attempting to match)
  4. Grab the logs (Settings - Server - Help - Download Logs)
  5. Attach the ZIP.

I will look at what the agents are doing.

Plex Media Server Logs_2018-09-11_14-03-09.zip (1.8 MB)

It looks like the scan has stopped but I guess the question remains is why it keeps starting up when the option is turned off?

Got it.

Your database is fragmented all to heck. It keeps scanning because it never finished what it started.
It can’t add more because it can’t get that far.

expected )
Sep 11, 2018 10:55:10.654 [0x7ff7173ff700] WARN - PubSub: Received notifyConnectivity event with incorrect async identifier (e535d7e4-6872-440f-8493-d5263b2aeb97, expected )
Sep 11, 2018 10:55:17.387 [0x7ff700bf8700] WARN - SLOW QUERY: It took 410.000000 ms to retrieve 50 items.
Sep 11, 2018 10:55:22.701 [0x7ff700bf8700] WARN - SLOW QUERY: It took 450.000000 ms to retrieve 50 items.
Sep 11, 2018 10:55:23.116 [0x7ff700bf8700] WARN - SLOW QUERY: It took 340.000000 ms to retrieve 50 items.
Sep 11, 2018 10:55:23.748 [0x7ff700bf8700] WARN - SLOW QUERY: It took 470.000000 ms to retrieve 49 items.
Sep 11, 2018 10:55:24.094 [0x7ff700bf8700] WARN - SLOW QUERY: It took 410.000000 ms to retrieve 50 items.
Sep 11, 2018 10:55:24.392 [0x7ff700bf8700] WARN - SLOW QUERY: It took 9970.000000 ms to retrieve 34 items.
Sep 11, 2018 10:55:24.685 [0x7ff700bf8700] WARN - SLOW QUERY: It took 350.000000 ms to retrieve 42 items.
Sep 11, 2018 10:55:24.918 [0x7ff700bf8700] WARN - SLOW QUERY: It took 260.000000 ms to retrieve 8 items.
Sep 11, 2018 10:55:25.228 [0x7ff700bf8700] WARN - SLOW QUERY: It took 390.000000 ms to retrieve 38 items.
Sep 11, 2018 10:55:25.522 [0x7ff700bf8700] WARN - SLOW QUERY: It took 370.000000 ms to retrieve 33 items.
Sep 11, 2018 10:55:25.850 [0x7ff700bf8700] WARN - SLOW QUERY: It took 350.000000 ms to retrieve 41 items.
Sep 11, 2018 10:55:26.059 [0x7ff700bf8700] WARN - SLOW QUERY: It took 260.000000 ms to retrieve 50 items.
Sep 11, 2018 10:55:29.365 [0x7ff700bf8700] WARN - SLOW QUERY: It took 4630.000000 ms to retrieve 50 items.
Sep 11, 2018 10:55:29.878 [0x7ff700bf8700] WARN - SLOW QUERY: It took 720.000000 ms to retrieve 50 items.
Sep 11, 2018 10:55:41.035 [0x7ff70e7ff700] WARN - Held transaction for too long (../Library/MetadataItem.cpp:54

Hover over Libraries -> Expose the ellipsis -> Click it -> Optimize Database

After that completes, Settings - Server - Scheduled Tasks. Make sure database optimization is enabled.

That Atom CPU is not the fastest thing so you really have to keep on it for optimization.

It’s always been on and I typically do the manual optimize anytime I add a substantial amount of video or remove any. Is that all you see wrong? I should just let it ride itself out and it will be caught up?

There are other errors. I’m tracking them down now.

I believe I found the source but am not 100% certain.

Can you access the agent caches from the command line or graphical file manager?

If so,

  1. Stop PMS
  2. Under Plex Media Server / Plug-in Support
  3. You will see Caches
  4. Remove all you see in the Caches directory but not the directory itself.
  5. Restart PMS
  6. Force refresh all the metadata for the library section

OK I’ve delete caches and forced the first library.

Any updates on what else is going wrong with my libraries?

Brian,
Can I have the ZIP files please? With everything cleared and you haven’t forced a refresh, The agent logs should reflect truth.

What do you mean force refresh