Corrupt database every day

Server Version# 1.14.1.5488:

I created a fresh plex install using docker. I did not install any third party plugins, just added the 3 libraries (tv, movie, music), and after a few days the dashboard for all 3 libraries says “There was an unexpected error loading the dashboard Please visit our forums if you continue to experience problems”

I ran sqlite3 “com.plexapp.plugins.library.db” “PRAGMA integrity_check” and it returned OK

These are the last 4 lines of the server log

Mar 24, 2019 22:35:43.874 [0x145eb99e5700] ERROR - SQLITE3:0x10, 11, database corruption at line 59557 of [fc49f556e4]
Mar 24, 2019 22:35:43.874 [0x145eb99e5700] ERROR - SQLITE3:0x10, 11, statement aborts at 44: [insert into statistics_bandwidth (account_id,device_id,timespan,at,lan,bytes) values (:statistics_bandwidth_account_id,:statistics_bandwidth_device_id,:statistics_bandwidth_timespan,:s
Mar 24, 2019 22:35:43.874 [0x145eb99e5700] ERROR - Exception inside transaction (inside=1) (…/Statistics/StatisticsBandwidth.cpp:38): sqlite3_statement_backend::loadOne: database disk image is malformed
Mar 24, 2019 22:35:43.874 [0x145eb99e5700] ERROR - Thread: Uncaught exception running async task which was spawned by thread 0x145ebbdfe700: sqlite3_statement_backend::loadOne: database disk image is malformed

How can i fix this?

I have the same issue. Any resolution?

Nope. I downgraded back to stable version of unraid and it seems to be less frequent.

1 Like

so do you find this issue to be due to unraid?

same version of plex, only difference is a older release of unraid? which did you opt to go with?

For me yes I’m pretty sure it was a problem with unraids “next” release. Downgraded down to the “stable” release of unraid (currently on 6.7.0), and haven’t gotten a corrupt database error since. (I miss the next branch too lol :frowning:)

I’ve been using the latest version of plex aswell. (Currently 1.15.5.994)

That’s odd, I’m running 6.7.0 and still have this issue.

While building thumbnails I keep downloading the database and optimize it just so I have hopefully can restore these progress points so I don’t have to start over each time.

Haha. Yeah. The next day after installing 6.7.0, I ended up getting corrupt database everywhere lol. My dashboard gave me the “There was an unexpected error loading the dashboard” error, but my libraries seemed to load ok from what I could tell.

Going back down to 6.6.7 I guess.

This started on May 12th with me, when I upgraded to unRaid 6.7.0. I thought I had it isolated to adding thumbnails, but today, it has corrupted twice and I have thumbnails disabled!

This is totally unacceptable! Plex and/or unRaid need to get this resolved.

I’ve tried linuxserver, plexinc, and limetech containers, and all three are having the same problem.

I’m going to go back to unRaid 6.6.7, and see if that helps…

If anyone has a clue how to eliminate this, I’m waiting anxiously :slight_smile:

I am also on 6.7.0 and am experiencing this.

Some more details, for me, only my movie libraries are corrupt, audio, and television are working as expected.

Part of my trace:

HubCache: Retrieving '1/movie.by.actor.or.director.5/1/hubs/sections/5/en/count=17&excludeFields=summary&excludePlaylists=1&includeEmpty=1&includeExternalMedia=1&includeExternalMetadata=1&includeFeaturedTags=1&includeStations=1' from the cache.
SQLITE3:(nil), 11, database corruption at line 65066 of [bf8c1b2b7a]
SQLITE3:(nil), 11, statement aborts at 21: [select tags.id as 'tags_id', tags.parent_id as 'tags_parent_id', tags.metadata_item_id as 'tags_metadata_item_id', tags.tag as 'tags_tag', tags.tag_type as 'tags_tag_type', tags.tag_va
Soci Exception handled: sqlite3_statement_backend::loadRS: database disk image is malformed

A lazy way to see which queries are causing your plex to fall over you can navigate to: Discover


And toggle through your libraries until you get this screen, then the /manage/console screen should list the offending sql query for you.

This database corruption started on May 12th, after running the unRaid update from 6.6.7 to 6.7.0. I tried several times to get plex running. I tried the “rebuild your database” tutorials, but nothing worked.

In frustration, I moved all my libraries to another folder with the exception of 20 movies and 5 tv series, roughly 200 videos total, on Monday, the 13th. I have reinstalled Plex at least 3 times daily using the latest build from plexinc, linuxserver.io, and limetech, only to have the corrupted database after one or two hours after the reinstall. Every time!

Each time, I would delete the Plex folder from appdata and reboot my server before reinstalling Plex. One thing I had noticed was the one time I didn’t enable preview and chapter thumbnails, it ran for over 24 hours without being corrupted. To test this, I enabled chapter thumbnails, as a scheduled task. It ran for about 5 hours after the scheduled tasks had run, then I got the database corruption again. I thought I was on to something, so I did another clean install and left the thumbnail options disabled. It ran for about a day and a half, until it crashed, yesterday, the 19th, at 16:07.

I did more reading and googling, and the one thing in common was the unRaid update, from 6.6.7 to 6.7.0.

I removed Plex, deleted its appdata directory, rolled back from 6.7.0 to 6.6.7, and after rebooting my server, reinstalled Plex. This was on the 19th between 16:30 and 16:54. I enabled preview and chapter thumbnails as a scheduled task and when media was added, set all my preferences and settings to what I have always had before setting up my libraries. This put me back to where I was on May 12th, before running the unRaid update.

I added my TV library first and let Plex complete it’s full scan. No corruption. I added my movie library and let it complete it’s complete scan. Still no corruption. All the while, Plex was also generating preview and chapter thumbnails.

Summary: I’m running the latest linuxserver.io Plex container on unRaid 6.6.7 with all the settings and options the way I like them, and all is well. This configuration as run longer than any under unRaid 6.7.0.

Your mileage may vary, but this is working for me!

Are you still running fine? I have tried everything under the sun and the database still corrupts.

I’ve been running in the configuration I described above since the 20th with no errors.

To recap, I’m running unRaid 6.6.7 and the latest linuxserver.io Plex container with zero errors.

Now, I’m afraid to update unRaid at all. I don’t want to go through this hassel again.

Ok, I haven’t downgraded yet, but yeah my database goes corrupt within 24 hours.

I’m still looking into a permanent solution to this. I found this link, https://github.com/binhex/documentation/blob/master/docker/faq/unraid.md, Q7 which I debating trying. I just don’t like the idea of rebuilding everything again, lol, takes to darn long.

I don’t have a cache drive, but I went with mapping it to a direct disk. I am re-adding everything currently. I will let you know if it works.

I don’t use cache drives either. I have over 8000 combined movies and TV episodes, and over 2000 music files. Basically my array is for reading files, not writing and I need the real estate for storage.

I edited the Plex container so that /config lives on a single disk rather than on the array (/mnt/disk1/appdata/PMS), but will wait until I’m willing to spend some downtime before I go from unRaid 6.6.7 back to 6.7.0.

Yea don’t upgrade. Less then 12 hours later. Just doing a refresh meta data to fix something and malformed disk, corrupt db.

Too late, lol. I updated about an hour and a half ago. So far, so good. I’ll see how it goes. I’m hopeful that it won’t crash, but I’m not holding my breath.

I’ve resumed generating preview thumbnails, which seemed to make it crash faster, and have added one TV episode, and it’s still running while I’m watching both TV and Movies. This is farther than I ever got before.

Only time will tell…

Any update? Still no corruption?

I was having he same issues with the corruption.

-Plex running for 4 months with no issues (1700 Movies 245 TV shows at 15000 eppisodes). I had no issues while Unraid was 6.6.7

  • Upgraded to 6.7.0, within a few days DB corruption
  • Downgraded to 6.6.7, put plex appdata on Cache drive, and installed a SSD for just transcoding
  • After a month decided to upgrade to 6.7.0 (did NOT make a backup of plex data first…), while out of town, DB went corrupt again .
    -Downgraded to 6.6.7, rebuilding app data for plex (making backups now)

Not sure how to resolve this issue, as I do like the newer interface of 6.7.0, but I can not keep rebuilding my Plex server every few days, due to corruption. Not sure if anyone else is still seeing the same thing. Makes me wonder if I am better off moving plex back to its own server, and just using a 10Gb connection between the two systems.