Plex is unable to empty Music Library Trash

Server Version#: 1.28.0.5999
Player Version#: Web 4.88.1

I noticed one of my albums was never emptying it’s trash, causing an odd situation where I have 4 listings of each track in the album, but only one plays. I knew it was trash related ,since I had moved the files around, so I tried to empty the trash, but am met with the error: There was a problem emptying the trash.

I did enable Verbose logs, as it’s what I was using to troubleshoot beforehand, and saw this line:

Aug 09, 2022 14:11:35.560 [0x14a58e0f2b38] ERROR - [Req#822e] SQLITE3:0x80000001, 779, index corruption at line 91877 of [1b256d97b5]

Which leads me to believe its some sort of database corruption. I followed the basic version of this guide in hopes of fixing it with the "/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db ".output recover.out" ".recover" command, but no luck. Still unable to empty the trash. Ive turned off the verbose logging, and attached logs where I try to empty the trash twice: Aug 09, 2022 14:29:04.480 [0x15432be9fb38] INFO - Plex Media Server v1.28.0.5999 - Pastebin.com

Aug 09, 2022 14:29:07.567 [0x1543297e0b38] ERROR - [DatabaseFixups] SQLITE3:0x80000001, 779, index corruption at line 91877 of [1b256d97b5]
Aug 09, 2022 14:29:07.567 [0x1543297e0b38] ERROR - [DatabaseFixups] SQLITE3:0x80000001, 779, statement aborts at 41: [delete from activities where started_at < ?] database disk image is malformed
Aug 09, 2022 14:29:07.568 [0x1543297e0b38] ERROR - [DatabaseFixups] Fixup 31DatabaseFixupsCleanupActivities threw an exception: sqlite3_statement_backend::loadOne: database disk image is malformed

The database is corrupt. Until that is resolved the system will be unstable.

You’ve three choices:

  1. Repair
  2. Restore from backup
  3. Delete & start over.

Based on the reddit article, the syntax on unraid is different than other platforms. Here’s the Plex support article: Repair a Corrupted Database. You can use the Reddit article to get the syntax correct.

If repair fails, you can try restoring from a backup. See Restore a Database Backed Up via ‘Scheduled Tasks’. You may want to check the backup versions for corruption, as it is not possible to tell when the original corruption occurred.

If the database cannot be repaired or restored, then you will have to delete it and start over. See the “Repair…” article for additional information (basically, stop Plex, make a backup of the Databases folder, delete everything in the Databases folder, start Plex). You will have to re-create all libraries and re-share with any friends. Your media files are not affected.

Ended up following the rest of the guide (which I should have before posting) to dump the data and reimport it manually instead of relying on the automatic tool, and that fixed it.

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