For months now, PMS has crashed instantly on startup. I’ve updated the server software many times over this time to try to fix it, but it’s never worked. I’m not technical enough to troubleshoot this myself, so I’m finally fed up enough to seek help from the forums.
I’ve read a bunch of threads about this topic, and not much makes sense to me. I believe my server logs are saying that my database is corrupt:
I’ve tried to repair the database, but I can’t even get that process started. Following the instructions at this page (Repair a Corrupted Database | Plex Support) didn’t help; apparently “The commands for macOS and Linux/NAS devices are similar to the Windows instructions above and would be performed using the Terminal/command line on those systems. You just change the path to the executable.” is not an effective instruction for me. I can’t get “Plex SQLite” to launch to even attempt the repair, no matter how I phrase the command. I think I need step-by-step instructions directly for MacOS, because the Windows commands shown don’t work. I’m sorry, I wish I were better at this, but I’m drawing blanks now.
Assuming you have not lost any media, it is probably a lot easier to merely dump all Plex files and reinstall then trying to rebuild a corrupt database, which may not rebuild anyway, depending on how mangled it might be.
There are probably support pages that describe how to completely remove/uninstall Plex from any computer, start there and download a fresh latest copy of Plex and re-install and re-add your media. I would suggest not to try to do that all at once and test things out.
Assuming a re-install gets you going… continue to add in phases… not sure if a really bad media file can gum up the works or not, but if it can and you add a batch and things go wrong, Then you might have a place to look for a problem.
Somebody please give this person a remedy because I done everything the thread starter done and PMS won’t even start a fresh install with this last update to even check my logs or anything, Im totally washed out over here.
drag the Plex SQLite executable into Terminal — this will copy the path of the executable w/ all spaces properly escaped
proceed with the parameters described in the support article
@MURKER01 :
You should be able to do the same with the executable file for Plex Media Server and run the app from Terminal (see #4 above). If the crash doesn’t show in your Plex server logs this could give you some indication why Plex isn’t starting. I’ve recently seen a case where one of the framework packages inside the app contents folder didn’t seem to have permissions for the actual user which caused it to terminate on startup.
UPDATED!!! I clicked "Plex Media Server .Exec file & got this???
"Error: Unable to set up server: sqlite3_statement_backend::loadOne: database disk image is malformed (N4soci10soci_errorE)
You all are seriously overestimating my technical capabilities.
Using the techniques above to get PlexSQLite to run in terminal, I was able to create the dump file and delete my old database, but not restore it from the dump file. Don’t know what went wrong, but I don’t understand anything that I did, so I can’t explain what I might have done wrong, either. It just reported that it couldn’t find the dump.sql file. I performed these actions inside the folder that held the database (com. … .db), so I believe it should have worked.
Oh well. I guess I’m rebuilding the database.
Does this mean I’ll have to update the metadata that I edited so meticulously when I set this up in the first place? Please tell me that’s not the case. If I have to manually update metadata with any regularity, I’m going to regret purchasing a lifetime Plex account.
if you click on the spanner for the settings
Then under grey settings on the left hand side, click on scheduled tasks
Then tick the box backup database every 3 days
This will provide some protection. Though for me it does not appear to go back very far i cant speak for other operating systems/environments but it probably needs fixing given the trivial size of the databases.
if you click on show advanced it will let you see the backup location.
Failing that. at least on gentoo, the database is backed up with every server version update. I think this may be a custom thing rather than plex.
i guess rather starting over from scratch if that box was ticked, you could try and look for corruption in each backup file and rebuild from the most recent version without it. But i would recommend going back at least 2 versions back out of an abundance of caution.
Still corruption scanning etc can only pick up so much, you are running the risk of corruption still being in there and it slowly rotting the database again. Unfortunately Sql lite is known to be problematic at scale/heavy use. Plex devs seem to be highly reluctant to change this for various reasons
I wouldn’t say it will always happen, rather just often enough, to enough people, across enough implementations regardless of software to gain universal notoriety. At the same time it has many distinct advantages, for simplicity of installation and use, and compatibility it can be plonked on almost everything. So more often than not its used in pretty much everything consumer grade (like a phone app) and not server grade Implementations like (setting up a website). Plex falling somewhere in-between makes it a tough call.
Its kind of not their fault, it kind of is… with the inevitable march of mores law were most aspects of technology have a tendency to quadruple in capacity every 4 years having a big spread of database backups will make how often they are backed up and how many to keep a moot point and trivial expense and 100tb SSD drives are already possible. We sill see storage increases in peripheral devices ramp up soon.
The thing is, that 4k resolution is already beyond the limits of human perception for the most part, and 8k tvs coming out. There is an innovation cliff were there will no longer be any meaningful increase in terms of quality the only thing they can do to keep propping up prices is to make them smarter other than curved/immersive (360deg filming) uncompressed 8k is 48Gb/s though so there will be some serious hardware hiding behind that. They already have a backlight for every pixel.
err… sorry for getting a little lost, overtired and scatterbrained … how did i get here?