Chiming in because I saw your post on the github and I have the exact same issue.
Description: I’ve done all the manual repair, backup restore, auto repair, manual repair with vacuum and index… nothing, whenever I do a search the logs show me the error with “database image is malformed” and new files don’t get picked up by the agents.
I have managed to get it to add more content by changing the scanner and agent to legacy and then back to the new one, that’s the only way it works, and only for TV not for movies.
@ChuckPa had asked to be pinged in the github message, so I am doing so.
Sure thing. I just have the script file in by resources folder (Linux installation) but I don’t see any log files (text, zip, or otherwise) even with a 99 exit. Where would it be storing the logs?
Your DBRepair logs show me the SQL database structure finally iterated into sanity.
The PMS logs show me corruption of the data in those records.
Aug 14, 2024 20:07:30.090 [136368335289144] DEBUG - [Album] Creating album 'Under the Influence with Terry O'Reilly' for artist 'Apostrophe Podcast Network'
Aug 14, 2024 20:07:30.095 [136368335289144] ERROR - [Album] SQLITE3:0x80000001, 267, statement aborts at 182: [update metadata_items set guid=?,hash=? where id=?] database disk image is malformed
Aug 14, 2024 20:07:30.095 [136368335289144] ERROR - [Album] Exception inside transaction (inside=1) (/home/runner/actions-runner/_work/plex-media-server/plex-media-server/Library/MetadataItem.cpp:1139): sqlite3_statement_backend::loadOne: database disk image is malformed
Aug 14, 2024 20:07:30.096 [136368335289144] ERROR - Exception inside transaction (inside=1) (/home/runner/actions-runner/_work/plex-media-server/plex-media-server/Library/MetadataItem.cpp:3847): sqlite3_statement_backend::loadOne: database disk image is malformed
Aug 14, 2024 20:07:30.096 [136368335289144] ERROR - Exception assimilating media item in Under the Influence with Terry O'Reilly: sqlite3_statement_backend::loadOne: database disk image is malformed
Aug 14, 2024 20:07:30.096 [136368335289144] DEBUG - Looking for path match for [/mnt/treunas/podcasts/Under the Influence with Terry O'Reilly/aad371140a09579c2c13698a870740ac.mp3]
The choice is yours:
Delete and recreate the “Podcasts” library section, hoping for the best
-or-
KEEP this database (for it’s watch history)
wipe everything, including the bad backups, out and start fresh.
Oh that’s good to know. I thought I may have to start from scratch, but deleting the Podcasts one is absolutely not an issue. Hopefully this also fixes my problem with new scans I’ve had lately! I’ll keep you updated.
Okay, I just deleted my music library altogether. Scans still don’t work, exact searches now return results, but I still get errors for keyword searches along with “unknown metadata type: folder” and the only way to update folders / scan new content is still to revert to the legacy agents.
edit okay this is interesting. When I delete my music library it just re-appears after a few seconds.
This seems to line up with what I’ve seen in other threads where people have issues with properly configured media is not getting added, but they can’t save changes to the library if they try to edit it.
Also I have checked and I have 1TB free on my SSD, and 150GB free on my linux partition on that 2TB SSD so that’s not the issue either.
These are almost always cases where the database is corrupt.
“malformed” can be one of two things:
The database files where records are damaged (not proper SQL records)
These are the type which my program can fix to a certain level.
The database files where the records are intact but the data in them is garbage / incorrect. My tool cannot resolve these because it doesn’t know how to interpret all the data stored there. That’s what PMS does.
Regarding the errors:
That’s a bad DB record. The contents of the record are junk / damaged.
This is full SQLite DB file damage. My tool can usually fix these.
Metadata : Folder – IGNORE it. Engineering never handled it.
Interesting. So 1 is probably not fixable by your tool but 2 is? In which case erasing everything is the only fix? Or can I find those records full of garbage and just delete them somehow?
Doesn’t look like that’s the case for me this time around so I’m trying to find a way to save my customizations now. This is where having NFO files would be helpful.