Corrupt database

First of all, I would like to thank you for your response.
I was afraid to ask you @“MovieFan.Plex”, thanks for offering it to me. I am uploading the zipped database and sending it in PM.
To be honest, I was so desperate and I started looking everywhere for commands that could help me.
And yes @jjrjr1 , I saw the quotes and I have tried that too but with no success (in both Linux and Win10 environment). Then I downloaded a bunch of different software trying to resolve this by myself and I have ended up with a portable one called sqlitestudio. It gave me more details about the problem, but any act of mine concluded with a new db which did not pass sqlites integrity check (always have a malformed database schema message). After many attempts I have managed to obtain a db file which is like 30MB lesser than the corrupted one and acceptable by sqlites checking procedure. Using that database in Plex resulted in a non crashing Plex but it reproduces other files from the ones selected.
I`don’t know if I have done things better or worst.
Thank you again and sorry if I have messed things up more than before.

@“MovieFan.Plex”

I’m facing a similar problem with a rather large database.
Integrity check returns “ok”, but some of my shows, have negative numbers in watch state, and I am not able to fix it following the commands on the help page.

Furthermore, some of my libraries are extremely slow when editing stuff.
I partly blame thetvdb.com for this, but when grabbing a poster manually from their site, it correctly saves it, and reloads the poster in the UI. When letting PMS do it automatically, it hangs for about 45 seconds, before it closes the edit box, and poster never refreshes.

You mind taking a look at my database, partly to fix the watch states, and partly to see if anything else is wrong with it?

  • Regards Kris.

@Chronosdk said:
You mind taking a look at my database, partly to fix the watch states, and partly to see if anything else is wrong with it?

Sure. Zip it up and upload it somewhere and provide me a link.

i want to open this file ’ com.plexapp.plugins.library.db’ on ubuntu , what is the command ?

Here ya go.
The SQLite command reference
https://sqlite.org/cli.html

I use this: sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
and it dumps my database to a dump.sql

I then rename the database file to append .original to the end.

It is when I run the final command, something goes wrong:
sqlite3 com.plexapp.plugins.library.db < dump.sql

After taking awhile I end up with a database file that is 0kb

@JohnsPrime said:

I use this: sqlite3 com.plexapp.plugins.library.db .dump > dump.sql

Did you append “.dump” to your original database? Otherwise the resulting file won’t have anything in it. How big is the resulting .sql file?

@Elyviere said:
Hello.

I’ve run into an issue with a corrupt database, and unfortunately I’ve been unable to fix it. I found the following thread: https://support.plex.tv/hc/en-us/articles/201100678-Repair-a-Corrupt-Database, which does address this issue, however was unable to get any of the windows commands to do anything. In fact, there are three various downloads for windows, but I was only able to get the shell one to run. However, I’m not able to run any of the commands from the OS X section. That is, even though I do change the filepath to the Windows filepath, none of the commands do anything. They just put me on a new row, which is exactly the same as what happens when typing any random incorrect command. Anyone know how to use this program on Windows?

Thanks Elyviere! That is what my issue was.

Hi @anon18523487, sorry for resurrecting an old thread but I do have a problem with corrupt database, and after a few hours of attempting to rebuild, I’m on a verge of giving up … Are you still willing to take a zip file and try to fix my database? pls let me know, thanks

Sure, send it over.

@anon18523487

Ok, I encounter another issue now … for some reason I cannot zip it up directly. Here’s what I have done:

  1. Zipping the database folder directly failed. Some redundancy check error
  2. Scan disk check error on my plex database drive (I moved it to D:)
  3. Found some errors, let Windows fix it, and verified error is no more.
  4. Still got some errors zipping the files
    5: Moved the database into C: . I could copy all but “com.plexapp.plugins.library.blobs.db”. Is that file important?
  5. I zipped it successfully. Here’s my zip file https://drive.google.com/open?id=1uQ67iNxaCMp3EzubaNOtPi1PwJjQAt9R

if #5 matters, I’ll try to get it again somehow.

EDIT: You know what, I don’t know why I didn’t think about it earlier, but finally I figured out that I could just rename the current com.plexapp.plugins.library.blobs.db and use my database from a week ago to load it back up… My server is up again now. Thanks for responding to my needs!

1 Like

Glad you figured it out.

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