Fix Database entry

I run into a issue with a corrupt database :frowning:

I already tried:
Guide here: Repair a Corrupt Database | Plex Support
Also moved the folder of the TV show out of the plex library path

Plex does show the Series, no of the files are playable (not avaiable) what is logical because I moved them away… but also a rescan of the libaray doesn’t help. i can clean it with “empty bin” so I really don’t know how to remove that bad entry.

I there a way, to manually identifiy the object in sqlite3 DB and relete this to rescan the series?

Plex should have flagged this show as “deleted” with a trash icon overlay. Did/do you see this? Like this
https://support.plex.tv/articles/200289326-emptying-library-trash/

Edit your tv show library
go to the ‘Add Folders’ tab
verify that all of the folders paths listed there are still

  • existant
  • not empty (!)
  • accessible to Plex server

There is no trash icon on the tv-show… and it doesn’t delete the tv-show if I select “emtpy bin” to remove all the stuff with trash icon. Thats the reason why I tried this :frowning:
If I select “show media info” on one of the files I can see that this file ist “Not avaiable” with the red badge behind the path.

Yes… I know that. All stuff is there.
I can see:

  • all the folders
  • all the files
  • plex can read all the files (I can play it in the GUI)

But Plex does load new metatdata 1000 times for some of the shows. Multiple times a day… in a loop. Some shows doesn’t show up any metadata but plex has fetched if I show that in the logs.
It looks like the database is corrput and plex can’t write to some of the stuff in it.
Thats why I would likte to fix my database… it is big and it takes a lot of time to rescan all things and then I will lose watched status. :frowning:

Any help is welcome.

One more thing I just figured out.
While DB scan is running I get a lot of output like this in console:

May 27, 2019 22:52:25.240 [0x7f6033fe7700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [ROLLBACK] cannot rollback - no transaction is active
May 27, 2019 22:52:25.240 [0x7f6033fe7700] Fehler — Failed to roll back transaction (../Library/MetadataItem.cpp:956): Cannot rollback transaction. cannot rollback - no transaction is active
May 27, 2019 22:52:25.240 [0x7f6033fe7700] Fehler —  * Error loading episode.
May 27, 2019 22:52:25.243 [0x7f60357ea700] Warnung — Took too long (0.810000 seconds) to start a transaction on ../Library/MetadataItem.cpp:956
May 27, 2019 22:52:25.243 [0x7f60357ea700] Warnung — Transaction that was running was started on thread 0x7f6033fe7700 at ../Library/MetadataItem.cpp:956
May 27, 2019 22:52:25.245 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=1): Cannot commit transaction. SQL logic error
May 27, 2019 22:52:25.740 [0x7f60357ea700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [COMMIT] cannot commit - no transaction is active
May 27, 2019 22:52:25.740 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=2): Cannot commit transaction. cannot commit - no transaction is active
May 27, 2019 22:52:26.730 [0x7f60357ea700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [COMMIT] cannot commit - no transaction is active
May 27, 2019 22:52:26.730 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=3): Cannot commit transaction. cannot commit - no transaction is active
May 27, 2019 22:52:27.710 [0x7f60357ea700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [COMMIT] cannot commit - no transaction is active
May 27, 2019 22:52:27.711 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=4): Cannot commit transaction. cannot commit - no transaction is active
May 27, 2019 22:52:28.672 [0x7f60357ea700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [COMMIT] cannot commit - no transaction is active
May 27, 2019 22:52:28.672 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=5): Cannot commit transaction. cannot commit - no transaction is active
May 27, 2019 22:52:29.594 [0x7f60357ea700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [COMMIT] cannot commit - no transaction is active
May 27, 2019 22:52:29.595 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=6): Cannot commit transaction. cannot commit - no transaction is active
May 27, 2019 22:52:30.440 [0x7f60357ea700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [COMMIT] cannot commit - no transaction is active
May 27, 2019 22:52:30.440 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=7): Cannot commit transaction. cannot commit - no transaction is active
May 27, 2019 22:52:31.132 [0x7f60357ea700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [COMMIT] cannot commit - no transaction is active
May 27, 2019 22:52:31.132 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=8): Cannot commit transaction. cannot commit - no transaction is active
May 27, 2019 22:52:31.514 [0x7f60357ea700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [COMMIT] cannot commit - no transaction is active
May 27, 2019 22:52:31.514 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=9): Cannot commit transaction. cannot commit - no transaction is active
May 27, 2019 22:52:32.278 [0x7f60357ea700] Fehler — SQLITE3:(nil), 1, statement aborts at 1: [COMMIT] cannot commit - no transaction is active
May 27, 2019 22:52:32.278 [0x7f60357ea700] Fehler — Failed to commit transaction (../Library/MetadataItem.cpp:958) (tries=10): Cannot commit transaction. cannot commit - no transaction is active
May 27, 2019 22:52:32.279 [0x7f60357ea700] Fehler — Exception inside transaction (inside=1) (../Library/MetadataItem.cpp:958): Cannot commit transaction. cannot commit - no transaction is active

I wouldn’t even bother to try and repair the database. I’d just shut down Plex and restore a backup. Plex should be making backups of the database every three days by default I think. Once Plex is shut down, make sure taht “com.plexapp.plugins.library.db-shm” and “com.plexapp.plugins.library.db-wal” don’t exist. Then copy one of the backup files (e.g. “com.plexapp.plugins.library.db-2019-05-26”) over the main database file “com.plexapp.plugins.library.db”.

You’ll lose some of your watched history and any manual metadata changes that you’ve made but that’s about it. You’ll need to re-scan your library to pick up any media that’s been added since the backup was created.

Already restored the oldes avaiable backup from “com.plexapp.plugins.library.db-2019-05-20” but it doesn’t help. I think this one is already broken :frowning: This is why I ask to fix it…

Unfortunately I think that you’re out of luck. I’ve never had any success trying to repair a SQLite database.

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