[Issue]: Invalid Json in response #3675

Closed
opened 2025-12-21 22:33:28 +01:00 by backuprepo · 2 comments
Owner

Originally created by @yenon on GitHub (Mar 18, 2022).

Please describe your bug

Querying the /Sessions endpoint of the REST-API can result in invalid JSON responses. The offending property is "SupportsPersistentIdentifier", which on my current testing setup may have the value of:
true* Connection #0 to host 192.168.178.117 left intact
without string quotes. This will result in some json-librarys failing to parse the response.

Jellyfin Version

10.7.7

if other:

No response

Environment

- OS: Arch Linux
- Virtualization: Docker
- Clients: VolumioPi over DLNA
- Browser: does not matter
- FFmpeg Version: whatever is bundled in current container
- Playback Method: none running
- Hardware Acceleration: yes
- Plugins: webhook
- Reverse Proxy: none
- Base URL:
- Networking:
- Storage:

Jellyfin logs

Merely webhook returning the error of Flask.

FFmpeg logs

No response

Please attach any browser or client logs here

[2022-03-18 02:03:36,496] INFO in _internal: 127.0.0.1 - - [18/Mar/2022 02:03:36] "POST / HTTP/1.1" 500 -
Traceback (most recent call last):
File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
StopIteration: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/yenon/PycharmProjects/Notifier/venv/lib/python3.10/site-packages/requests/models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

offending JSON section:

   {
      "PlayState":{
         "CanSeek":false,
         "IsPaused":false,
         "IsMuted":false,
         "RepeatMode":"RepeatNone"
      },
      "AdditionalUsers":[
         
      ],
      "Capabilities":{
         "PlayableMediaTypes":[
            "Audio",
            "Photo",
            "Video"
         ],
         "SupportedCommands":[
            "VolumeDown",
            "VolumeUp",
            "Mute",
            "Unmute",
            "ToggleMute",
            "SetVolume",
            "SetAudioStreamIndex",
            "SetSubtitleStreamIndex",
            "PlayMediaSource"
         ],
         "SupportsMediaControl":true,
         "SupportsContentUploading":false,
         "SupportsPersistentIdentifier":true* Connection #0 to host 192.168.178.117 left intact,
         "SupportsSync":false
      },
      "RemoteEndPoint":"http://192.168.178.29:49152/description.xml",
      "PlayableMediaTypes":[
         "Audio",
         "Photo",
         "Video"
      ],
      "Id":"90d8faf4d7410472e97c40d5a54a7db7",
      "UserId":"00000000000000000000000000000000",
      "Client":"DLNA",
      "LastActivityDate":"2022-03-17T22:36:15.5569283Z",
      "LastPlaybackCheckIn":"0001-01-01T00:00:00.0000000Z",
      "DeviceName":"Volumiopi",
      "DeviceId":"528a4f38-25c5-c1f3-ecd9-b827eb2b52c7",
      "ApplicationVersion":"10.7.7",
      "IsActive":true,
      "SupportsMediaControl":true,
      "SupportsRemoteControl":true,
      "HasCustomDeviceName":false,
      "ServerId":"3e9fb5ede47c43a68210230e742f1e20",
      "SupportedCommands":[
         "VolumeDown",
         "VolumeUp",
         "Mute",
         "Unmute",
         "ToggleMute",
         "SetVolume",
         "SetAudioStreamIndex",
         "SetSubtitleStreamIndex",
         "PlayMediaSource"
      ]
   }
Originally created by @yenon on GitHub (Mar 18, 2022). ### Please describe your bug Querying the /Sessions endpoint of the REST-API can result in invalid JSON responses. The offending property is "SupportsPersistentIdentifier", which on my current testing setup may have the value of: true* Connection #0 to host 192.168.178.117 left intact without string quotes. This will result in some json-librarys failing to parse the response. ### Jellyfin Version 10.7.7 ### if other: _No response_ ### Environment ```markdown - OS: Arch Linux - Virtualization: Docker - Clients: VolumioPi over DLNA - Browser: does not matter - FFmpeg Version: whatever is bundled in current container - Playback Method: none running - Hardware Acceleration: yes - Plugins: webhook - Reverse Proxy: none - Base URL: - Networking: - Storage: ``` ### Jellyfin logs ```shell Merely webhook returning the error of Flask. ``` ### FFmpeg logs _No response_ ### Please attach any browser or client logs here [2022-03-18 02:03:36,496] INFO in _internal: 127.0.0.1 - - [18/Mar/2022 02:03:36] "POST / HTTP/1.1" 500 - Traceback (most recent call last): File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) StopIteration: 0 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/yenon/PycharmProjects/Notifier/venv/lib/python3.10/site-packages/requests/models.py", line 910, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.10/json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ### Please attach any screenshots here _No response_ ### Code of Conduct - [X] I agree to follow this project's Code of Conduct ### offending JSON section: ```json { "PlayState":{ "CanSeek":false, "IsPaused":false, "IsMuted":false, "RepeatMode":"RepeatNone" }, "AdditionalUsers":[ ], "Capabilities":{ "PlayableMediaTypes":[ "Audio", "Photo", "Video" ], "SupportedCommands":[ "VolumeDown", "VolumeUp", "Mute", "Unmute", "ToggleMute", "SetVolume", "SetAudioStreamIndex", "SetSubtitleStreamIndex", "PlayMediaSource" ], "SupportsMediaControl":true, "SupportsContentUploading":false, "SupportsPersistentIdentifier":true* Connection #0 to host 192.168.178.117 left intact, "SupportsSync":false }, "RemoteEndPoint":"http://192.168.178.29:49152/description.xml", "PlayableMediaTypes":[ "Audio", "Photo", "Video" ], "Id":"90d8faf4d7410472e97c40d5a54a7db7", "UserId":"00000000000000000000000000000000", "Client":"DLNA", "LastActivityDate":"2022-03-17T22:36:15.5569283Z", "LastPlaybackCheckIn":"0001-01-01T00:00:00.0000000Z", "DeviceName":"Volumiopi", "DeviceId":"528a4f38-25c5-c1f3-ecd9-b827eb2b52c7", "ApplicationVersion":"10.7.7", "IsActive":true, "SupportsMediaControl":true, "SupportsRemoteControl":true, "HasCustomDeviceName":false, "ServerId":"3e9fb5ede47c43a68210230e742f1e20", "SupportedCommands":[ "VolumeDown", "VolumeUp", "Mute", "Unmute", "ToggleMute", "SetVolume", "SetAudioStreamIndex", "SetSubtitleStreamIndex", "PlayMediaSource" ] } ```
backuprepo 2025-12-21 22:33:28 +01:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@nielsvanvelzen commented on GitHub (Mar 18, 2022):

I do not believe this malformed JSON is generated by the server. It might be caused by your HTTP client or something. A quick search pointed to this StackOverflow question about a similar issue: https://stackoverflow.com/questions/61880928/what-does-connection-0-to-host-example-com-left-intact-mean

@nielsvanvelzen commented on GitHub (Mar 18, 2022): I do not believe this malformed JSON is generated by the server. It might be caused by your HTTP client or something. A quick search pointed to this StackOverflow question about a similar issue: https://stackoverflow.com/questions/61880928/what-does-connection-0-to-host-example-com-left-intact-mean
Author
Owner

@yenon commented on GitHub (Mar 19, 2022):

Might be the case, i'm not too familiar with python, flask and requests. I had some odd json-parsing errors too, and must have stumbled on this with curl.

@yenon commented on GitHub (Mar 19, 2022): Might be the case, i'm not too familiar with python, flask and requests. I had some odd json-parsing errors too, and must have stumbled on this with curl.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#3675
No description provided.