# Plex Database Corruption issue

**URL:** <https://forums.plex.tv/t/plex-database-corruption-issue/888154>\
**Category:** General Discussions\
**Created:** [September 14, 2024, 1:48am UTC](https://forums.plex.tv/t/plex-database-corruption-issue/888154 "2024-09-14T01:48:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unibrowser](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/unibrowser/32/175987_2.png) [@Unibrowser](https://forums.plex.tv/u/Unibrowser)\
**Post date:** [September 14, 2024, 1:48am UTC](https://forums.plex.tv/t/plex-database-corruption-issue/888154/1 "2024-09-14T01:48:17Z")

</div>

I noticed yesterday that for the past few days new content was not being picked up by Plex. I did the [Plex dance](https://forums.plex.tv/t/the-plex-dance/197064). 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](http://linuxserver.io)). Plex has been working fine for months on the new server up until yesterday. Someone please help me lol

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [September 14, 2024, 2:27am UTC](https://forums.plex.tv/t/plex-database-corruption-issue/888154/2 "2024-09-14T02:27:33Z")

</div>

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](https://www.sqlite.org/rescode.html#corrupt)

---

<div class="post-metadata">

**Author:** ![Unibrowser](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/unibrowser/32/175987_2.png) [@Unibrowser](https://forums.plex.tv/u/Unibrowser)\
**Post date:** [September 15, 2024, 12:25pm UTC](https://forums.plex.tv/t/plex-database-corruption-issue/888154/3 "2024-09-15T12:25:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Unibrowser](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/unibrowser/32/175987_2.png) [@Unibrowser](https://forums.plex.tv/u/Unibrowser)\
**Post date:** [September 15, 2024, 12:54pm UTC](https://forums.plex.tv/t/plex-database-corruption-issue/888154/4 "2024-09-15T12:54:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [September 15, 2024, 4:04pm UTC](https://forums.plex.tv/t/plex-database-corruption-issue/888154/5 "2024-09-15T16:04:53Z")

</div>

@Unibrowser

Excellent!

That’s how it should work… 🙂

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

---

<div class="post-metadata">

**Author:** ![Unibrowser](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/unibrowser/32/175987_2.png) [@Unibrowser](https://forums.plex.tv/u/Unibrowser)\
**Post date:** [September 15, 2024, 5:14pm UTC](https://forums.plex.tv/t/plex-database-corruption-issue/888154/6 "2024-09-15T17:14:24Z")

</div>

Doing that now. Thank you 😊

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 14, 2024, 5:15pm UTC](https://forums.plex.tv/t/plex-database-corruption-issue/888154/7 "2024-12-14T17:15:11Z")

</div>

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