I’m just wondering if everything is fine with these databases. Every day, I have to recover one of them, two or all three, and every night, while completing scheduled tasks I got a message “Database corrupted”.
What’s wrong with it? No errors in syslog, no disk errors (I fsck it regularly).
Any ideas please?
Thank you.
Use Chuck’s DB Repair. I’m guessing whatever you think youre doing when you recover them isn’t actually bringing back the good working version. So you’re restoring broken databases is my guess. Are you deleting the -wal files when you recover from backup? Coz they’re not supposed to be there.
Switched off all scheduled tasks and nor “corrupted databases”, nor “(Plex Media Scanner), jid 0, uid 972: exited on signal 11” in syslog… As they say, that’s what had to be proven. Anybody know what exactly do these “scheduled tasks”? What does mean, for example, “Optimize database every week”, “Upgrade media analysis during maintenance” and so on?
I ‘PRAGMA integrity_check’, ‘VACUUM’ and ‘REINDEX’ databases using cron every night. And I don’t understand why Plex Scanner started by Scheduled Tasks every time crashes (Just a few minutes later 2 am). Everything is fine when I start it manually.
Cool work on the HostConfig.
I’d recommend you further refine that to ensure the host is BSD
– Is there a default location for AppSuppDir or a common place to find it?
Please remember, there are limits to what the tool can fix.
Its primary purpose is to fix malformed DB files (the physical DB is damaged).
It cannot fix content errors (failed migrations, etc)
When you run your nightly backups, do you stop Plex Media Server first, then perform the backup, and then restart PMS? I ask because attempting to restore from a database backed up without doing so can lead to corruption (for at least a couple of reasons).
Even with my knowledge and access, it’s too complex for me to fully understand all the relationships. Only the engineering team really knows all the details.
I can offer you my DB tool which helps keep what you have in the best possible form. It cleans out deleted records and will optimize the DB as well as rebuild indexes,
You’re welcome to read the documentation I have for it and use it if you want.
In general, folks usually find that:
Auto optimization works the best for most cases
Pruning & purging old temp files from PMS helps manage the fileystem bloat.
Should you need to restore a DB from one of Plex’s backups, it ensures that the incoming DB isn’t corrupted (at the DB level) and manages PMS to ensure you don’t get a bad DB during the restore process (Process control)
You want a solution to fix your problem? There isn’t any. Your problem is that you don’t understand what everyone is telling you. There’s no way to fix the content now that it’s in that state. The guy who wrote the DB Repair script just told you that even he can’t fix that. If his script can’t fix your database, it means you gotta start from scratch.
My tool can only fix the SQLite database structure.
It is a shell script. It can’t interpret the contents of each record, or a set of records, in a database and figure out what’s wrong
(My tool is 2,362 lines line compared to the 400,000+ lines of code in PMS)
This really is one of those situations where you have to start over.
WITH THAT SAID – If you have cloud sync enabled to retain your watch history, when you do start over, PMS will retrieve your watch history for your media.
For future planning.
Put custom posters you want to use in with the media (and enable the “Local Media Assets” agent)
Stop the DB before backups or any other database operations
– ONLY PMS can backup its database while running BECAUSE it owns the DB AND it locks the DB while making the backup so that no records can be changed.
I told you, what Plex is backing up is a corrupted database. This is why despite your pronunciations that you know about databases, I don’t believe it. This logic is so basic. It feels like I’m talking to a child. Read what I said before:
I’m trying to help you, but since my help doesn’t fix your problem, you think that I’m not trying to help you. Very well, wallow in your own misery. Have fun.