# There was an unexpected error loading this library. DB Corrupt

**URL:** <https://forums.plex.tv/t/there-was-an-unexpected-error-loading-this-library-db-corrupt/614083>\
**Category:** Plex Media Server\
**Tags:** server-windows\
**Created:** [July 16, 2020, 3:28am UTC](https://forums.plex.tv/t/there-was-an-unexpected-error-loading-this-library-db-corrupt/614083 "2020-07-16T03:28:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hjb3](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@hjb3](https://forums.plex.tv/u/hjb3)\
**Post date:** [July 16, 2020, 3:28am UTC](https://forums.plex.tv/t/there-was-an-unexpected-error-loading-this-library-db-corrupt/614083/1 "2020-07-16T03:28:03Z")

</div>

Server Version#: 1.19.5.3035-864bbcbb7  
Player Version#: 4.34.3

First the Plex App on my android works as expected.  
When I browse to localhost:32400 I get  
There was an unexpected error loading this library when I try to browse movie Library, Recommended and Playlist sections work as expected.

When I go to TV Shows I get the same error on Recommended yet Library and Playlist work as expected.

My Roku devices exhibit the same behavior, I can do a search and play movie with no problem.

I have tried reinstalling, rebooting and performed the repair DB with not luck

> **[Repair a Corrupt Database | Plex Support](https://support.plex.tv/articles/201100678-repair-a-corrupt-database/)**
>
> Though rare, it is possible for your main Plex Media Server database to become corrupted. For instance, it might happen...

When I run `sqlite3 com.plexapp.plugins.library.db < dump.sql` I get file size of 0

Plex Media Server Logs shows  
MessageSQLITE3:0x8a40ec8, 11, database corruption at line 64757 of [bf8c1b2b7a]

MessageSQLITE3:0x8a40ec8, 11, database corruption at line 64798 of [bf8c1b2b7a]

SQLITE3:0x8a40ec8, 11, statement aborts at 59: [select distinct media\_items.id as ‘media\_items\_id’, media\_items.library\_section\_id as ‘media\_items\_library\_section\_id’, media\_items.section\_location\_id as 'media\_items\_section\_location

Soci Exception handled: sqlite3\_statement\_backend::loadRS: database disk image is malformed

Can I drop media items and add them back?

---

<div class="post-metadata">

**Author:** ![NewPlaza](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/newplaza/32/128634_2.png) [@NewPlaza](https://forums.plex.tv/u/NewPlaza)\
**Post date:** [July 16, 2020, 3:51am UTC](https://forums.plex.tv/t/there-was-an-unexpected-error-loading-this-library-db-corrupt/614083/2 "2020-07-16T03:51:09Z")

</div>

Repairing the db does not always have a 100% success rate. Meaning, while it might repair alot or even most errors, it may not get them all.  
Depending when the corruption started you may be able to restore from one of your backups(com.plexapp.plugins.library.db-xxxx-xx-xx). Where xxxx-xx-xx is the year-month-day. You should have about 3 backups available. If you don’t have any then the option may be disabled.

> **[Scheduled Tasks | Plex Support](https://support.plex.tv/articles/201553286-scheduled-tasks/)**
>
> Plex Media Server settings related maintenance performed via Scheduled Tasks. You can access these under Settings \> Server \> Scheduled...

  
Enable it if so.

---

<div class="post-metadata">

**Author:** ![hjb3](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@hjb3](https://forums.plex.tv/u/hjb3)\
**Post date:** [July 16, 2020, 3:55am UTC](https://forums.plex.tv/t/there-was-an-unexpected-error-loading-this-library-db-corrupt/614083/3 "2020-07-16T03:55:05Z")

</div>

Thank you! That fixed it.

---

<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:** [October 14, 2020, 4:04am UTC](https://forums.plex.tv/t/there-was-an-unexpected-error-loading-this-library-db-corrupt/614083/4 "2020-10-14T04:04:17Z")

</div>

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