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

Integration crashes #172

Open
igorbaikov opened this issue Dec 10, 2024 · 1 comment
Open

Integration crashes #172

igorbaikov opened this issue Dec 10, 2024 · 1 comment

Comments

@igorbaikov
Copy link

Logger: homeassistant.config_entries
Source: config_entries.py:640
First occurred: 02:16:48 (1 occurrences)
Last logged: 02:16:48

Error setting up entry ConnectLife (***ACCOUNT***) for connectlife
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1116, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs, sock=sock)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 1182, in create_connection
    transport, protocol = await self._create_connection_transport(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        ssl_shutdown_timeout=ssl_shutdown_timeout)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 1215, in _create_connection_transport
    await waiter
  File "/usr/local/lib/python3.13/asyncio/selector_events.py", line 980, in _read_ready__get_buffer
    nbytes = self._sock.recv_into(buf)
ConnectionResetError: [Errno 104] Connection reset by peer

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/connectlife/__init__.py", line 36, in async_setup_entry
    await api.login()
  File "/usr/local/lib/python3.13/site-packages/connectlife/api.py", line 66, in login
    await self._fetch_access_token()
  File "/usr/local/lib/python3.13/site-packages/connectlife/api.py", line 107, in _fetch_access_token
    await self._initial_access_token()
  File "/usr/local/lib/python3.13/site-packages/connectlife/api.py", line 113, in _initial_access_token
    async with session.post(self.login_url, data={
               ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
        "loginID": self._username,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
        "password": self._password,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        "APIKey": self.api_key
        ^^^^^^^^^^^^^^^^^^^^^^
    }) as response:
    ^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 1423, in __aenter__
    self._resp: _RetType = await self._coro
                           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 701, 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 544, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1050, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1394, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1363, 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 1124, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host accounts.eu1.gigya.com:443 ssl:default [Connection reset by peer]

Sometimes the integration crashes, and I have to reload it. I suppose it happens for some reason when SSL gets messed up, I'm not sure why and I should get it fixed (prob router or ISP error, doesn't matter), but it should not crash the integration. Otherwise the integration works great.

I use 0.20.2.

@oyvindwe
Copy link
Owner

I agree - network errors are not handled very well. I'll try to look into this.

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