Error opening image

Hi,
I’m encountering the error messages below when trying to view images made with an iPhone.
Otherwise the images can be opened with Windows Image Preview and Paint.NET without any error.
Could you please assist why this happens?

Attached please find one such image.

May 30, 2021 12:28:15.302 [0x7f2ae9f54b38] ERROR - Format [JPEG] - Corrupt JPEG data: 2 extraneous bytes before marker 0xd9

May 30, 2021 15:23:00.710 [0x7f2ae8773b38] ERROR - Exception handled: std::bad_cast

Server Version#: 1.23.2.4600
Player Version#: Plex Web 4.57.4

3 Likes

Would it be possible to get a copy of that photo ?

I’ll take it to the Engineering folks.

It is already attached…?

I see one in your post.

The forum wants to save it as:

714d4bb601dbb2a93157447ab4543407bf3738bf_2_690x517.jpeg

Is that correct? It’s a JPEG?

Would it be possible for you to put it in a ZIP file to protect it from being processed by the forum?

What you have posted makes my browsers blow up

If you click on the picture there is a download button at the bottom, which lets you download the original picture.

Thanks… saved me a lot of headache ( I need time off :man_facepalming: )

I get no errors.

May I see your logs when you try to open it please ?

May 31, 2021 17:30:44.856 [0x7f63d46c6b38] DEBUG - HTTP requesting POST https://plex.tv/servers.xml?auth_token=xxxxxxxxxxxxxxxxxxxx
May 31, 2021 17:30:44.857 [0x7f63d175eb38] DEBUG - Asked to cull library timeline before time 1622495444, we're starting with 2029 items.
May 31, 2021 17:30:44.857 [0x7f63d175eb38] DEBUG - Library timeline cull complete with 2029 items left.
May 31, 2021 17:30:44.857 [0x7f63d175eb38] DEBUG - Scanning Photos using en(Plex Photo Scanner) with 0 current media items and 1 section locations in the database.
May 31, 2021 17:30:44.857 [0x7f63d175eb38] DEBUG - Performing a scan with 'Plex Photo Scanner' (language: en virtual: 0).
May 31, 2021 17:30:44.857 [0x7f63d175eb38] DEBUG -   * Scanning /share/NFSv=4/qa/samples/photos
May 31, 2021 17:30:44.857 [0x7f63d175eb38] DEBUG - Scanner: Processing directory /share/NFSv=4/qa/samples/photos (parent: no)
May 31, 2021 17:30:44.858 [0x7f63d175eb38] DEBUG - Directory had 1 files, database had 0 files, can't skip.
May 31, 2021 17:30:44.858 [0x7f63d175eb38] DEBUG - Looking for path match for [/share/NFSv=4/qa/samples/photos/IMG_1759.JPG]
May 31, 2021 17:30:44.858 [0x7f63d175eb38] DEBUG - Skipping hash check, no size match for 3757541 bytes.
May 31, 2021 17:30:44.858 [0x7f63d175eb38] DEBUG - No match for hash.
May 31, 2021 17:30:44.859 [0x7f63d175eb38] DEBUG - Added new metadata item (IMG_1759) with ID 124605
May 31, 2021 17:30:44.860 [0x7f63d4f30b38] DEBUG - [LibraryTimeline] Scanner activity on section 9: 1 added, 0 deleted
May 31, 2021 17:30:44.860 [0x7f63d4f30b38] DEBUG - HubCache: Expiring '1/continueWatching/1/hubs/continueWatching/enexternal-media,indirect-media/contentDirectoryID=1%2C2%2C3%2C4%2C5%2C6%2C7%2C8&excludeFields=summary&includeMeta=1' because of event plex.event.item.created.
May 31, 2021 17:30:44.860 [0x7f63d4f30b38] DEBUG - HubCache: Expiring '1/continueWatching/1/hubs/continueWatching/enexternal-media/contentDirectoryID=1%2C3%2C5%2C2%2C4%2C6%2C7%2C8&includeExternalMedia=1&includeGames=1&includeMeta=1&includeRecentChannels=1' because of event plex.event.item.created.
May 31, 2021 17:30:44.860 [0x7f63d4f30b38] DEBUG - HubCache: Expiring '1/continueWatching/1/hubs/continueWatching/items/enexternal-media,indirect-media/contentDirectoryID=1%2C2%2C3%2C4%2C5%2C6%2C7%2C8' because of event plex.event.item.created.
May 31, 2021 17:30:44.860 [0x7f63d4f30b38] DEBUG - HubCache: Expiring '1/continueWatching/1/hubs/continueWatching/items/enexternal-media/contentDirectoryID=1%2C3%2C5%2C2%2C4%2C6%2C7%2C8&includeExternalMedia=1&includeMeta=1' because of event plex.event.item.created.
May 31, 2021 17:30:44.867 [0x7f63d13d3b38] DEBUG - Media Analyzer: Performing on-the-fly analysis on 1 item.
May 31, 2021 17:30:44.867 [0x7f63d13d3b38] DEBUG - [JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/share/CACHEDEV2_DATA/.qpkg/PlexMediaServer/Library/Plex\ Media\ Server/Codecs/fa235d6-3858-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxU' '/share/CACHEDEV2_DATA/.qpkg/PlexMediaServer/Plex Media Scanner' '--analyze' '--log-file-suffix' ' Analysis' '--item' '124605'
May 31, 2021 17:30:44.867 [0x7f63d175eb38] DEBUG - Activity: updated activity 7229b93b-d1f1-4e7b-bd7a-0e60de508028 - completed 99.0% - Scanning Photos
May 31, 2021 17:30:44.868 [0x7f63d13d3b38] DEBUG - [JobRunner] Jobs: Starting child process with pid 13123
May 31, 2021 17:30:44.868 [0x7f63d175eb38] DEBUG - Removing 0 media items that were left.
May 31, 2021 17:30:44.868 [0x7f63d175eb38] DEBUG - Removing 0 directories that were left.
May 31, 2021 17:30:44.868 [0x7f63d175eb38] DEBUG - Updating directory '' (ID 8175) to time 2021-05-31 17:29:41.
May 31, 2021 17:30:44.870 [0x7f63d13f6b38] DEBUG - Updating metadata item (save) (IMG_1759) with ID 124605
May 31, 2021 17:30:44.887 [0x7f63d61f4b38] DEBUG - Auth: authenticated user 1 as ChuckPA
May 31, 2021 17:30:44.887 [0x7f63d1639b38] DEBUG - Request: [192.168.0.13:45636 (Subnet)] GET /library/sections (9 live) TLS GZIP Signed-in Token (ChuckPA)
May 31, 2021 17:30:44.888 [0x7f63d6217b38] DEBUG - Completed: [192.168.0.13:45636] 200 GET /library/sections (9 live) TLS GZIP 1ms 1696 bytes (pipelined: 22)
May 31, 2021 17:30:44.890 [0x7f63d61f4b38] DEBUG - Auth: authenticated user 1 as ChuckPA
May 31, 2021 17:30:44.890 [0x7f63d1639b38] DEBUG - Request: [192.168.0.13:45636 (Subnet)] GET /library/sections/3/all?type=1&includeCollections=1&includeExternalMedia=1&includeAdvanced=1&includeMeta=1 (9 live) TLS Page 0-83 GZIP Signed-in Token (ChuckPA)
May 31, 2021 17:30:44.891 [0x7f63d1639b38] ERROR - Unknown metadata type: folder
May 31, 2021 17:30:44.891 [0x7f63d1639b38] DEBUG - Setting container serialization range to [0, 83] (total=-1)
May 31, 2021 17:30:44.893 [0x7f63d6217b38] DEBUG - Auth: authenticated user 1 as ChuckPA
May 31, 2021 17:30:44.893 [0x7f63d1381b38] DEBUG - Request: [192.168.0.13:45648 (Subnet)] GET /library/sections/3/firstCharacter?includeCollections=1&includeExternalMedia=true (10 live) TLS GZIP Signed-in Token (ChuckPA)
May 31, 2021 17:30:44.894 [0x7f63d6217b38] DEBUG - Completed: [192.168.0.13:45648] 200 GET /library/sections/3/firstCharacter?includeCollections=1&includeExternalMedia=true (10 live) TLS GZIP 1ms 854 bytes (pipelined: 1)
May 31, 2021 17:30:44.905 [0x7f63d175eb38] DEBUG - Collections: Found 0 collections tags in section 9.
May 31, 2021 17:30:44.905 [0x7f63d175eb38] DEBUG - Collections: We had 0 collections in the library already.
May 31, 2021 17:30:44.905 [0x7f63d175eb38] DEBUG - Collections: Synced tags in section 9 in 35ms.
May 31, 2021 17:30:44.905 [0x7f63d175eb38] DEBUG - Collections: Found 0 collections tags in section 9.
May 31, 2021 17:30:44.905 [0x7f63d175eb38] DEBUG - Collections: We had 0 collections in the library already.
May 31, 2021 17:30:44.905 [0x7f63d175eb38] DEBUG - Collections: Synced tags in section 9 in 36ms.
May 31, 2021 17:30:44.905 [0x7f63d175eb38] DEBUG - Collections: Refreshed attributes for 0 collections in section 9 in 0ms.
May 31, 2021 17:30:44.905 [0x7f63d175eb38] DEBUG - Collection: There were 1 items still hidden which we're making visible now.
May 31, 2021 17:30:44.905 [0x7f63d175eb38] DEBUG - Collection: Need to hide 0 items, show 1 items in section 9.
May 31, 2021 17:30:44.906 [0x7f63d175eb38] DEBUG - Collection: Refreshed visibility in section 9 in 0ms.
May 31, 2021 17:30:44.906 [0x7f63d175eb38] DEBUG - Collections: Refreshed attributes for 0 collections in section 9 in 0ms.
May 31, 2021 17:30:44.907 [0x7f63d175eb38] DEBUG - Activity: updated activity 7229b93b-d1f1-4e7b-bd7a-0e60de508028 - completed 100.0% - Scanning Photos
May 31, 2021 17:30:44.907 [0x7f63d175eb38] DEBUG - Refreshing section 9 of type: 13
May 31, 2021 17:30:44.907 [0x7f63d133bb38] DEBUG - Refreshing 0 IDs.
May 31, 2021 17:30:44.907 [0x7f63d175eb38] DEBUG - MetadataItemClusterRequestHandler: section 9 is finished scanning
May 31, 2021 17:30:44.907 [0x7f63d175eb38] DEBUG - Activity: registered new activity c785db9c-6109-481a-aa51-19620f37c773 - "Processing subscriptions"
May 31, 2021 17:30:44.907 [0x7f63d175eb38] DEBUG - Activity: Ended activity 7229b93b-d1f1-4e7b-bd7a-0e60de508028.
May 31, 2021 17:30:44.908 [0x7f63d145ab38] DEBUG - Grabber: Cleaning up orphaned grabs.
May 31, 2021 17:30:44.909 [0x7f63d145ab38] DEBUG - Grabber: Cleaned up 0 decrepit directories in 0.0 sec.
May 31, 2021 17:30:44.909 [0x7f63d145ab38] DEBUG - Activity: registered new activity 84f2ff59-cc26-4acf-92c9-fb75148b1a2f - "Processing subscriptions"
May 31, 2021 17:30:44.909 [0x7f63d145ab38] DEBUG - Subscription: Scheduling subscriptions.
May 31, 2021 17:30:44.909 [0x7f63d145ab38] DEBUG - Subscription: Initialized 0 schedulers.
May 31, 2021 17:30:44.909 [0x7f63d145ab38] DEBUG - Subscription: Starting with 0 grabs, scheduled 0 active ones preemptively.
May 31, 2021 17:30:44.909 [0x7f63d145ab38] DEBUG - Subscription: Scheduled all subscriptions in 0 ms.
May 31, 2021 17:30:44.909 [0x7f63d145ab38] DEBUG - Activity: Ended activity 84f2ff59-cc26-4acf-92c9-fb75148b1a2f.
May 31, 2021 17:30:44.910 [0x7f63d145ab38] DEBUG - Subscription: There are 0 active grabs at the end.
May 31, 2021 17:30:44.910 [0x7f63d145ab38] DEBUG - Activity: Ended activity c785db9c-6109-481a-aa51-19620f37c773.
May 31, 2021 17:30:44.910 [0x7f63d61f4b38] DEBUG - Auth: authenticated user 1 as ChuckPA
May 31, 2021 17:30:44.910 [0x7f63d145ab38] DEBUG - Subscription: Refreshed all content in 2 ms.
May 31, 2021 17:30:44.910 [0x7f63d1381b38] DEBUG - Request: [192.168.0.13:45648 (Subnet)] GET /media/providers (10 live) TLS GZIP Signed-in Token (ChuckPA)
May 31, 2021 17:30:44.912 [0x7f63d6217b38] DEBUG - Completed: [192.168.0.13:45648] 200 GET /media/providers (10 live) TLS GZIP 1ms 5835 bytes (pipelined: 2)
May 31, 2021 17:30:44.913 [0x7f63d1639b38] DEBUG - Setting container serialization range to [0, 83] (total=84)
May 31, 2021 17:30:44.921 [0x7f63d6217b38] DEBUG - Completed: [192.168.0.13:45636] 200 GET /library/sections/3/all?type=1&includeCollections=1&includeExternalMedia=1&includeAdvanced=1&includeMeta=1 (10 live) TLS GZIP Page 0-83 30ms 34175 bytes (pipelined: 23)
May 31, 2021 17:30:44.940 [0x7f63d1381b38] DEBUG - Request: [127.0.0.1:49344 (Loopback)] GET /library/changestamp (11 live) GZIP Signed-in Token (ChuckPA)
May 31, 2021 17:30:44.941 [0x7f63d6217b38] DEBUG - Completed: [127.0.0.1:49344] 200 GET /library/changestamp (11 live) GZIP 0ms 498 bytes (pipelined: 1)
May 31, 2021 17:30:44.966 [0x7f63d1639b38] DEBUG - Request: [127.0.0.1:49344 (Loopback)] GET /:/metadata/notify/changeItemState?librarySectionID=9&metadataItemID=124605&metadataType=13&state=-1&parentID=-1&rootID=-1&mediaState=analyzing (11 live) GZIP Signed-in Token (ChuckPA)
May 31, 2021 17:30:44.966 [0x7f63d61f4b38] DEBUG - Completed: [127.0.0.1:49344] 200 GET /:/metadata/notify/changeItemState?librarySectionID=9&metadataItemID=124605&metadataType=13&state=-1&parentID=-1&rootID=-1&mediaState=analyzing (11 live) GZIP 0ms 195 bytes (pipelined: 2)
May 31, 2021 17:30:44.966 [0x7f63d1381b38] DEBUG - Request: [127.0.0.1:49344 (Loopback)] GET /:/metadata/notify/changeItemState?librarySectionID=9&metadataItemID=124605&metadataType=13&state=-1&parentID=-1&rootID=-1&mediaState=thumbnailing (11 live) GZIP Signed-in Token (ChuckPA)
May 31, 2021 17:30:44.966 [0x7f63d61f4b38] DEBUG - Completed: [127.0.0.1:49344] 200 GET /:/metadata/notify/changeItemState?librarySectionID=9&metadataItemID=124605&metadataType=13&state=-1&parentID=-1&rootID=-1&mediaState=thumbnailing (11 live) GZIP 0ms 195 bytes (pipelined: 3)
May 31, 2021 17:30:45.093 [0x7f63d61f4b38] DEBUG - Auth: authenticated user 1 as ChuckPA
May 31, 2021 17:30:45.093 [0x7f63d1639b38] DEBUG - Request: [192.168.0.13:45636 (Subnet)] GET /library/sections (11 live) TLS GZIP Signed-in Token (ChuckPA)
May 31, 2021 17:30:45.094 [0x7f63d61f4b38] DEBUG - Completed: [192.168.0.13:45636] 200 GET /library/sections (11 live) TLS GZIP 1ms 1696 bytes (pipelined: 24)

I get the error messages posted above, nothing else…
Should I tweak some settings so I can get some more verbose logs?

I just upgraded to 1.23.2.4625-a83d2d0f9, and I am seeing the second error (std::bad_cast) in the server logs every time I attempt to open a photo, from both iPhone and Android.

Thumbnails are fine, and I don’t see the JPEG corruption errors.

This feels related to another issue posted in the player section: "An error occurred loading items to play" in photos - #11 by beckfield

Jun 02, 2021 12:49:09.297 [0x7ff735ea7b38] DEBUG - Request: [10.0.0.51:47132 (Subnet)] POST /playQueues?type=photo&uri=server%3A%2F%2F4c1fa2e49fdb9562b8a95bd19ff362ba944937fe%2Fcom.plexapp.plugins.library%2Flibrary%2Fsections%2F2%2Fall%3FclusterZoomLevel%3D1%26clustering%3C%3D226036&key=%2Flibrary%2Fmetadata%2F61206&repeat=0&own=1&includeChapters=1&includeMarkers=1&includeGeolocation=1&includeExternalMedia=1 (4 live) TLS GZIP Signed-in Token (abscondment)
Jun 02, 2021 12:49:09.298 [0x7ff735ea7b38] DEBUG - PlayQueue: Converted 'server://4c1fa2e49fdb9562b8a95bd19ff362ba944937fe/com.plexapp.plugins.library/library/sections/2/all?clusterZoomLevel=1&clustering<=226036' to 'library://x/directory/%2Flibrary%2Fsections%2F2%2Fall%3FclusterZoomLevel%3D1%26clustering%3C%3D226036'
Jun 02, 2021 12:49:09.300 [0x7ff735ea7b38] DEBUG - PlayQueue: 0 generated IDs compressed down to a 20 byte blob.
Jun 02, 2021 12:49:09.691 [0x7ff735ea7b38] DEBUG - PlayQueue: Start index: 0 End index: 121 Count: 57020
Jun 02, 2021 12:49:09.712 [0x7ff735ea7b38] DEBUG - PlayQueue: 57020 generated IDs compressed down to a 95977 byte blob.
Jun 02, 2021 12:49:09.713 [0x7ff735ea7b38] DEBUG - PlayQueue: Added 122 items in 0.0 sec.
Jun 02, 2021 12:49:09.726 [0x7ff735ea7b38] ERROR - Exception handled: std::bad_cast
Jun 02, 2021 12:49:09.726 [0x7ff737217b38] DEBUG - Completed: [10.0.0.51:47132] 500 POST /playQueues?type=photo&uri=server%3A%2F%2F4c1fa2e49fdb9562b8a95bd19ff362ba944937fe%2Fcom.plexapp.plugins.library%2Flibrary%2Fsections%2F2%2Fall%3FclusterZoomLevel%3D1%26clustering%3C%3D226036&key=%2Flibrary%2Fmetadata%2F61206&repeat=0&own=1&includeChapters=1&includeMarkers=1&includeGeolocation=1&includeExternalMedia=1 (4 live) TLS GZIP 429ms 532 bytes (pipelined: 1)

May I please have the full logs ZIP which capture this?

I’m going to add the the open trouble report for Engineering.

Sure, here’s the zipped log.
Plex Media Server.log.gz (927.8 KB)

I should clarify this statement:

every time I attempt to open a photo, from both iPhone and Android.

I mean here that the files I’m opening were captured on iPhone and Android. I see the std::bad_cast error in the server logs no matter what client I’m using

The Web Client shows me an error modal and refuses to display the photo I clicked. When I use a mobile client, I do see the selected image, but it doesn’t start the normal playback mode.

Just going on record that recently (last couple versions) I can’t open pictures on Plex app on Roku streaming stick feeding Samsung TV nor on Linux desktop using Plex Web Version 4.57.4.

I’m seeing the same error here, std::bad_cast. PMS Version 1.23.1.4602 running on Linux server.

Attaching logs:
Plex Media Server Logs_2021-06-02_21-18-22.zip (581.2 KB)

I am having the exact same issue. It just started happening after the second latest update and only effects part of my library. Some photos open fine and other display the Exception handled: std::bad_cast error.

Ditto. At first I thought it was the latest batch of photos I imported, but I’ve since found that I can’t open the vast majority of my older photos either. Happy to provide any logs or photo examples you need!

Nick

To save everyone a lot of typing.

If you see Photo failures and find std::bad_cast in your Plex logs,

Please “Like” this post. It’ll help me gauge the impact and how hard I need push the urgency :slight_smile:

28 Likes

Same here, searched for similar issues and ended up here.

1 Like

Interesting tidbit - I discovered last night that I don’t have any issues at all when viewing photos via the Plex app on my Roku stick. In fact, missing thumbnails from some of my folders show properly there too! I assumed everything had been magically fixed, but on Plex for my Mac or on the web it’s still broken…

Nick

1 Like

I had the same problem using version 1.23. Version 1.22 works on Ubuntu server.

You can use the links below if you need to download it:

Thanks for the hint.
So plex folks are still doing the carpe-diem-development instead of test-driven-development…
So great :smiley:

Same here. This is ruining my ability to use Plex as a photo store. :frowning:

ChuckPA,

I just installed 1.23.3.4692-c86c6f454 and the photos are back! Thanks for helping bring this to the dev group’s attention.

Regards!

2 Likes