Plex won't start because of corrupted DB

Server Version#: latest, can’t check

Hi everyone, I’m running plex on unraid. Today I got this error after a restart:

ibc++abi: terminating with uncaught exception of type soci::soci_error: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=512
****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /config/Library/Application Support/Plex Media Server/Crash Reports/1.43.0.10492-121068a07/PLEX MEDIA SERVER/8406dd53-15fc-4109-07d561b5-cd33b4f1.dmp

What can I do to solve it? should I contact the server support directly?

This is the support process.

I would start with https://github.com/ChuckPa/PlexDBRepair

Thanks for the suggestion.

I tried it, first I went with automation and reindex, but it didn’t work.

Then I tried repair and now the error log changed to

[custom-init] No custom files found, skipping… Starting Plex Media Server. . . (you can ignore the libusb_init error) Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: schema_migrations for SQL: select version from schema_migrations order by version (N4soci10soci_errorE) Starting Plex Media Server. . . (you can ignore the libusb_init error)
Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: schema_migrations for SQL: select version from schema_migrations order by version (N4soci10soci_errorE)
Starting Plex Media Server. . . (you can ignore the libusb_init error)
Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: schema_migrations for SQL: select version from schema_migrations order by version (N4soci10soci_errorE)
****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /config/Library/Application Support/Plex Media Server/Crash Reports/1.43.0.10492-121068a07/PLEX MEDIA SERVER/85042354-5b5d-4c85-93e5f28d-cd4f5b69.dmp

and if I check the db again I got this

Enter command # -or- command name (4 char min) : 3

Checking the PMS databases
Check complete. PMS main database is OK.
Check complete. PMS blobs database is OK.

Checking FTS (Full-Text Search) indexes
No FTS4 tables found in main database.

Enter command # -or- command name (4 char min) : 6

Backing up of databases
Backup current databases with ‘-BACKUP-2026-04-08_12.12.15’ timestamp.
Reindexing main database
Reindexing main database successful.
Reindexing blobs database
Reindexing blobs database successful.
Reindex complete.

Checking FTS (Full-Text Search) indexes
No FTS4 tables found in main database.

anything else I can try?

The DB is only 4k while the backupls are 120MB:

Your database may be beyond repair then. Last resort is deleting and starting over.

Can’t I recover from one of the backup? the 4/04 would be perfect

That would have been option 9 of the repair script.

ended up restoring a backup and now it works properly. Still not sure why the db died like that :frowning: