Help recovering a malformed database

Server Version#: 1.40.2.8395
The other day I started noticing that my Plex docker image kept soft-locking once every 24 hours or so. Looking at the logs, I saw several errors like this stating the database is malformed:

May 23, 2024 08:17:16.900 [23036882406032] ERROR - [DatabaseFixups] SQLITE3:0x80000001, 267, statement aborts at 169: [update metadata_items set extra_data=? where metadata_type=? and library_section_id=? and id=?] database disk image is malformed
May 23, 2024 08:17:16.900 [23036882406032] ERROR - [DatabaseFixups] Exception inside transaction (inside=1) (/home/runner/actions-runner/_work/plex-media-server/plex-media-server/Library/MetadataCollection.cpp:525): sqlite3_statement_backend::loadOne: database disk image is malformed

So I tried running ChuckPa’s DBRepair script, starting with the “automatic” option. This ended up showing these errors. I chose the option to ignore the errors and continue, but when I started Plex back up, the logs still reported the database as malformed, and now I get an error message in the webUI “Something went wrong. Make sure the server is available and try again.” when trying to add any media to a playlist (Though it does seem to add it anyway). Trying to change any media’s metadata will also result in an error, and the metadata will remain unchanged. I have also noticed that clicking on any given playlist in the WebUI will fail to load it. This would be really bad, I spent a LOT of time curating playlists. The search function also seems to no longer work? I haven’t had enough time to let the server idle to test if it still soft-locks, though.

The next morning, I tried to use the option in the script to restore a previous working backup. When the script looked for database backups, there was one from this morning, as well as a few from… a year ago? It “checked” the database from this morning and said it had no errors, which didn’t seem right, but it imported it regardless. Running the Automatic option again reported no errors, so I started up Plex again… and I’m still seeing the playlist add error and still seeing malformed database errors in the logs. Now when I try and run the repair script again, it is unable to stop PMS at all. Is my database screwed? Is there anything I can do to recover it?

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