Corrupt DB instructions lead to a 0KB database

Server Version#: 1.26.1.5798

Hi All,

I have a corrupt DB on my unraid server and have tried to follow spaceinvaderones instructions as here:-

And here:-
https://support.plex.tv/articles/repair-a-corrupted-database/

However whenever I get to the this stage:-
“Plex SQLite” “com.plexapp.plugins.library.db” “.output dump.sql” “.dump”

It creates a 0KB db.

I can see the file filling up with data, but when its complete its set to 0KB.

Any ideas would be great ??

Thanks

D

I see that if the database can’t be repaired :frowning:

If you open dump.sql with like notepad++, you can see the actual SQL statements, and the last line is most likely a rollback

I suggest you try with another backup file, slightly older

Thanks for the heads up

And your YouTube Video, the database named com.plexapp.plugins.library.blobs.db and should also be fixed, since exploded in size, IMHO :wink:

2 Likes

What was the output of PRAGMA integrity_check?
What was the output of .recover?

That video implies that if .recover doesn’t work, the next step should be to manually .dump and then .read.

That’s not good advice. .dump is a backup command without any recovery capability. If .recover didn’t work, .dump will certainly not be better.

Fundamentally I agree with @dane22; time to look at previous backups.

Oh! I’m not an Unraid expert, but I know that it has earned a reputation for destroying SQLite databases.

Where is the database located?

Hi All,

So managed to get a backup version and used those which worked.

However I am curious what com.plexapp.plugins.library.blobs.db actually does ?

As this one is also corrupted so i used a backup of this, but i wanted to know if I need to run a refresh meta data or something after the replacement.

Cheers All

Hi All,

So further to this thread. my DB is corrupting weekly now.

I’ve gotten the steps down to repair my DB, but on the most part it lasts about a week before corrupting again.

I used to run my plex server on a windows intel NUC machine for like 3 years straight and never had any issues, now its corrupting almost weekly.

I’m curious to know if its my set-up (Unraid, using linux server docker) or the fact im using PMM ?

Would the logs show whats corrupting the DB ?

Any suggestions would be great ?

Cheers

Dan

Ive seen a large number of these issues with unraid

1 Like

i have the same problem with my db, was currupted last week.
Hi, I’ve tried this to repair, but i received a 0kb file after trying to recover my database. My PLEX Server is running in a NVIDIA SHIELD Pro 2019 and i tried to repair with sqlite in my PC. I used the steps in this document too: Repair a Corrupt Database 1.22.0 and earlier | Plex Support

My PLEX Server version 1.27.2.5929
My PC have a Windows 11 Pro v21H2

can you have any aditional ideia or instructions? Its impossible to repair? :frowning: really?

Wrong instructions, should use Repair a Corrupted Database | Plex Support

Plex is now using a customized SQLITE. Probably would be easiest to install the windows version of the server on your pc to use for repairing the db.

2 Likes

Many Thanks, Problema solved now !

i have installed PMS at Windows temporary to use last version of SQLITE, included with PMS for Windows. then i followed this document as you suggested: Repair a Corrupted Database | Plex Support

1 Like

@dane22 - I’m getting almost weekly corruption messages now. I’ve become good at repairing the db.

Any chance you can help me diagnose the cause?

@dane22 theres beer & cake in it for you …. Come on, what do you say ? :wink:

Probably from me!

Any solutions mentioned ?

Unraid’s default filesystem has/had a history of breaking SQLite databases. I don’t follow Unraid or know the current status. I know that one workaround was moving the Plex data directory off of the magic Unraid filesystem to a normal one.

I’ll try to find a good link with more info. I’m sure the Unraid forums could tell you exactly what to do.

Ahh, interesting - I have the impression they believe this was fixed a while ago, around 6.8.

Unraid | Unraid 6.8 Now Available!
[Need help] corrupt sqlite db files : unRAID

Forcing the Plex Data to live on an Unraid “Cache” disk was the workaround, but it still seems to be recommended:

Plex database in container gets corrupted every 3-5 days under unraid : unRAID

1 Like

Hey @Volts - yup, tried all that. Still no dice

Was hoping someone from Plex could look at my logs or db and go ahaa !! It breaks when this happens …. Will have to wait and see

Given the reports that Ive seen about unraid, I do not think the issue is a Plex issue, rather its an issue with Unraid.

I just watched that video, and the SQLite command steps there don’t make total sense.

The instructions on the Plex support page are better.