home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.79k stars 30.49k forks source link

LinkPlayRequestException: Exception occurred when communicating with API #129207

Open MahrWe opened 4 hours ago

MahrWe commented 4 hours ago

The problem

My systemlog is full of communication errors from what seems to be status updates of the linkplay mediaplayer. I have not found issues with the player status, maybe the issue is a short timeout period.

What version of Home Assistant Core has the issue?

2024.10.1

What was the last working version of Home Assistant Core?

2024.10.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Linkplay

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.helpers.entity
Quelle: helpers/entity.py:942
Erstmals aufgetreten: 13. Oktober 2024 um 15:23:21 (16146 Vorkommnisse)
Zuletzt protokolliert: 25. Oktober 2024 um 23:04:34

Update for media_player.kuche fails
Update for media_player.esszimmer fails
Update for media_player.multiroom fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/linkplay/utils.py", line 48, in session_call_api
    response = await session.get(url)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 686, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1022, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 643, in read
    await self._waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/linkplay/utils.py", line 47, in session_call_api
    async with async_timeout.timeout(API_TIMEOUT):
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 141, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 149, in _wrap
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 198, in async_update
    await self._bridge.player.update_status()
  File "/usr/local/lib/python3.12/site-packages/linkplay/bridge.py", line 92, in update_status
    properties: dict[PlayerAttribute, str] = await self.bridge.json_request(
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/linkplay/bridge.py", line 283, in json_request
    return await self.endpoint.json_request(command)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/linkplay/endpoint.py", line 51, in json_request
    return await session_call_api_json(self._endpoint, self._session, command)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/linkplay/utils.py", line 67, in session_call_api_json
    result = await session_call_api(endpoint, session, command)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/linkplay/utils.py", line 51, in session_call_api
    raise LinkPlayRequestException(
linkplay.exceptions.LinkPlayRequestException:  error requesting data from 'https://192.168.1.45/httpapi.asp?command=getPlayerStatusEx'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 151, in _wrap
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Exception occurred when communicating with API <function LinkPlayMediaPlayerEntity.async_update at 0x7f68f54a40>:  error requesting data from 'https://192.168.1.45/httpapi.asp?command=getPlayerStatusEx'

Additional information

No response

home-assistant[bot] commented 3 hours ago

Hey there @velleman, mind taking a look at this issue as it has been labeled with an integration (linkplay) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `linkplay` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign linkplay` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


linkplay documentation linkplay source (message by IssueLinks)