Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaBrowser "Error handling message: Unknown error" for Kodi #48927

Closed
Shamshala opened this issue Apr 9, 2021 · 5 comments · Fixed by OnFreund/PyKodi#12 or #48930
Closed

MediaBrowser "Error handling message: Unknown error" for Kodi #48927

Shamshala opened this issue Apr 9, 2021 · 5 comments · Fixed by OnFreund/PyKodi#12 or #48930
Assignees

Comments

@Shamshala
Copy link

Shamshala commented Apr 9, 2021

The problem

Any attempt to browse media from Kodi produces "Error handling message: Unknown error".

Similar to errors in #48588 and #48893 but PR #48913 hasn't solved it.

Btw: Kodi v19

What is version of Home Assistant Core has the issue?

2021.4.0

What was the last working version of Home Assistant Core?

2021.3.3

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Kodi

Link to integration documentation on our website

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/kodi/browse_media.py:295
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:51:18 (3 occurrences)
Last logged: 13:33:42

[140512746890816] Error handling message: Unknown error
[140512189933456] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1107, in websocket_browse_media
    payload = await player.async_browse_media(media_content_type, media_content_id)
  File "/usr/src/homeassistant/homeassistant/components/kodi/media_player.py", line 902, in async_browse_media
    response = await build_item_response(self._kodi, payload, _get_thumbnail_url)
  File "/usr/src/homeassistant/homeassistant/components/kodi/browse_media.py", line 67, in build_item_response
    _, title, media = await get_media_info(media_library, search_id, search_type)
  File "/usr/src/homeassistant/homeassistant/components/kodi/browse_media.py", line 295, in get_media_info
    media = await media_library.get_movies(properties)
  File "/usr/local/lib/python3.8/site-packages/pykodi/kodi.py", line 356, in get_movies
    return await self._server.VideoLibrary.GetMovies(
  File "/usr/local/lib/python3.8/site-packages/jsonrpc_websocket/jsonrpc.py", line 53, in send_message
    return message.parse_response(response)
  File "/usr/local/lib/python3.8/site-packages/jsonrpc_base/jsonrpc.py", line 216, in parse_response
    raise ProtocolError(code, message, data)
jsonrpc_base.jsonrpc.ProtocolError: (-32602, 'Invalid params.', {'error': {'code': -32602, 'data': {'method': 'VideoLibrary.GetMovies', 'stack': {'message': 'Invalid type object received', 'name': 'properties', 'type': 'array'}}, 'message': 'Invalid params.'}, 'id': 4324245242391959688, 'jsonrpc': '2.0'})


__________________________________________________________________________


Logger: homeassistant.components.websocket_api.http.connection
Source: components/kodi/browse_media.py:336
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 13:33:40 (1 occurrences)
Last logged: 13:33:40

[140512189933456] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1107, in websocket_browse_media
    payload = await player.async_browse_media(media_content_type, media_content_id)
  File "/usr/src/homeassistant/homeassistant/components/kodi/media_player.py", line 902, in async_browse_media
    response = await build_item_response(self._kodi, payload, _get_thumbnail_url)
  File "/usr/src/homeassistant/homeassistant/components/kodi/browse_media.py", line 67, in build_item_response
    _, title, media = await get_media_info(media_library, search_id, search_type)
  File "/usr/src/homeassistant/homeassistant/components/kodi/browse_media.py", line 336, in get_media_info
    media = await media_library.get_channels(
  File "/usr/local/lib/python3.8/site-packages/pykodi/kodi.py", line 399, in get_channels
    return await self._server.PVR.GetChannels(
  File "/usr/local/lib/python3.8/site-packages/jsonrpc_websocket/jsonrpc.py", line 53, in send_message
    return message.parse_response(response)
  File "/usr/local/lib/python3.8/site-packages/jsonrpc_base/jsonrpc.py", line 216, in parse_response
    raise ProtocolError(code, message, data)
jsonrpc_base.jsonrpc.ProtocolError: (-32602, 'Invalid params.', {'error': {'code': -32602, 'data': {'method': 'PVR.GetChannels', 'stack': {'message': 'Invalid type object received', 'name': 'channelgroupid', 'type': ['string', 'integer']}}, 'message': 'Invalid params.'}, 'id': 1710379898886725555, 'jsonrpc': '2.0'})

__________________________________________________________________________


Logger: homeassistant.components.websocket_api.http.connection
Source: components/kodi/browse_media.py:258
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 13:33:36 (1 occurrences)
Last logged: 13:33:36

[140512189933456] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1107, in websocket_browse_media
    payload = await player.async_browse_media(media_content_type, media_content_id)
  File "/usr/src/homeassistant/homeassistant/components/kodi/media_player.py", line 902, in async_browse_media
    response = await build_item_response(self._kodi, payload, _get_thumbnail_url)
  File "/usr/src/homeassistant/homeassistant/components/kodi/browse_media.py", line 67, in build_item_response
    _, title, media = await get_media_info(media_library, search_id, search_type)
  File "/usr/src/homeassistant/homeassistant/components/kodi/browse_media.py", line 258, in get_media_info
    media = await media_library.get_albums(properties=properties)
  File "/usr/local/lib/python3.8/site-packages/pykodi/kodi.py", line 332, in get_albums
    return await self._server.AudioLibrary.GetAlbums(
  File "/usr/local/lib/python3.8/site-packages/jsonrpc_websocket/jsonrpc.py", line 53, in send_message
    return message.parse_response(response)
  File "/usr/local/lib/python3.8/site-packages/jsonrpc_base/jsonrpc.py", line 216, in parse_response
    raise ProtocolError(code, message, data)
jsonrpc_base.jsonrpc.ProtocolError: (-32602, 'Invalid params.', {'error': {'code': -32602, 'data': {'method': 'AudioLibrary.GetAlbums', 'stack': {'message': 'Invalid type object received', 'name': 'properties', 'type': 'array'}}, 'message': 'Invalid params.'}, 'id': 288035796304730662, 'jsonrpc': '2.0'})

__________________________________________________________________________


Logger: homeassistant.components.websocket_api.http.connection
Source: components/kodi/browse_media.py:314
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 13:33:39 (1 occurrences)
Last logged: 13:33:39

[140512189933456] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1107, in websocket_browse_media
    payload = await player.async_browse_media(media_content_type, media_content_id)
  File "/usr/src/homeassistant/homeassistant/components/kodi/media_player.py", line 902, in async_browse_media
    response = await build_item_response(self._kodi, payload, _get_thumbnail_url)
  File "/usr/src/homeassistant/homeassistant/components/kodi/browse_media.py", line 67, in build_item_response
    _, title, media = await get_media_info(media_library, search_id, search_type)
  File "/usr/src/homeassistant/homeassistant/components/kodi/browse_media.py", line 314, in get_media_info
    media = await media_library.get_tv_shows(properties)
  File "/usr/local/lib/python3.8/site-packages/pykodi/kodi.py", line 387, in get_tv_shows
    return await self._server.VideoLibrary.GetTVShows(
  File "/usr/local/lib/python3.8/site-packages/jsonrpc_websocket/jsonrpc.py", line 53, in send_message
    return message.parse_response(response)
  File "/usr/local/lib/python3.8/site-packages/jsonrpc_base/jsonrpc.py", line 216, in parse_response
    raise ProtocolError(code, message, data)
jsonrpc_base.jsonrpc.ProtocolError: (-32602, 'Invalid params.', {'error': {'code': -32602, 'data': {'method': 'VideoLibrary.GetTVShows', 'stack': {'message': 'Invalid type object received', 'name': 'properties', 'type': 'array'}}, 'message': 'Invalid params.'}, 'id': 1135786741986006765, 'jsonrpc': '2.0'})
@cgtobi
Copy link
Contributor

cgtobi commented Apr 9, 2021

Thanks for reporting.

@cgtobi cgtobi mentioned this issue Apr 9, 2021
21 tasks
@Shamshala
Copy link
Author

You are lightning-fast guys! Seems fixed.

@cgtobi
Copy link
Contributor

cgtobi commented Apr 9, 2021

Thanks for testing.

@Shamshala
Copy link
Author

Shamshala commented Apr 9, 2021

@cgtobi Ok, i think i can close this.

But before that may i have a few tiny questions? Is by design that MediaBrowser loads images probably via Kodi's auto fetching function instead of using local files? My library is just a mess of random images from the movies(but none of the images are in my library folders), only some of them are real posters (it loads different posters, in English) and it looks like it zooms-in so the images are cropped.
Should i create a new issue or rather continue in one of the previous ones related to loading images? Thanks!

EDIT: Now i realized that i never thanked for the fix. 😞 I'm really sorry and thank you so much!
EDIT2: Oh i see now, it is local and Kodi integration looks for thumbnails instead of posters (and in case of a missing thumb file, kodi creates its own from a media file).

@cgtobi
Copy link
Contributor

cgtobi commented Apr 9, 2021

Yes, exactly. We don't query the web in that case.

@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants