Server Upgrade with Database Migration Failure

Server Version#:1.40.2.8395
Player Version#:

I tried installing the latest plex server, downloaded the file, stopped my existing version, installed the new one, then tried starting it. As the log below indicates, it starts to run a database migration but fails and bails out. I have tried dumping the database to SQL and re-importing it but to no avail. What do I need to do to get the plex server up and running again short of wiping it all out and starting over?

… I tried pasting the log here but it refused to let me save it. I uploaded it instead.
Plex Media Server.log (13.2 KB)

which version did you update from?

It’s complaining, which all of the 1.40.x versions do now, if there’s the slightest error in the DB. It’s very strict now.

May 23, 2024 22:06:54.137 [3017820728] ERROR - SQLITE3:0xb7fbaf74, 267, statement aborts at 10: [update metadata_items set originally_available_at = iif(typeof(originally_available_at) in (‘integer’, ‘real’), originally_available_at, strftime(‘%s’, originally_available_at)), available_at = iif(typeof(available_at) in (‘integer’, ‘real’), available_at, strftime(‘%s’, available_at, ‘utc’)), expires_at = iif(typeof(expires_at) in (‘integer’, ‘real’), expires_at, strftime(‘%s’, expires_at, ‘utc’)), refreshed_at = iif(typeof(refreshed_at) in (‘integer’, ‘real’), refreshed_at, strftime(‘%s’, refreshed_at, ‘utc’)), added_at = iif(typeof(added_at) in (‘integer’, ‘real’), added_at, strftime(‘%s’, added_at, ‘utc’)), created_at = iif(typeof(created_at) in (‘integer’, ‘real’), created_at, strftime(‘%s’, created_at, ‘utc’)), updated_at = ii
May 23, 2024 22:06:54.178 [3017820728] ERROR - Exception inside transaction (inside=1) (/home/runner/actions-runner/_work/plex-media-server/plex-media-server/Library/DatabaseMigrations.cpp:293): sqlite3_statement_backend::loadOne: database disk image is malformed

If it’s easier - Options -

  1. Try my DBRepair in case this is a simple corruption in the DB.
  2. Save the DBs (move off to the side)
  3. Create fresh
  4. Import watch history from the old DB.
  5. Delete old DB after all data import verified.

I think the version I upgraded from was 1.28?
I tried the repair utility and it said that the main database was corrupt. It exported it and loaded it again and the utility said the main database was okay. I started the plex server and it failed with the same error message. I had the utility check the databases again and it says they are okay still, but the server won’t start.
I think my only option is to back up the databases and clear them and start over.

Yes, that is probably the best course of action

with,

Import the watch history (or Plex Cloud Sync – if you had that enabled)

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