Corrupted Database Upon Upgrade

Server Version#: Plex Media Server v1.43.1.10576-06378
Player Version#: N/A

After upgrading to the latest version of Plex Media Server, the application fails to migrate the database and a corrupt database error message pops up. I went through the database validation steps using SqlLite3 and ensured the database itself was healthy. Rolling back to the previous version allows the application to start normally.

The log seems to indicate a malformed JSON in the query.

Apr 08, 2026 11:53:03.769 [14412] WARN - [CERT/OCSP] getCertInfo failed; skipping stapling
Apr 08, 2026 11:53:03.771 [14412] INFO - Running migrations. (EPG 0)
Apr 08, 2026 11:53:03.803 [14412] INFO - Running forward migration 202601121053.
Apr 08, 2026 11:53:05.050 [14412] ERROR - SQLITE3:(nil), 1, statement aborts at 19: [select distinct metadata_items.id, metadata_items.extra_data from media_items join media_streams on media_items.id=media_streams.media_item_id join metadata_items on metadata_items.id=media_items.metadata_item_id where media_streams.stream_type_id = 1 and ifnull(media_streams.extra_data ->> ‘ma:orientation’, ‘0’) in (‘6’, ‘8’)] malformed JSON

9 Likes

I am having the same issue on Windows 11 and upgrading to v1.43.1.10576-06378. Rolling back to 1.43.0.10492 and it is able to launch.

3 Likes

I also have the same issue on unRAID, running PMS in a linuxserver docker container. Intel iGPU for hardware transcoding.

Manually validating the sqlitedb and using ChuckPA’s DBRepair util did not detect any issues.

Reverting to 1.43.0, using the same database, everything operates normally.

3 Likes

Same issue on unraid database malformed after the update had to restore a previous database as repair couldn’t fix it

1 Like

so…if I upgraded to the latest version and DON”T get an error, then it should be a ok?

I wrestled with it for a while and then just restored the whole drive from Monday’s backup. I’m very glad that I put the server on a separate NUC and that’s the only thing on it.

Looking forward to the fixed version.

Same issue on Windows. Tried fixing the database but that did not help. Had to reinstall the previous version to get it running.

If you’re seeing this issue please download your logs (the entire zip) and share them here or with me.

Please be careful which SQLlite tool you are using. Plex uses a custom version bundled with plex that will get corrupt if you use regular SQLLite.

Also, after restoring did you use Chuck’s script to repair the database, and attempt upgrading again? Often times database corruption is only discovered during the upgrade process due to the initial damage being isolated to a rarely used part of the database.

Update pms before 30 minutes- no issues. Windows server 2025

Hmm, that’s good to know. I sometimes change media paths via SQLite editor. Up until now I never had a problem with that.

Can somebody provide me with a copy of their database? I’ll open my DMs.

The same error on Synology NAS. And the server doesn’t allow me to roll back to the previous version, it says that a more recent version is installed.

ERROR - SQLITE3:0x80000001, 1, statement aborts at 19: [select distinct metadata_items.id, metadata_items.extra_data from media_items join media_streams on media_items.id=media_streams.media_it
em_id join metadata_items on metadata_items.id=media_items.metadata_item_id where media_streams.stream_type_id = 1 and ifnull(media_streams.extra_data ->> ‘ma:orientation’, ‘0’) in (‘6’, ‘8’)] malformed JSON
Apr 09, 2026 10:25:55.585 [140122768587408] ERROR - Exception inside transaction (inside=1) (/home/runner/_work/plex-media-server/plex-media-server/Library/DatabaseMigrations.cpp:342): sqlite3_statement_backend::loadRS: malformed JSON
Apr 09, 2026 10:25:55.587 [140122768587408] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::loadRS: malformed JSON
Apr 09, 2026 10:25:55.587 [140122768587408] ERROR - Database corruption: sqlite3_statement_backend::loadRS: malformed JSON
Apr 09, 2026 10:25:55.587 [140122768587408] ERROR - Error: Unable to set up server: sqlite3_statement_backend::loadRS: malformed JSON (N4soci10soci_errorE)

I have my restored database I can send if that helps…

Thanks @brunix86 for the database.

I found a database row which had malformed JSON in the database which was causing our database migration to fail. I’m not sure exactly why that one row is bad but for now we’ll just do an extra check to ensure the json is valid before running the migration.

I’ll update here when the fix is pushed out.

4 Likes

No worries, have already received one from another user.

1 Like

No problem

I woke up to my docker container having automatically upgraded and emails telling me that it had failed to start properly.

Tried to restore a backup from before the upgrade (I’ve never had to do it in UnRaid - said it was successfull but the container still claimed to be up to date!)

Hit up Gemini with the errors, ran a few suggested things and it started to work for me!

I am running on 1.43.1.10576 now and all seems to be okay.

It looks like it was more a permissions issue that anything else!

This is what fixed it for me -

# Reset ownership for the Unraid ‘nobody’ user (99) and ‘users’ group (100)
chown -R 99:100 /mnt/cache/appdata/plex

Set permissions so the container can write

chmod -R 777 /mnt/cache/appdata/plex

I appreciate you checking - yeah, I had followed the Plex documentation for repairing a corrupt database as well as the Powershell variant from https://github.com/ChuckPa/DBRepair/tree/master/Windows

1 Like

So… how would we see if this is happening to our install of PMS?