Plex Database Corruption issue

I noticed yesterday that for the past few days new content was not being picked up by Plex. I did the Plex dance. I did just about everything. Then I stumbled upon @ChuckPa github about the DBRepair script to correct the issue. Well just my luck it failed with this error code

Runtime error near line 3528125: UNIQUE constraint failed: fts4_metadata_titles_icu_docsize.docid (19)
Error 1 from Plex SQLite while importing from ‘./dbtmp/library.plexapp.sql-2024-09-13_18.17.12’

Also after trying to manually trying #6(reindex) I get this error code:

Backing up of databases
Backup current databases with ‘-BACKUP-2024-09-13_18.49.20’ timestamp.
Reindexing main database
Error: stepping, database disk image is malformed (11)
Reindexing main database failed. Error code 11 from Plex SQLite
Reindexing blobs database
Reindexing blobs database successful.
Reindex complete.

Not sure what to do at this point. For a little back story, I was running my Plex server on my Synology via the Plex package from the package center. I built a new Unraid server, and migrated everything into the new Docker container. I did have trouble when zipping the database on the Synology, certain files would fail to zip, but none the less I migrated everything over and spun up the container on Unraid (linuxserver.io). Plex has been working fine for months on the new server up until yesterday. Someone please help me lol

This is a serious error.
At any time, was your PMS run from network storage ?

The database has significant damage and is not salvageable

Use my tool to select and make active one of your backup databases.
(Restore using a backup DB)
Use the --sqlite and --databases options to help you as it will have a lot of work to do

Even SQLite cannot do anything with the DB

https://www.sqlite.org/rescode.html#corrupt

1 Like

Plex runs locally, I do however have content on my synology. The synology shares are mounted in unraid via SMB.

It worked. Thank you so much for the help. It searched for the latest useable backup which was apparently about 2 months ago lol. After it got replaced I ran the automatic tool again to ensure it all checked out. Im back up and running just rescanning libraries and refreshing metadata now. Thank you so much for this tool @ChuckPa

@Unibrowser

Excellent!

That’s how it should work… :slight_smile:

At this point, I do suggest:

  1. Let scanning and metadata finish catching up
  2. When all idle, Run the tool again to “auto” cleanup & optimize
  3. Stop Plex
  4. Make a full, proper, backup (tar works) of all of Plex’s data
1 Like

Doing that now. Thank you :blush:

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