Plex full scan daily and for hours

Plex server is scanning for new shows and films in a daily basis and for hours.

When I put new content, it doesn’t show up after many hours to the server. I guess it’s because it is scanning folder per folder, until it gets to the new content. It scans even if no new content is added.

I have seen this error after repairing the db, because it was corrupted.

Server Version#: 1.40.5.8897
Plex Media Server Logs_2024-08-27_20-51-28.zip (5.7 MB)

looking at the logs scans are taking a couple seconds to perform:

Aug 27, 2024 20:40:09.425 [22579547171640] DEBUG - Activity: updated activity dbc01336-8da9-405b-9efe-49cc3043739d - completed 0.0% - Scanning TV Shows
Aug 27, 2024 20:40:15.693 [22579547171640] DEBUG - Activity: updated activity dbc01336-8da9-405b-9efe-49cc3043739d - completed 100.0% - Scanning TV Shows

If you Scan Library Files after adding something does it show up immediately?

It has always showed up immediately as Scan my library automatically is checked, as Run a partial scan when changes are detected is.

But now, as it is scanning folder per folder, it gets stuck between 10 seconds to several minutes per show to be scanned.

Should I try disabling Scan my library periodically? It has never been an issue, and you’re telling me that it only took 6 seconds to scan the library…

Every afternoon is scanning. Is there something I can do to avoid this?

Can you post your logs from shortly after this event? and let us know what time it happened locally?

Today I think it started to scan at 18:00. Tt goes from Axxx to the last one. Now (22:25) it’s still scanning, going for the Pxxx shows.

Plex Media Server Logs_2024-08-31_18-05-53.zip (5.9 MB)

Looking at the logs it looks like it is repeatedly re-scanning the same libraries. Can you try disabling Run a partial scan when changes are detected and Scan my library automatically ?

If I disable those two checks, it does not scan for hours but neither it does include the newly added content (as… expected if unchecked). If I re-check them, it starts scanning for hours again, on a daily basis.

Is there a way to solve this behaviour, without having to uncheck the scans?

This leads me to thinking you have some kind of scheduled task or automated process that is triggering constant drive scanning. You might check if you have something updating permissions, or doing something similar.

I use these settings:
Scan my library automatically OFF
Run a partial scan when changes are detected OFF
Scan my library periodically Daily

It detects new media nightly during the scheduled maintenance windows. This should allow you to update your library and avoid the constant scanning.

Using the same settings as you do, Plex is not constantly scanning for hours my library. But that’s not what I want, I want to have it scanned every time I add some content, and to just scan that content. It worked before but stopped working at some point… is there a way to have it to work again?

Do you have any kind of cron job or scheduled task that affects these folders (IE changes permissions)?

None that I am aware of, and definitely none that could have happened 2 months ago (when it was working as expected)…
I am using linuxservers docker image in unraid, if that information is useful. I asked on the unraid forums, there is nothing seen on the logs for the OS.

@ChuckPa any idea what might be causing this?

Wild idea! What kernel are you running and did it update recently ? I ran into a problem like this in the past on ubuntu with extremely slow scans and it turned out to be a kernel issue related to smb mounts.

Linux kernel version 6.1.106

I am on the latest stable unraid version, I updated not long ago. Maybe it might be the issue, but probably a lot of other unraid users (or anyone on that kernel version) would have had the same issue.
How can I be sure of it?
May I wait for the next update of the Linux kernel to see if it gets solved?

Could you boot into the previous kernel and run a scan and see if things improve? If not then the kernel version is not a factor for your issue.

I downgraded, and now a normal scan works fine, it is not stuck for hours. Will monitor it for some days to see if the scheduled scans work the same way.

Thanks for the tip!

1 Like

Cool. For reference here is a thread I had for a similar issue Ubuntu 22.04 - Slow scanning of libraries.

Maybe the kernel bug related to nfs deadlocks & caching has cheeped its way into the kernel on your system. Regardless, hopefully someone somewhere is fixing the actual issue so look for an updated kernel and test when it comes out. At least for now you have a solid one which works.

Still having the same issue even after changing unraid’s version and the docker’s image version, so I did disable the Run a partial scan when changes are detected and Scan my library automatically options.
But now at random times, Plex uses an insane amount of RAM (40-50GB) and makes the whole server unresponsive.



Plex Media Server Logs_2024-10-27_23-44-15.zip (868.8 KB)

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