# Database corruption

**URL:** https://forums.plex.tv/t/database-corruption/839190
**Category:** Plex Media Server
**Tags:** server-mac
**Created:** [April 25, 2023, 7:39pm UTC](https://forums.plex.tv/t/database-corruption/839190 "2023-04-25T19:39:33Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![pshanew](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/pshanew/32/160555_2.png) [@pshanew](https://forums.plex.tv/u/pshanew)
#### Post date: [April 25, 2023, 7:50pm UTC](https://forums.plex.tv/t/database-corruption/839190/2 "2023-04-25T19:50:23Z")

</div>

You’ve still got database corruption:

```auto
Apr 25, 2023 20:58:03.143 [0x70000f1bd000] ERROR - [Req#685] SQLITE3:(nil), 11, database corruption at line 84326 of [a29f994989]
...
Apr 25, 2023 20:58:03.143 [0x70000f1bd000] ERROR - [Req#685] SQLITE3:(nil), 11, statement aborts at 34: [select taggings.id, count(*) as taggings_count from tags join taggings on taggings.tag_id=tags.id join taggings as related on taggings.tag_id=related.tag_id join metadata_items on metadata_items.id=related.metadata_item_id where taggings.metadata_item_id=? and metadata_items.library_section_id=? and tags.tag != '' group by taggings.id;] database disk image is malformed
Apr 25, 2023 20:58:03.144 [0x70000f1bd000] ERROR - Got exception from request handler: sqlite3_statement_backend::loadRS: database disk image is malformed

```

That’s going to need to be dealt with before you try to fix anything else. You may want to give @ChuckPa’s [excellent DBRepair.sh script a shot](https://forums.plex.tv/t/plexdbrepair-development/822684/210).

If the database cannot be repaired, your best bet would be to [restore your most recent good backup](https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/).

---

_[View the full topic](https://forums.plex.tv/t/database-corruption/839190)._
