Plex Media Server crashing daily, inconsistently

Server Platform: Windows 10
Server Version#: 1.25.2.5319
Player Version#: Any

I have been experiencing almost daily crashes for the past several weeks. Many times it happens at 2AM, the beginning of nightly maintenance, but not all the time. Sometimes it happens in the evening when people start to watch things. I have looked at several other posts regarding similar situations and have attempted their fixes: turning off IPv6; turning off thumbnail generation; temporarily deleted my music library; and removed all VC1 files as those were definitely causing crashes. After a lot of time and troubleshooting, I’m at a loss of where to go next. I have most logs from after each crash, but I’m not sure what to look for and I didn’t see anything obvious. Any help would be very appreciated.
Plex Media Server Logs_2021-12-13_19-56-55.zip (6.0 MB)

Hi
I may have the same problems. each time it happend on my server the load of the Plex instalation drive goes to 100% (is on a separated drive from windows). could you check if it’s the same for you on your server ?
Nobody has answer to my problems yet : Plex crashing after making SSD run a 100% capacity
hope for you to have a quicker answer than me

For me I had something similar as I had a corrupted database that would fail in the 2am daily maintenance jobs. Test your database with command:

cd "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
"/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db "PRAGMA integrity_check"

For me, I noticed a lot of the issues come from the db. I was able to follow the guide and fix it. Guide: Repair a Corrupted Database | Plex Support

For some reason I am unable to run the Windows specific commands to accomplish a database check or repair. I am unsure of why they failed to run. It gives me an ‘Unexpected token’ error.

PS C:\Users\x\AppData\Local\Plex Media Server\Plug-in Support\Databases> “C:\Program Files (x86)\Plex\Plex Media Server\Plex SQLite.exe” com.plexapp.plugins.library.db “PRAGMA integrity_check”
At line:1 char:65

  • … Media Server\Plex SQLite.exe" com.plexapp.plugins.library.db "PRAGMA …
  •                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

Unexpected token ‘com.plexapp.plugins.library.db’ in expression or statement.
+ CategoryInfo : ParserError: (:slight_smile: , ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken

PS C:\Users\x\AppData\Local\Plex Media Server\Plug-in Support\Databases> “C:\Program Files (x86)\Plex\Plex Media Server\Plex SQLite.exe” com.plexapp.plugins.library.db “.output recover.out” “.recover”
At line:1 char:65

  • … Media Server\Plex SQLite.exe" com.plexapp.plugins.library.db ".outpu …
  •                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

Unexpected token ‘com.plexapp.plugins.library.db’ in expression or statement.
+ CategoryInfo : ParserError: (:slight_smile: , ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken

I haven’t checked SSD utilization during a crash, but I will next time if I catch it. Spot checks during normal operations haven’t ever shown much use.

Sounds like a corrupted db, not sure as I run on Linux.
Yoy may need to check your permissions that you have access to it… In linux, it’s run under user “plex”.
Also, have you done a Database Optimization? That should help

I have try to strat a database optimization first

seems to have trigger the problems :

Start the optimization 30 sec same problemes as usual the plex is still up seem to run but no player are able to connect to the serveur
image

this task start every night but she is never finish when i check the next morning. as i have the issue even when i do not do maintenance i think it’s a trigger to an undeling issue. I’ll try to make a repair of the DB and keep you in touch

how many time to complete the “PRAGMA integrity_check” ?

First try : shut down plex server / Pragma integrity check generate my problems SSD runs to 100% i have let it run 1h without result

Second try : shut down plex server / Pragma integrity check - check return “ok” as said in the link i try the recover and it generate my problems see picture

an idea on how to try to uncorrupted the database without using recover command prompt ?

This all sounds like a faulty ssd, sounds like it’s stalling. I would try moving your db to another drive and see if you still have issues.

Well I have experienced a couple of crashes since my previous post and I didn’t notice any excessive SSD utilization. I also show that a database integrity check was successful on my database. I do not believe the issue I am experiencing is related to the one @shibra is.

I am including the logs of my most recent crash as it happened during a media scan, which hadn’t happened previously.
Plex Media Server Logs_2021-12-16_12-08-06.zip (5.5 MB)

I’m pretty sure my crashes are the result of a corrupt database at this point, however, I am unable to run ANY commands to check or repair my database going by the Plex guide. I always get the following response when I attempt a check or repair:

At line:1 char:65

  • … Media Server\Plex SQLite.exe" com.plexapp.plugins.library.db "PRAGMA …
    Unexpected token ‘com.plexapp.plugins.library.db’ in expression or statement.
    • CategoryInfo : ParserError: ( : ) , ParentContainsErrorRecordException
    • FullyQualifiedErrorId : UnexpectedToken

How do I proceed with repairing, restoring, or rebuilding my database if nothing will recognize it?

Skip the Pragma check and continue with the dump and load. You may need to run the recover step and load that file.

Well I have manually rebuilt my database, attempted to clean up some file names, and shutdown a few residual power saving options on my PC. I am still seeing crashes at least once a day. Can anyone verify if my database is still causing my crashes? I can provide logs if so. This server has been crashing daily, randomly for MONTHS. I’m losing my mind.

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