# Database Corruption - Need help

**URL:** <https://forums.plex.tv/t/database-corruption-need-help/705899>\
**Category:** Plex Media Server\
**Tags:** server-docker, server-unraid\
**Created:** [March 31, 2021, 11:04am UTC](https://forums.plex.tv/t/database-corruption-need-help/705899 "2021-03-31T11:04:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaberman43](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@chaberman43](https://forums.plex.tv/u/chaberman43)\
**Post date:** [March 31, 2021, 11:04am UTC](https://forums.plex.tv/t/database-corruption-need-help/705899/1 "2021-03-31T11:04:15Z")

</div>

Server Version#: 1.22.2.4264  
Player Version#: N/A

Similar issue to:

> [@Getting Errors trying to repair Database, How do you invoke built in SQLITE3 in Unraid?](https://forums.plex.tv/t/getting-errors-trying-to-repair-database-how-do-you-invoke-built-in-sqlite3-in-unraid/705305):
>
> Server version: 1.22.1.4228 from [Linuxserver.io](http://Linuxserver.io) docker OS: Unraid I am trying to check for corruption and im getting these errors… Note: I move the db to do all this stuff so thats why the path has “clean” in it, thats where I copy my db to do work then put it back later. root@MIKESDESKTOP:/mnt/disks/ADATA\_1TB/PlexMediaServer/clean# sqlite3 com.plexapp.plugins.library.db "DROP index 'index\_title\_sort\_naturalsort'" Error: no such index: index\_title\_sort\_naturalsort root@MIKESDESKTOP:/mnt/dis…

And to a lesser extent:

> [@Hoping for help with DB corruption](https://forums.plex.tv/t/hoping-for-help-with-db-corruption/701344/):
>
> So I’ve been having some odd issues getting things playing with Plex. I figured I’d check on the database. It seems hosed beyond my ability to repair (but PMS is up and limping). I’ve tried the repair a corrupt db article on the db itself as well as all four of the backups. I get the following error from the integrity check. If I ignore the errors, the dump restore returns a db size of 0kb (with no errors). Please help. \*\*\* in database main \*\*\* On tree page 18986 cell 12: Rowid 53 out of order…

My database has suddenly become corrupt (or so it claims) and as a docker/UnRAID user I have no idea how to proceed with repairs given that the [repair a corrupt DB help page](https://support.plex.tv/articles/201100678-repair-a-corrupt-database/) is apparently wildly out of date for the new DB structures? **Can we please get some updated instructions so we can check and hopefully repair the new DB structure?**

 ![Screenshot_20210331-053028_2](https://global.discourse-cdn.com/plex/original/3X/1/6/16102df2bd36c38687a536db52c6d8b077ec9be3.jpeg)

I stopped the docker, renamed the main db file and replaced it with my oldest “good” backup from the DB folder. At first this didn’t appear to fix anything as the maintenance ran and failed the backup with a corruption error again.

I stopped the docker, double checked my work by replacing the DB again, and reran the maintenance tasks and this time it appears to have successfully backed up the DB and NOT claimed the DB is corrupt.

Here are debug logs: [Plex Media Server Logs\_2021-03-31\_06-00-06.zip](https://forums.plex.tv/uploads/short-url/xk5DsIsfCoyTWS2jXzXX1sZeS4x.zip) (1.9 MB)

I see errors and warnings in the logs but I’m not entirely clear on what all in the logs specifically indicates DB corruption vs other issues.

---

<div class="post-metadata">

**Author:** ![chaberman43](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@chaberman43](https://forums.plex.tv/u/chaberman43)\
**Post date:** [March 31, 2021, 11:58am UTC](https://forums.plex.tv/t/database-corruption-need-help/705899/2 "2021-03-31T11:58:28Z")

</div>

Well, it looks like rolling my DB back to the 22nd (my oldest plex made backup) may have fixed it? I reran the maintenance window, got a successful DB backup push notice, and no corrupt DB push notice.

I am still seeing a lot of:

```auto
Mar 31, 2021 06:42:16.429 [0x14624b9fc700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:16.457 [0x14630506d700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.
Mar 31, 2021 06:42:16.458 [0x14630506d700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:16.458 [0x1462ce9f4700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:16.543 [0x14630506d700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.
Mar 31, 2021 06:42:16.905 [0x146304a6a700] WARN - Unable to load episode file ["seasons/1/episodes/7.xml"]
Mar 31, 2021 06:42:17.641 [0x146304a6a700] WARN - Unable to load episode file ["seasons/1/episodes/8.xml"]
Mar 31, 2021 06:42:17.645 [0x1462ccbe5700] WARN - MDE: unable to find a working transcode profile for video stream
Mar 31, 2021 06:42:17.645 [0x1462ccbe5700] WARN - MDE: unable to find a working transcode profile for video stream
Mar 31, 2021 06:42:17.695 [0x14630506d700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.
Mar 31, 2021 06:42:21.428 [0x1462ce9f4700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:21.428 [0x14624b9fc700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.
Mar 31, 2021 06:42:21.428 [0x14624b9fc700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:21.428 [0x146304e6c700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:26.428 [0x146304668700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.
Mar 31, 2021 06:42:26.428 [0x146304668700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:26.428 [0x1462cf1f8700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:26.428 [0x1462cdbed700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:31.429 [0x14630506d700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:31.430 [0x146304e6c700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.
Mar 31, 2021 06:42:31.430 [0x146304e6c700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:31.431 [0x1462ce9f4700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:36.430 [0x1462ce9f4700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.
Mar 31, 2021 06:42:36.430 [0x146304e6c700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:36.430 [0x1462ce9f4700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:36.431 [0x146305670700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:41.435 [0x1462ce9f4700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:41.436 [0x14630506d700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.
Mar 31, 2021 06:42:41.436 [0x14630506d700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:42:41.436 [0x146304e6c700] WARN - QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Mar 31, 2021 06:48:35.090 [0x1462ccde6700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.
Mar 31, 2021 06:48:35.302 [0x1462cf1f8700] WARN - QueryParser: Invalid field 'sectionID' found, ignoring.

```

These types of warnings though. Is this normal or something to be concerned about?

New logs, without debug on: [Plex Media Server Logs\_2021-03-31\_06-58-10.zip](https://forums.plex.tv/uploads/short-url/UOQChXVTCSqmn5yb1LECr5zVYH.zip) (1.9 MB)

---

<div class="post-metadata">

**Author:** ![kazz3r24](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/kazz3r24/32/86318_2.png) [@kazz3r24](https://forums.plex.tv/u/kazz3r24)\
**Post date:** [April 5, 2021, 12:03pm UTC](https://forums.plex.tv/t/database-corruption-need-help/705899/3 "2021-04-05T12:03:13Z")

</div>

I’m getting a lot of this in my logs too after fighting with versions and database issues last week. I rolled back my database to a “sane” date and am getting a lot of the above in my logs as well.

The documentation seems to be very out of date now. I would rather see something being “ignored” in logs though than the database slowly taking longer and longer to do things, so this is a step up.

---

<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:** [July 4, 2021, 12:03pm UTC](https://forums.plex.tv/t/database-corruption-need-help/705899/4 "2021-07-04T12:03:47Z")

</div>

Closed on July 4, 2021, 12:03pm UTC

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