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

Local connection lost when WAN is down, error flooding #87

Open
N3rdix opened this issue Oct 1, 2024 · 5 comments
Open

Local connection lost when WAN is down, error flooding #87

N3rdix opened this issue Oct 1, 2024 · 5 comments

Comments

@N3rdix
Copy link

N3rdix commented Oct 1, 2024

Maybe a similar root cause like #43 but I observe a flood of error messages in the HA log when my internet connection goes down.
Last night there was a scheduled maintenance which caused hundred thousands of errors like these.

It seems the integration cannot recover from that state itself, reloading the integration doesn't fix it. The only way stopping the flood is pushing the small reconnect button on the LAN-C (or restarting the whole ComfoairQ).

Do you see any chance to analyze why this happens when the LAN-C loses internet connection?

Most prominent error:

Logger: homeassistant
Quelle: /usr/src/homeassistant/homeassistant/runner.py:147
Erstmals aufgetreten: 06:33:24 (2839 Vorkommnisse)
Zuletzt protokolliert: 06:43:44

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 218, in _process_message
    message = await self._read()
              ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 181, in _read
    msg_len_buf = await self._reader.readexactly(4)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/streams.py", line 750, in readexactly
    raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 4 expected bytes

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 113, in _read_messages
    await self._process_message()
  File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 252, in _process_message
    raise AioComfoConnectNotConnected("The connection was closed.") from exc
aiocomfoconnect.exceptions.AioComfoConnectNotConnected: The connection was closed.

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 121, in _read_messages
    raise AioComfoConnectNotConnected("We have been disconnected") from exc
aiocomfoconnect.exceptions.AioComfoConnectNotConnected: We have been disconnected
Logger: homeassistant
Quelle: /usr/src/homeassistant/homeassistant/runner.py:147
Erstmals aufgetreten: 06:39:08 (47 Vorkommnisse)
Zuletzt protokolliert: 06:43:44

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/comfoconnect.py", line 81, in _reconnect_loop
    read_task = await self._connect(uuid)
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiocomfoconnect/bridge.py", line 100, in _connect
    self._reader, self._writer = await asyncio.wait_for(asyncio.open_connection(self.host, self.PORT), TIMEOUT)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/streams.py", line 48, in open_connection
    transport, _ = await loop.create_connection(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1122, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1104, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1007, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 641, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 681, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('10.10.30.50', 56747)

Some warnings:

Logger: aiocomfoconnect.bridge
Quelle: runner.py:189
Erstmals aufgetreten: 06:33:24 (2983 Vorkommnisse)
Zuletzt protokolliert: 06:43:39

Timeout while waiting for response from bridge
Failed to decode message: Error parsing message
Timeout while connecting to bridge 10.10.30.50

@astyrrian1
Copy link

Seeing a lot of this same issue.

@N3rdix
Copy link
Author

N3rdix commented Oct 3, 2024

One more observation which makes this even more critical:
I just had a short connection issue in my LAN and the integration directly started flooding the same errors again. The only way getting out is to restart HA! A restart of the ConfoairQ did not help...

@N3rdix
Copy link
Author

N3rdix commented Oct 22, 2024

Anything we can do to support finding the root cause @michaelarnauts?

@astyrrian1
Copy link

I factory reset my ComfoLan C device and I am no longer seeing the error flooding. I am wondering if maybe this occurs when there are too many devices paired to the Lan C?

@N3rdix
Copy link
Author

N3rdix commented Oct 28, 2024

Good point, I'll go and delete some connections I don't need primarily and report back if anything changes when disconnecting the WAN connection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants