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.39k stars 30.29k forks source link

Risco [Local] timeout errors #118093

Closed liberomic closed 1 month ago

liberomic commented 4 months ago

The problem

Hi all,

randomly appears this error in the registry of HA, I have moved cuncurrent requests from 4 to 2 but the errors appear. Now the Risco Local work fine wit HA 2024.5.5

thanks for your working

What version of Home Assistant Core has the issue?

2024.5.5

What was the last working version of Home Assistant Core?

2004.3.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Risco

Link to integration documentation on our website

No response

Diagnostics information

Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ asyncio.exceptions.CancelledError

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

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 108, in send_command return await asyncio.wait_for(future, 10) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit raise TimeoutError from exc_val TimeoutError

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 4 months ago

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

Code owner commands Code owners of `risco` 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 risco` 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)


risco documentation risco source (message by IssueLinks)

OnFreund commented 4 months ago

Are there any other logs, or behavior that's not working?

Also, in your case, I would suggest a concurrency of 1.

liberomic commented 4 months ago

Error in Risco library

Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ asyncio.exceptions.CancelledError

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

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 108, in send_command return await asyncio.wait_for(future, 10) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit raise TimeoutError from exc_val TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 87, in _keep_alive await self.send_result_command("CLOCK") File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 98, in send_result_command command = await self.send_command(command) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 110, in send_command raise OperationError(f'Timeout in command: {command}') pyrisco.common.OperationError: Timeout in command: CLOCK


Error in Risco library

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 65, in _listen cmd_id, command, crc = await self._read_command() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_socket.py", line 123, in _read_command return self._crypt.decode(buffer) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrisco/local/risco_crypt.py", line 47, in decode decrypted = decrypted_chars.decode(self._encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 32: invalid start byte

OnFreund commented 4 months ago

Ok, the full logs help. Seems like your panel is replying with malformed data, causing the timeout. Not sure how to solve this, but as long as it's only happening on CLOCK commands, it should be benign.

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.