Plex Media Scanner Crashing every night

Server Version#: 1.28.0.5999, 1.28.1.6018

Since the 0.5999 update I’ve been getting Plex Media Scanner crashing every night during scheduled maintenance. I’ve looked for crash dumps, but there are none in the AppData folder. I’ve uploaded my Event ID Text and tried to provide the logs as well.

Thus far, I’ve tried uninstalling and reinstalling PMS. I’ve also tried to do a database rebuild using the SQLite CLI. The integrity check passed, but I did the whole procedure anyway. The issue still persists.

I hope some of you can make more sense of the logs than I can.

Event.txt (1.6 KB)
Logs.zip (22.5 MB)

Unfortunately the server log files do not capture a crash. The only time Plex stops is an ordered shutdown: Aug 04, 2022 13:12:29.366 [3440] DEBUG - Ordered to stop server, when you updated from 1.28.0.5999 to 1.28.1.6018.

There is currently a problem with “deadlocking” servers. Plex Media Server is non-responsive, but remains running and visible in the taskbar. If you are having this problem, see Plex Server Crashing Randomly. The thread is rather long, but has a good discussion of the problem and details on gathering information to help with problem diagnosis & resolution (more than just log files are needed). Post any information on that thread, as that is where the problem is being actively worked.

If Plex Media Server is crashing, where the application actually stops running, then please provide updated log files on this thread.

  1. Wait for the problem to reoccur
  2. Restart Plex Media Server
  3. Wait 2 - 3 minutes for PMS to fully start and the log files to capture the startup sequence.
  4. Retrieve server log files (Settings → Troubleshooting) and upload to the thread.

That’s the thing, it’s only the Scanner that crashes, not the Server. As far as I can tell I’m not having that deadlocking issue. The crashes always happen when Plex runs its scheduled maintenance at 2 in the morning, or so. Even still, when I look in the Crash Dumps folder, there are no dmp files, and there probably should be.

Either way, I’m going to see how I can gather as much info as posible and reportt back.

I tried to Optimize the DB yesterday to see if that was what wa causing the crash, but sadly, no.

I waited for the crash to happen again, and this morning I stopped the server. There were no crash reports in the Plex Media Scanner folder. as I said, but still I have those two crashes for the scanner at 2:04am. I’m on Windows 11, as well. I think I forgot to mention that.

Plex Media Server Logs_2022-08-06_10-37-41.zip (4.5 MB)

If there is other info I need to upload, let me know. But this is weird, since it is not at all what is reported in that other thread. The scanner is doing something during the scheduled task that it doesn’t like. I just have no idea how to figure out what.

Took a peek at your logs and nothing major jumped out.

However, your naming is not exactly what plex expects from some of the scans I’ve seen. Example…

E:\Media\TV Shows\The Orville\Season 3\The.Orville.S03E01.Electric.Sheep.1080p.HULU.WEB-DL.DDP5.1.H.264-NTb.mkv

should be like this …

E:\Media\TV Shows\The Orville\Season 03\The Orville - S03E01 - Electric Sheep.mkv

Also, how are your movies organized and how are they added to your plex library? Reason I ask is because of this D:\Media\Movies\Jurassic Park Collection\Jurassic World Dominion (2022) 1080p.mkv. If D:\Media\Movies is the root on your plex library then it might cause problems as the scanner could try and match Jurassic Park Collection as a movie. Also, ideally each movie should be within its own folder. Flat structures are bad.

These may or may not be related to your problems but having media named against the plex rules WILL force the scanner to work much harder than it would otherwise (especially multiple movies in the one folder). So could be a factor and something to consider …

1 Like

FWIW, I would say this is how the vast majority of people using Plex are naming their files, and it works fine. If Plex suddenly started rejecting release names like this 90% of Plex servers would break over night.

1 Like

It works until it doesn’t. That’s all I’ll say on the matter.

1 Like

I have two movie folders and two TV Show folders, since they’re on different drives. Some movies are in folders for their franchise. Never been a problem in the past.

And that’s the thing, if I add an episode or movie, Plex scans it in without any issue. The scanner crashes only happen during the 2am scheduled task.

Crash reports weren’t in the Crash Reports folder in the Plex Media Server folder under appdata, but I did find them in the regular CrashDumps folder.

Maybe with these someone can see what was going on. There’s about a week’s worth of them in there.

Removed.

As far as naming and structure goes, though, I used to use a tool for that, it was really nice and had a watch list and stuff that I could populate and it’d tell me when new seasons were going to come out, and when I downloaded something, it’d rename and move it into the appropriate folder. Can’t for the life of me remember the name, though. It was something planetary.

That’s neither here nor there, though. Hope those crash dumps are more insightful than the logs are.

Thanks everyone. I appreciate it.

This is bad practice. I’d advise you take a look → https://support.plex.tv/articles/naming-and-organizing-your-movie-media-files. Is it the cause of your scanner crashes, who knows. It might be a factor it also might not. I know for SURE from working with plex dev in the past that the scanner will need to work EXTRA hard and has performance issues when folks deviate away from their best practices on naming. Flat structures with multiple movies in a single folder are especially bad the larger the folder grows.

Maybe someone from plex can review your dmp, sorry that would be beyond my skill set. Good luck.

1 Like

It’s still good to know… I’ll have to do a lot of fiddling with the library to get it to match what plex expects. Don’t relish that, but I’ll do it. Butt I do want to see what someone makes of those dump files, first. Even if my structure is a bit off from what plex expects, up and crashing is not something it should be doing. Especially when it only ever does it during this specific scheduled task.

There’s more here, I think.

1 Like

Just gonna throw my standard canned response to naming issues:

If you want to save yourself a lot of time I would recommend using Download - tinyMediaManager and use <Path to Library>/${title} (${year})/${title} (${year}) {imdb-${imdb}} as the new name format.

I’m using FileBot to do all of this now. Working great. Whether it sorts out my crashes, I doubt it, but I certainly can’t say I didn’t notice a difference on the speed of adding new media. So that’s a plus, there.

2 Likes

I started doing the renaming of my movies yesterday. I have some left to do, but this morning when I woke up and looked at the reliability report the scanner had crashed. Only this time, instead of crashing twice, it crashed once. So, I think you guys are on the right track. Just wish it was easier to figure out what it was tripping over.

1 Like

I spoke too soon. It’s back to crashing twice a night now.

I caught this in the logs:

Aug 08, 2022 23:03:08.631 [15624] Debug — [HCl#497] HTTP requesting GET http://192.168.50.79:9080
Aug 08, 2022 23:03:08.682 [15748] Debug — [HttpClient/HCl#497] HTTP/1.1 (0.1s) 200 response from GET http://192.168.50.79:9080 (reused)
Aug 08, 2022 23:03:08.684 [15624] Error — XML: Entity: line 1:
Aug 08, 2022 23:03:08.684 [15624] Error — XML: parser
Aug 08, 2022 23:03:08.684 [15624] Error — XML: error :
Aug 08, 2022 23:03:08.684 [15624] Error — XML: Start tag expected, '<' not found
Aug 08, 2022 23:03:08.684 [15624] Error — XML: status=ok
Aug 08, 2022 23:03:08.684 [15624] Error — XML: ^
Aug 08, 2022 23:03:08.684 [15624] Error — Error parsing content.
Aug 08, 2022 23:03:08.684 [15624] Error — Error parsing XML: Error parsing file.
Aug 08, 2022 23:03:08.684 [15624] Error — SSDP: Error parsing device schema for http://192.168.50.79:9080

It doesn’t tell me which file it’s trying to read. I’m guessing I’ll need verbose logging to be able to figure that out.

The XML errors are noise. You can ignore them. Plex Media Server sends out SSDP discovery messages on the network to discover clients and other network devices. Some devices respond in a manner Plex does not understand. When that happens, Plex Media Server logs an error.

Please don’t. Verbose logging adds an enormous amount of information to the log files. It usually causes them to wrap too quickly, losing desirable information. It also makes them incredibly difficult to read.


Other thoughts:
  1. Plex is scanning your libraries every 60 minutes:
    Aug 06, 2022 10:34:06.622 [12040] DEBUG - Starting scheduled updates, every 3600 seconds

    Is there a reason you have it set to such a short interval?

    Consider changing it to a longer interval, maybe every six hours. See if the scanner still crashes.

  2. Do you have timestamps for any of the event log entries, such as the “event.txt” you posted above? Or know how to convert the timestamps mentioned in event.txt to human readable format? They don’t match Unix epoch timestamps, and I could not find any info online about how to interpret them.

    Basically:
    (a) I do not see anything in the Plex logs about the scanner crashing;
    (b) it would be good to compare the timestamp of the windows event with the various Plex log files;
    (c) a human readable timestamp for the windows event would make that possible.

Okay, so those xml errors I’ll just ignore, then. Good to know. I’m lerning a good bit about Plex as I’m trying to diagnose this, so that’s a net positive.

Today’s crashes happened at 8/9/2022 2:02 AM. The timestamp in the event log doesn’t go further than that, so I don’t have seconds/fractions of.

Plex Media Server Logs_2022-08-09_10-21-57.zip (4.6 MB)

The latest logs are here, so maybe that’ll help.

As far as scheduling the scan, I had it that way because I didn’t want it to miss anything, but maybe every hour is a bit excessive. I’ll change that now.

In the meantime, I’ve still got a ton of shows to rename.

Thanks.

1 Like

Thanks for the updated info.

I do not see anything bad happening.

Plex is running the scheduled tasks, analyzing the files. Every logged task completed without error.

Here’s an example from Plex Media Server.1.log. Plex performs deep analysis for Waterworks. It takes roughly 18 seconds and successfully completes the task.

Aug 09, 2022 02:02:02.712 [10764] DEBUG - Butler: Scheduling deep analysis for: Waterworks
Aug 09, 2022 02:02:02.712 [10764] DEBUG - [JobRunner] Job running: set "FFMPEG_EXTERNAL_LIBS=\\\\?\\C\:\\Users\\Filippo\\AppData\\Local\\Plex\ Media\ Server\\Codecs\\a48fbc4-4359-windows-x86\\" & set "X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxx" & "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe" --analyze-deeply --item 84742 --log-file-suffix " Deep Analysis"
Aug 09, 2022 02:02:02.719 [10764] DEBUG - [JobRunner] Jobs: Starting child process with pid 15744
Aug 09, 2022 02:02:20.505 [2396] DEBUG - Jobs: 'C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe' exit code for process 15744 is 0 (success)

Plex Media Server.1.log covers the time period 00:06:18 to 06:16:22. Scheduled Tasks, referred to in the logs as Butler tasks, start at 0200 and finish at 0500. During this period there are 750+ references to Plex Media Server.exe. All tasks complete successfully.

I also looked in other log files that covered the same time period (any log file with a modification time after 0200). I did not see any errors. Everything looked normal.

I run Plex on Linux, not Windows, and I’m admittedly unfamiliar with how Windows logs things.

However, I’m wondering if we’re chasing a red herring?

The Windows entry occurred at 2:02 AM, the same time Plex starts running Plex Media Scanner.exe for nightly tasks, and those tasks all complete successfully.

Possibly this is normal and/or a false positive?

As mentioned above, I do not see anything wrong happening in the Plex log files.

I also was wondering that.

Regardless, think we are all in agreement that once the file rename work is complete the plex scanner should perform at least better than it is now.

Yes. Adhering to Plex recommended naming & organization is always a good thing.

1 Like

Well, I’ve got crash dumps appearing every day, so something is happening. I wish a Plex dev could have a look at them to see if they can make something of it. At the very least, it would show what the scanner is doing at the time the crash happened.

I’m still working on the renaming. I am so glad I don’t have to do this all manually, though. Once that’s all done, we’ll see. If the crashes continue to happen after that, well, it’s got to get looked into further.

I’m pretty sure, that normal operation for a program should not throw up a critical error in event viewer.

All that said, I do want to say thanks for all the help and pointers. I very much appreciate you all taking the time to work with me on this.