Aug 11, 2022 14:46:22.738 [0x7f706203db38] ERROR - [DatabaseFixups] SQLITE3:0x80000001, 1, no such column: metadata_items.edition_title in "select metadata_items.id as ‘metadata_items_id’, metadata_items.library_section_id as ‘metadata_items_library_section_id’, metadata_items.parent_id as 'metadata
SQLite version 3.35.5 2021-04-19 18:32:05
Enter “.help” for usage hints.
sqlite> PRAGMA integrity_check;
*** in database main ***
Page 157636: btreeInitPage() returns error code 11
row 4423 missing from index index_statistics_media_on_at
row 4424 missing from index index_statistics_media_on_at
row 4426 missing from index index_statistics_media_on_at
row 4427 missing from index index_statistics_media_on_at
row 4428 missing from index index_statistics_media_on_at
row 4429 missing from index index_statistics_media_on_at
row 4430 missing from index index_statistics_media_on_at
row 4431 missing from index index_statistics_media_on_at
row 4438 missing from index index_statistics_media_on_at
Error: database disk image is malformed
sqlite> VACUUM;
Error: database disk image is malformed
sqlite>
The error reported is a bad Index and a missing column not a missing table.
If you would use Plex SQLite to run the integrity check, you’ll get best results. Plex SQLite contains additional modules not found in normal SQLite
sudo bash
cd "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
"/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db 'PRAGMA integrity_check(1)'
"/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.blobs.db 'PRAGMA integrity_check(1)'
The next test is to look at the matching backups of both the library.db and library.blobs.db
If you have them (you should), you can recover (using copy) to those and then scan files and refresh metadata to pick up any changes made since that time.
As alternative, you can run it manually or try a tool we’re developing. (it automates this type of recovery)
dump your existing DB as a .sql output file,
move the existing out of the way
import the SQL files to recreate the missing index rows.
Yes I noted altering the table adding the missing column. I will run the integrity checks as you checks as you suggest. I’ve already reverted back to the working snapshot for some Sunday night plexertainment.
I dumped library.db and library.blobs.db, stopped plex, removed the database file, started plex, and imported the dump files. I got a bunch of unique key constraint voilations, but much of the data did import. Unfortunately all of my libraries are empty.
Any suggestions? How can I try the tool that is being developed?
I was able to use your utility to repair the database prior to upgrade. Both the repair and upgrade were successful. Thank you for your help with this.
The interface is nice. I found it very easy to use, but I’ve been using command line linux systems since 1997. I think if a regular user were to encounter this utility they would find it easy to use as well.
It’s my hope that, after more testing, with additional “Try to break it” testing, it will be included as a utility in the regular linux-based PMS packages.
It seems you and I have been around Linux for equally long time.
I remember when the 0.98 kernel was released and we were all excited to get it installed … hahahah