Loading libraries fails (ERROR - Got exception from request handler: bad cast)

Hi all,

Looks like that I have the same problem on my Windows Server version like here:

Did nothing manual, just the auto update, and now with Windows Server Version 1.27.0.5849 the libraries aren’t loading anymore. I can see all libraries, but no items on the start page and clicking on a library, I always get an error “something went wrong”.
When I click on “Collections” there are some items, try to play some of them gives me and error, ~media not available. hmmm The media files are for sure available on the server and working, at the specific location/path.

Thanks for any help.
Alex

Jun 02, 2022 18:18:16.708 [1912] ERROR - Got exception from request handler: bad cast
Jun 02, 2022 18:18:16.709 [1912] DEBUG - Calling back into ourselves for photo to transcode, optimizing the process (status: 500)
Jun 02, 2022 18:18:16.709 [11668] DEBUG - Completed: [127.0.0.1:50022] 404 GET /photo/:/transcode?width=240&height=360&minSize=1&upscale=1&url=%2Flibrary%2Fcollections%2F495345%2Fcomposite%2F1542939870%3Fwidth%3D400%26height%3D600%26X-Plex-Token%3Dxxxxxxxxxxxxxxxxxxxx (9 live) GZIP 145ms 379 bytes (pipelined: 11)
Jun 02, 2022 18:18:17.919 [1912] DEBUG - Request: [127.0.0.1:50022 (Loopback)] GET /hubs/sections/10?count=12&includeLibraryPlaylists=1&includeStations=1&includeRecentChannels=1&includeMeta=1&includeExternalMetadata=1&excludeFields=summary (9 live) GZIP Signed-in Token (alizi) (Microsoft Edge)
Jun 02, 2022 18:18:17.920 [1912] DEBUG - HubCache: Retrieving ‘1/movie.inprogress.10/1/hubs/sections/10/deexternal-media,indirect-media/count=12&excludeFields=summary&includeExternalMetadata=1&includeLibraryPlaylists=1&includeMeta=1&includeRecentChannels=1&includeStations=1’ from the cache.
Jun 02, 2022 18:18:17.928 [1912] ERROR - Got exception from request handler: bad cast
Jun 02, 2022 18:18:17.933 [11664] DEBUG - Completed: [127.0.0.1:50022] 500 GET /hubs/sections/10?count=12&includeLibraryPlaylists=1&includeStations=1&includeRecentChannels=1&includeMeta=1&includeExternalMetadata=1&excludeFields=summary (9 live) GZIP 15ms 405 bytes (pipelined: 12)
Jun 02, 2022 18:18:20.122 [1912] DEBUG - Request: [127.0.0.1:50022 (Loopback)] GET /library/sections/10/all?type=1&sort=addedAt%3Adesc&includeCollections=1&includeExternalMedia=1&includeAdvanced=1&includeMeta=1 (8 live) Page 0-49 GZIP Signed-in Token (alizi) (Microsoft Edge)
Jun 02, 2022 18:18:20.125 [1912] ERROR - Unknown metadata type: folder
Jun 02, 2022 18:18:20.127 [1912] DEBUG - Setting container serialization range to [0, 49] (total=-1)
Jun 02, 2022 18:18:20.136 [1912] ERROR - Got exception from request handler: bad cast
Jun 02, 2022 18:18:20.137 [11668] DEBUG - Completed: [127.0.0.1:50022] 500 GET /library/sections/10/all?type=1&sort=addedAt%3Adesc&includeCollections=1&includeExternalMedia=1&includeAdvanced=1&includeMeta=1 (8 live) GZIP Page 0-49 16ms 405 bytes (pipelined: 13)
Jun 02, 2022 18:18:20.164 [1912] DEBUG - Request: [127.0.0.1:50022 (Loopback)] GET /library/sections/10/all?type=1&sort=addedAt%3Adesc&includeCollections=1&includeExternalMedia=1&includeAdvanced=1&includeMeta=1 (8 live) Page 0-49 GZIP Signed-in Token (alizi) (Microsoft Edge)
Jun 02, 2022 18:18:20.166 [1912] ERROR - Unknown metadata type: folder

2 Likes

update: downgrade to 1.26.2.5797 worked, everything back again

It is very likely indicative of a damaged database. I urge you to perform the manual database repair procedure, because DB damage will eventually make the DB unusable. It is just a matter of time. Repair a Corrupted Database | Plex Support
After this repair has been successfully performed, try the update again. (and give it several minutes upon first start to perform the database schema changes)

I have the same issue as above.

Have tried database repair, and even loaded a backed up DB. The result is the same. Reverting back to 1.26 I see the DB Schema being downgraded and it works again.

I’ve also deleted the DB in 1.26, re-scanned all the libraries in, and upgraded to 1.27 , only to encounter the same issue again, so it doesn’t appear to be DB corruption

Unfortunately the repair procedure cannot fix all types of damage.
If the issue is not fixable, the DB schema change will always fail upon a software update.
And if the DB schema update fails, the DB cannot be used by the new software version. Which explains, why it works again when you downgrade the software version.
However, the fact remains that the DB is already damaged.

Seems you are correct that the schema update fails.

Happens on all my DB backups

Could you take a look at the crash report Upload?

Jun 02, 2022 14:24:26.705 [0x7f4ac78d4b38] INFO - Plex Media Server v1.27.0.5849-99e933842 - Unraid NAS x86_64 - build: linux-x86_64 unraid - GMT -04:00
Jun 02, 2022 14:24:26.705 [0x7f4ac78d4b38] INFO - Linux version: Unraid OS 6.10.2, language: en-US
Jun 02, 2022 14:24:26.705 [0x7f4ac78d4b38] INFO - Processor: 44-core Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz
Jun 02, 2022 14:24:26.705 [0x7f4ac78d4b38] INFO - Compiler is - Clang 11.0.1 (https://plex.tv 9b997da8e5b47bdb4a9425b3a3b290be393b4b1f)
Jun 02, 2022 14:24:26.705 [0x7f4ac78d4b38] INFO - ./Plex Media Server
Jun 02, 2022 14:24:26.705 [0x7f4acb0bd0d0] DEBUG - BPQ: [Idle] → [Starting]
Jun 02, 2022 14:24:26.705 [0x7f4acb0bd0d0] VERBOSE - BPQ: delaying processing 120 second(s)
Jun 02, 2022 14:24:26.706 [0x7f4acb0bd0d0] DEBUG - FeatureManager: Using cached data for features list
Jun 02, 2022 14:24:26.707 [0x7f4acb0bd0d0] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.35.5, threadsafe=1
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Running migrations. (EPG 0)
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Running forward migration 202203220200.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 0.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 1.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 2.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 3.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 4.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 5.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 6.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 7.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 8.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 9.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 10.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 11.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 12.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 13.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 14.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 15.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 16.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 17.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 18.
Jun 02, 2022 14:24:26.746 [0x7f4acb0bd0d0] DEBUG - Captured session 19.
Jun 02, 2022 14:24:27.714 [0x7f4acb0bd0d0] WARN - Held transaction for too long (/data/jenkins/server/3532132579/Library/DatabaseMigrations.cpp:254): 0.960000 seconds
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Completed forward migration 202203220200.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Running forward migration 202204252200.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 0.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 1.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 2.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 3.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 4.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 5.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 6.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 7.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 8.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 9.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 10.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 11.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 12.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 13.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 14.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 15.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 16.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 17.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 18.
Jun 02, 2022 14:24:27.854 [0x7f4acb0bd0d0] DEBUG - Captured session 19.
Jun 02, 2022 14:24:28.353 [0x7f4acb0bd0d0] WARN - Held transaction for too long (/data/jenkins/server/3532132579/Library/DatabaseMigrations.cpp:254): 0.500000 seconds
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Completed forward migration 202204252200.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Running forward migration 202204252300.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 0.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 1.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 2.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 3.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 4.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 5.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 6.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 7.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 8.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 9.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 10.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 11.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 12.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 13.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 14.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 15.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 16.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 17.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 18.
Jun 02, 2022 14:24:28.555 [0x7f4acb0bd0d0] DEBUG - Captured session 19.
Jun 02, 2022 14:24:28.703 [0x7f4ac6f55b38] DEBUG - [JobRunner] Job running: /usr/local/plexmediaserver/CrashUploader “–directory=/mnt/disks/Samsung_SSD_850_EVO_mSATA_500GB_S33HNX0J600909B/plex/Library/Application Support/Plex Media Server/Crash Reports/1.27.0.5849-99e933842” --version=1.27.0.5849-99e933842 --platform=Linux “–platformVersion=Unraid OS 6.10.2” --serverUuid=d46c0f0795fc212970eeec3a410df9f40934ebe0 --userId=nixxxxxx@gmail.com --sentryUrl=https://sentry.io/api/1233455/minidump --sentryKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --vendor=Unraid --model=x86_64 --device=NAS --allowRetries=0
Jun 02, 2022 14:24:28.704 [0x7f4ac6f55b38] DEBUG - [JobRunner] Jobs: Starting child process with pid 29666
Jun 02, 2022 14:24:28.716 [0x7f4ac7897b38] VERBOSE - JobManager: child process with handle 29666 exited
Jun 02, 2022 14:24:28.716 [0x7f4ac7897b38] DEBUG - Jobs: ‘/usr/local/plexmediaserver/CrashUploader’ exit code for process 29666 is 0 (success)
Jun 02, 2022 14:24:29.890 [0x7f4acb0bd0d0] WARN - Held transaction for too long (/data/jenkins/server/3532132579/Library/DatabaseMigrations.cpp:254): 1.340000 seconds
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Completed forward migration 202204252300.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Running forward migration 202204252330.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 0.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 1.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 2.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 3.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 4.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 5.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 6.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 7.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 8.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 9.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 10.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 11.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 12.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 13.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 14.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 15.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 16.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 17.
Jun 02, 2022 14:24:30.380 [0x7f4acb0bd0d0] DEBUG - Captured session 18.

I’m having the same problem w/ the plexinc/pms-docker container on Linux. Running :latest or :plexpass results in a Plex Server instance that suddenly appears to have fully empty libraries. Reverting to :1.26.2.5797-5bd057d2b, while making no other changes whatsoever, results in a Plex Server instance whose libraries are suddenly working.

This is not a permissions issue. This is not a corrupt database, at least not in the sense that “the database from before the upgrade was corrupt.” It was only an issue post-upgrade.

Can you post your server logs ?

Same issue here. In my case, reverting to 1.26 didn’t fix the issue, and I had to completely reinstall and re-scan all my libraries with 1.26 fresh install to get things up and running again. Family unhappy.

I don’t have logs to share since that server is now gone, but if I attempt the upgrade again I can post them.

Others reporting this problem on Reddit: https://www.reddit.com/r/PleX/comments/vc3m2x/new_public_pms_version_available_127058973940636f2/

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