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

asyncio.exceptions.CancelledError when connection drops #338

Open
basslet opened this issue Jan 9, 2025 · 0 comments
Open

asyncio.exceptions.CancelledError when connection drops #338

basslet opened this issue Jan 9, 2025 · 0 comments

Comments

@basslet
Copy link

basslet commented Jan 9, 2025

I keep having this recurring log entry created by custom_components.remote_homeassistant

My main and remote unit are connected via Powerline, which is occasionally a bit unstable. Remote homeassistant seems to have an issue when connections drop.

Core 2025.1.1
Supervisor 2024.12.3
Operating System 14.1
Frontend 20250106.0
Latest remote home assistant and HACS

This error originated from a custom integration.

Logger: custom_components.remote_homeassistant
Source: custom_components/remote_homeassistant/init.py:409
integration: Remote Home-Assistant (documentation, issues)
First occurred: 8 January 2025 at 22:10:35 (10 occurrences)
Last logged: 05:52:57

failed to connect
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1115, in _wrap_create_connection
sock = await aiohappyeyeballs.start_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 82, in start_connection
sock = await _connect_sock(
^^^^^^^^^^^^^^^^^^^^
current_loop, exceptions, addrinfo, local_addr_infos
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 174, in _connect_sock
await loop.sock_connect(sock, address)
File "/usr/local/lib/python3.13/asyncio/selector_events.py", line 641, in sock_connect
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.13/site-packages/aiohttp/client.py", line 703, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
req, traces=traces, timeout=real_timeout
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 548, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1056, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1400, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1369, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<7 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1112, in _wrap_create_connection
async with ceil_timeout(
~~~~~~~~~~~~^
timeout.sock_connect, ceil_threshold=timeout.ceil_threshold
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in aexit
raise TimeoutError from exc_val
TimeoutError

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

Traceback (most recent call last):
File "/config/custom_components/remote_homeassistant/init.py", line 409, in _async_instance_get_info
return await async_get_discovery_info(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<6 lines>...
)
^
File "/config/custom_components/remote_homeassistant/rest_api.py", line 47, in async_get_discovery_info
async with session.get(url, headers=headers) as resp:
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 1425, in aenter
self._resp: _RetType = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 707, in _request
raise ConnectionTimeoutError(
f"Connection timeout to host {url}"
) from exc
aiohttp.client_exceptions.ConnectionTimeoutError: Connection timeout to host http://192.168.1.12:8123/api/remote_homeassistant/discovery

home-assistant_tibber_2025-01-09T10-32-29.281Z.log

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

1 participant