Plex crashes when trying to run new version

Server Version#: 1.32.8.7639
Player Version#:

I’m trying to install the most current version of PMS but every time i do i get a pop up saying “updating libraries” and then it crashes. plus, now whenever anyone off my network looks at a library, it shows as blank. but the shows can be accessed through the home page.

i’ve also backed up the database, deleted it from appdata, and performed a clean install and it works. so my current database is the issue i think? i’ve created multiple series, edited and curated collections and changed metadata, and i don’t want to lose all of that work.

here is the most recent log:

Jun 08, 2024 13:43:02.635 [13888] INFO - Plex Media Server v1.40.2.8395-c67dce28e - Microsoft PC x64-x64 - build: windows-x86_64 windows - GMT -04:00
Jun 08, 2024 13:43:02.635 [13888] INFO - Windows version: 10.0 (Build 19045), language en-US
Jun 08, 2024 13:43:02.635 [13888] INFO - 12 2904 MHz processor(s): Architecture=9, Level=6, Revision=42243 Processor Identifier=Intel64 Family 6 Model 165 Stepping 3, GenuineIntel
Jun 08, 2024 13:43:02.635 [13888] INFO - Compiler is - MSVC 1929
Jun 08, 2024 13:43:02.635 [13888] DEBUG - "C:\Program Files\Plex\Plex Media Server\Plex Media Server.exe" 
Jun 08, 2024 13:43:02.639 [12044] DEBUG - Plex for Windows Store application is not installed
Jun 08, 2024 13:43:02.640 [12044] DEBUG - BPQ: [Idle] -> [Starting]
Jun 08, 2024 13:43:02.642 [12044] DEBUG - FeatureManager: Using cached data for features list
Jun 08, 2024 13:43:02.868 [12044] DEBUG - [CERT] Subject name is /CN=*.55bde36f87cd4e5897545a6f66a00a39.plex.direct
Jun 08, 2024 13:43:02.868 [12044] DEBUG - [CERT] Installed certificate with fingerprint 4d:2f:8f:ad:7f:9f:49:11:3b:61:2e:98:e0:7f:60:5f:43:82:cc:c5.
Jun 08, 2024 13:43:02.868 [12044] DEBUG - [CERT/OCSP] Stapling requests will be made to 'http://r3.o.lencr.org/'.
Jun 08, 2024 13:43:02.868 [12044] INFO - [CERT/OCSP] Successfully retrieved response from cache.
Jun 08, 2024 13:43:02.868 [12044] DEBUG - HttpServer: Listening on IPv6 as well as IPv4.
Jun 08, 2024 13:43:02.869 [12044] DEBUG - HttpServer: Listening on port 32400.
Jun 08, 2024 13:43:02.869 [12044] DEBUG - HttpServer: Listening on port 32401.
Jun 08, 2024 13:43:02.869 [12044] DEBUG - Running server...
Jun 08, 2024 13:43:02.869 [12044] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.39.4, threadsafe=1
Jun 08, 2024 13:43:02.869 [12440] DEBUG - HttpServer: Set up a thread pool with 2 threads.
Jun 08, 2024 13:43:02.884 [12044] INFO - SQLITE3:0x7ff7cedc7500, 283, recovered 6 frames from WAL file C:\Users\morlo\AppData\Local\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db-wal
Jun 08, 2024 13:43:02.913 [12044] INFO - Running migrations. (EPG 0)
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 0.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 1.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 2.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 3.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 4.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 5.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 6.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 7.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 8.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 9.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 10.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 11.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 12.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 13.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 14.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 15.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 16.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 17.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 18.
Jun 08, 2024 13:43:02.926 [12044] DEBUG - Captured session 19.
Jun 08, 2024 13:43:02.929 [12044] INFO - Running forward migration 202309200901.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 0.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 1.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 2.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 3.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 4.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 5.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 6.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 7.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 8.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 9.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 10.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 11.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 12.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 13.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 14.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 15.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 16.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 17.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 18.
Jun 08, 2024 13:43:02.929 [12044] DEBUG - Captured session 19.
Jun 08, 2024 13:43:03.026 [12044] ERROR - Exception inside transaction (inside=1) (D:\gha\plex-media-server\plex-media-server\Library\DatabaseMigrations.cpp:293): Null value not allowed for this type
Jun 08, 2024 13:43:03.027 [12044] ERROR - Exception thrown during migrations, aborting: Null value not allowed for this type
Jun 08, 2024 13:43:03.063 [12044] DEBUG - ChangestampAllocator: initialized to 13947715
Jun 08, 2024 13:43:03.067 [12044] DEBUG - Opening 2 database sessions to library (com.plexapp.plugins.library.blobs), SQLite 3.39.4, threadsafe=1
Jun 08, 2024 13:43:03.076 [12044] INFO - Running migrations. (EPG 0)
Jun 08, 2024 13:43:03.076 [12044] DEBUG - Captured session 0.
Jun 08, 2024 13:43:03.076 [12044] DEBUG - Captured session 1.
Jun 08, 2024 13:43:03.082 [7720] DEBUG - Codecs: Downloading current version of aac encoder
Jun 08, 2024 13:43:03.082 [7720] INFO - CodecManager: obtaining encoder 'aac'
Jun 08, 2024 13:43:03.082 [7720] DEBUG - [HCl#1] HTTP requesting GET https://plex.tv/api/codecs/aac_encoder?build=windows-x86_64-standard&deviceId=99746e13-b7bd-4abb-a8b2-14cd03edad7e&oldestPreviousVersion=1%2E24%2E5%2E5173-8dcc73a59&version=ad47460-4673
Jun 08, 2024 13:43:03.129 [7720] DEBUG - Grabber: Cleaning up orphaned grabs.
Jun 08, 2024 13:43:03.130 [12044] DEBUG - Media Provider: Registering provider com.plexapp.plugins.library
Jun 08, 2024 13:43:03.130 [12044] DEBUG - Auth: Refreshing tokens inside the token-based authentication filter.
Jun 08, 2024 13:43:03.130 [12044] DEBUG - MyPlex: mapping state set to 'Unknown'.
Jun 08, 2024 13:43:03.131 [7720] DEBUG - Grabber: Cleaned up 0 decrepit directories in 0.0 sec.
Jun 08, 2024 13:43:03.131 [12044] DEBUG - Relay: read 146 cached entries from hosts file
Jun 08, 2024 13:43:03.132 [15736] DEBUG - [MediaProviderManager/HCl#2] HTTP requesting GET https://plex.tv/media/providers?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx
Jun 08, 2024 13:43:03.132 [12044] DEBUG - MyPlex: using cached data for request for https://plex.tv/api/v2/server/access_tokens?auth_token=xxxxxxxxxxxxxxxxxxxx
Jun 08, 2024 13:43:03.133 [12044] DEBUG - MyPlex: updating with 56 access tokens
Jun 08, 2024 13:43:03.133 [12044] ERROR - Error: Unable to set up server: bad cast (class std::bad_cast)

Downgrade to the previous server software version, then

Repair it.
https://support.plex.tv/articles/repair-a-corrupted-database/

The .bat file from this project makes it quite convenient: GitHub - ChuckPa/PlexDBRepair: Database repair utility for Plex Media Server databases

If the repaired database file(s) are roughly the same size (they are actually supposed to be a bit smaller, but not drastically so) as the backed up originals, verify that the server is working with this repaired database.
If it does, you can try the software update again.

i ran the tool, it said it was completed, but libraries still don’t show up for users off network.

Are you saying that this is only an issue for remote users?

yeah thats the weirdest part. i can see all my libraries, my collections, everything on my pc and iphone. but if its off network or on my roku, nothing shows up. but i can still search for anything, i can see play anything i want off the home screen.

Disable support for IPv6 in the advanced settings of Plex server.
Then stop and restart the server using its task tray icon.

no change, still can’t see stuff when my phone is on cell data

Try this: on your phone, sign out from your plex account.
Delete the plex app.
reboot the phone
reinstall the plex app.
sign it into your plex account.

Any change?

No change at all… Works on network but not off. I guess this means the roku isn’t using a direct connection which I should look into as well!

Then I suggest continuing with this: The Basics of Remote Access Troubleshooting

Ok but how does that relate to my initial problem if plex crashing after updating to the current version using my current library?

Is there anything I can do about that?

You did not report back if repairing the database helped with that.
I propose you do that first, before trying to fix the remote access.

oh sorry, i forgot to report… i checked all of the issues there and they either didn’t apply or the change didn’t affect the problem.

Do you have still issues (fully) accessing your server, even from within your home network?

no issues at all within the home network… completely functional.

Have you tried to update again?

just tried, nothing has changed. i even tried to install the current beta install and i got a popup saying “plex cannot open library” or something to that effect

Which size did the two .db files have prior to the repair attempt and how big are they now?

the old one is 182,932kb and the new one is 183,416kb

Hm, yeah, that sounds fine.

Have you ever started Plex server with “Run as Administrator”? Never do that, it can mess up the access permissions in the Plex data folder.