Updated, and now all libraries get "Something Went Wrong" - logs say "BAD CAST"

Windows 10 based server on my PC.
I just updated to the latest server version advertised today.

Now all libraries say “something went wrong” and say “Try Again”.

Server logs say “Exception handled: Bad Cast”

Nothing works anymore :frowning:

This happens using the WEB interface and the Plex Media Player, all local on the machine hosting the server.

Please upload a zip with PMS logs

here you go…
Logs.zip (5.6 MB)

NOTE:
I have restored yesterdays server installation and clobbered the new update.
These are the logs from the updated server before I rolled it back.

All I did was click “update” and waited for it to finish.
Never worked after that.

Sadly, you have a broken database, so the update failed :frowning:

From your log when still on v1.25.9.5721-965587f64:

Apr 27, 2022 14:02:14.218 [8596] ERROR - [DatabaseFixups] SQLITE3:0xcdfd2fb3, 779, index corruption at line 91877 of [1b256d97b5]
Apr 27, 2022 14:02:14.218 [8596] ERROR - [DatabaseFixups] SQLITE3:0xcdfd2fb3, 779, statement aborts at 28: [delete from media_parts where media_item_id=?] database disk image is malformed

I recommend you fix your database, as outlined here:

If above is not working for you, let us know

OK, so I’ve already restored the previous installation from yesterday and deleted the updated/failed one.

I’ll retry the update after cleaning and compacting/optimizing the DB.

been following another thread and same problem after this last update. Going to try what was reported here but I believe this last update created a bigger problem. Here is the other forum thread [Black screen on all media after updating to 1.42.1 - Plex Players / Desktop Players - Plex Forum] (Black screen on all media after updating to 1.42.1 - #34 by Grademan123)

I have attempted to upgrade again.

This time I used the installer available on the website, since it is actually a slightly newer version than the one the updater uses.

Same issue.
Database corruption.

Below is the output of the diagnosis of the DB, showing all the errors found after the upgrade.

row 2223 missing from index index_media_parts_on_directory_id
row 2298 missing from index index_media_parts_on_directory_id
row 2301 missing from index index_media_parts_on_hash
row 2301 missing from index index_media_parts_on_media_item_id
row 2301 missing from index index_media_parts_on_directory_id
row 2305 missing from index index_media_parts_on_directory_id
row 2307 missing from index index_media_parts_on_directory_id
wrong # of entries in index index_media_parts_on_hash
wrong # of entries in index index_media_parts_on_media_item_id
wrong # of entries in index index_media_parts_on_directory_id
wrong # of entries in index index_media_items_on_ends_at
wrong # of entries in index index_media_items_on_begins_at
wrong # of entries in index index_media_items_on_media_analysis_version
row 9914 missing from index index_media_streams_on_language
row 9914 missing from index index_media_streams_on_media_item_id
row 9914 missing from index index_media_streams_on_media_part_id
wrong # of entries in index index_media_streams_on_language
wrong # of entries in index index_media_streams_on_media_item_id
wrong # of entries in index index_media_streams_on_media_part_id
row 2405 missing from index index_title_sort_icu
row 2405 missing from index index_metadata_items_on_remote
row 2405 missing from index index_metadata_items_on_absolute_index
row 2405 missing from index index_metadata_items_on_original_title
row 2405 missing from index index_metadata_items_on_resources_changed_at
row 2405 missing from index index_metadata_items_on_changed_at
row 2405 missing from index index_metadata_items_on_originally_available_at
row 2405 missing from index index_metadata_items_on_added_at
row 2405 missing from index index_metadata_items_on_hash
row 2405 missing from index index_metadata_items_on_library_section_id_and_metadata_type_and_added_at
row 2405 missing from index index_metadata_items_on_deleted_at
row 2405 missing from index index_metadata_items_on_metadata_type
row 2405 missing from index index_metadata_items_on_guid
row 2405 missing from index index_metadata_items_on_title_sort
row 2405 missing from index index_metadata_items_on_title
row 2405 missing from index index_metadata_items_on_index
row 2405 missing from index index_metadata_items_on_created_at
row 2405 missing from index index_metadata_items_on_parent_id
row 2405 missing from index index_metadata_items_on_library_section_id
wrong # of entries in index index_title_sort_icu
wrong # of entries in index index_metadata_items_on_remote
wrong # of entries in index index_metadata_items_on_absolute_index
wrong # of entries in index index_metadata_items_on_original_title
wrong # of entries in index index_metadata_items_on_resources_changed_at
wrong # of entries in index index_metadata_items_on_changed_at
wrong # of entries in index index_metadata_items_on_originally_available_at
wrong # of entries in index index_metadata_items_on_added_at
wrong # of entries in index index_metadata_items_on_hash
wrong # of entries in index index_metadata_items_on_library_section_id_and_metadata_type_and_added_at
wrong # of entries in index index_metadata_items_on_deleted_at
wrong # of entries in index index_metadata_items_on_metadata_type
wrong # of entries in index index_metadata_items_on_guid
wrong # of entries in index index_metadata_items_on_title_sort
wrong # of entries in index index_metadata_items_on_title
wrong # of entries in index index_metadata_items_on_index
wrong # of entries in index index_metadata_items_on_created_at
wrong # of entries in index index_metadata_items_on_parent_id
wrong # of entries in index index_metadata_items_on_library_section_id
wrong # of entries in index index_media_part_settings_on_changed_at

The restored database was also broken!

State what version of PMS you try and upgrade towards, and then power off PMS, zip the database and upload to like Dropbox

Then DM me the download url

I just attempted to repair the DB using the steps located at the following link…

The initial step that attempts to “reassemble your database with all the valid data it can find in your file.” did NOT work.

The Manual process appears to have fixed it though.

After performing the export/delete original/re-import process, I see all my media.

So, it seems that this latest update, along with the current “fresh installer” on the website BOTH are causing DB corruption.

Any thoughts on what might be happening or what I can do to assist folks in further tracking down the issue?

If database was broken before the upgrade, it’ll break even more, and that’s what happens

You can setup, so an alarm will be send to your mobile

Ref: Push Notifications | Plex Support

Very interesting.

To check and see what happened, I restored the complete installation from two days ago that was working.
I then ran a diagnosis on the DB and it showed all the errors that i posted above.

So, it seems that my DB was broken, but still working?!!

When I did the upgrade, it clobbered things.

How is it that the DB was this corrupt to start, but the server was still operational?
That seems like something that the installer should check for BEFORE it installs, no?

In v1.26 we changed the date format of some fields, so this might cause it.

And not an installer specialist :wink:

wish the dev team would fix this over a week no local library unless I play on my computer with VLC. nothing seems to fix it.

Plex Database Repair (MAC)

cd /Users/HOME/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases

Check

“/Applications/Plex Media Server.app/Contents/MacOS/Plex SQLite” com.plexapp.plugins.library.db “PRAGMA integrity_check”

Dump

“/Applications/Plex Media Server.app/Contents/MacOS/Plex SQLite” com.plexapp.plugins.library.db “.output dump.sql” “.dump”

Make a backup copy and delete com.plexapp.plugins.library.db

Open the dump.sql file with an editor and look for corruption you’ll see a line like “CORRUPTION ERROR” with a bunch of **** around it. you can delete all the lines you find, change the very bottom from “rollback” to “commit”, and save.

“/Applications/Plex Media Server.app/Contents/MacOS/Plex SQLite” com.plexapp.plugins.library.db “.read dump.sql”

Done.

As the last option, it should work

Kinda needs more details here :wink:

Since the Plex Web update 4.76.1 I cannot see my local media on Plex Web or on my TVs. I am able to play the media on my local computer using VLC. It was fine on 4.69.1 version

If you have a corrupted database, that’s easy enough to check.
Follow the step above posted earlier to test it.

Follow that guide to resolve what you can about the DB.

Your logs indicate, that you indeed have a broken datebase

Apr 27, 2022 17:54:43.953 [2056] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::loadOne: database disk image is malformed

Also, your logs indicate, that you where on version:

Apr 27, 2022 17:54:43.344 [18496] INFO - Plex Media Server v1.26.0.5715-8cf78dab3 - Microsoft PC x64 - build: windows-x86 windows - GMT -04:00

And then downgraded to:

May 02, 2022 17:18:36.415 [14772] INFO - Plex Media Server v1.25.7.5604-980a13e02 - Microsoft PC x64 - build: windows-x86 windows - GMT -05:00

When said, you where lucky, that your database upload failed, since that would have exposed everything you have :wink:

I suggest, that you use power off your PMS, and then zip the entire

C:\Users\<Your User Name>\AppData\Local\Plex Media Server\Plug-in Support\Databases

directory, and then upload to like dropbox or siml.

Then DM the download link to me

Tried the Repair a Corrupted Database | Plex Support article did not work also tried repair the Server from the control panel as well

Again, your database upload failed, since the zip file is empty, and again…

DO NOT UPLOAD YOUR DATABASE!

Please follow my instructions in my former post