Server Crashes after updating to DSM 7.1-42661

I just updated from DSM 7.0 to DSM 7.1-42661. Plex had been running fine on 7.0, but after updating to 7.1 it crashes when I try to run the server. I checked the permissions on my shared folders and they were fine.

FWIW, I uninstalled 1.28.1-6018 and reinstalled 1.27.2.5929.
1.27 is working in 7.1. I tried upgrading to 1.28 after figuring out that 1.27 works and 1.28 still crashes. So back to 1.27 it is.

Server Version#: 1.28.1.6018-7000

Can you post your server logs? odds are you probably have database corruption.

Here are the logs. Some are from 1.27 and some are from 1.28.
Plex Media Server Logs_2022-08-03_20-42-23.zip (240.8 KB)

Database corrupted

Aug 03, 2022 20:08:46.926 [0x7f3c39ea21c0] INFO - Vacuuming database.
Aug 03, 2022 20:08:48.350 [0x7f3c39ea21c0] ERROR - SQLITE3:0x80000001, 11, database corruption at line 67183 of [1b256d97b5]
Aug 03, 2022 20:08:48.350 [0x7f3c39ea21c0] ERROR - SQLITE3:0x80000001, 11, statement aborts at 9: [INSERT INTO vacuum_db.'statistics_bandwidth' SELECT*FROM"main".'statistics_bandwidth'] database disk image is malformed
Aug 03, 2022 20:08:48.375 [0x7f3c39ea21c0] ERROR - SQLITE3:0x80000001, 11, statement aborts at 1: [VACUUM] database disk image is malformed
Aug 03, 2022 20:08:48.385 [0x7f3c39ea21c0] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::loadOne: database disk image is malformed
Aug 03, 2022 20:08:48.414 [0x7f3c39ea21c0] DEBUG - ChangestampAllocator: initialized to 1206839
Aug 03, 2022 20:08:48.419 [0x7f3c39ea21c0] DEBUG - Opening 2 database sessions to library (com.plexapp.plugins.library.blobs), SQLite 3.35.5, threadsafe=1
Aug 03, 2022 20:08:48.426 [0x7f3c39ea21c0] INFO - Running migrations. (EPG 0)

I have a new FAQ #31 which shows how to recover from this by using a known good backup.

PLEASE LET ME KNOW if it’s confusing in any way.

I also have this problem, here is my startup crash:
Aug 04, 2022 16:02:35: Failed to initialize logging: Error parsing file at “/var/packages/PlexMediaServer/shares/PlexMediaServer/AppData/Plex Media Server/Preferences.xml”

I am seeing this same error as well when my NAS was shut down unexpectedly due to a power outage.

Failed to initialize logging: Error parsing file at “/var/packages/PlexMediaServer/shares/PlexMediaServer/AppData/Plex Media Server/Preferences.xml”

Thanks @ChuckPa. When I went to swap an old database file, the most recent one is from 2020! The library.blobs.db files are from 2022, but not the library.db backup files. Very strange. If I swap in a library from 2020, am I going to lose all my watch history? I’ve added probably 70% of my library since 2020.

I might be able to grab a more recent snapshot of the database file from my backup NAS.

@DigitalKloc

If the Watch history isn’t damaged, we can extract it from the DB and then add it back in AFTER you’ve switched the DB and re-added the media you acquired since then.

That is when the database corruption probably initially happened. Id love to have plex do more robust monitoring/alerting.

Restoring from my 2020 database worked! I upgraded to 1.28.1.6041 without issue after restoring my db. It looks like my watch history is mostly there, so no need to extract it from the damaged db. Thank you so much for your help.