jbergler / hass-ttlock

Home Assistant integration for TTLock locks
69 stars 13 forks source link

TTlock Integration Fails to Set Up Due to OAuth2 AssertionError #137

Closed cloudbr34k84 closed 1 month ago

cloudbr34k84 commented 1 month ago

Describe the bug

The TTlock integration failed to set up in Home Assistant. The log reports an "Exception Group Traceback," indicating an unhandled error in a TaskGroup related to an AssertionError. This error occurred during the OAuth2 flow and cloud integration services, preventing the TTlock entry from being properly configured.

To Reproduce

Steps to reproduce the behavior:

  1. Install and configure the TTlock integration in Home Assistant.
  2. Restart Home Assistant to initialize the integration.
  3. Wait for the TTlock entry to attempt its setup.
  4. Check the logs for error messages related to the integration setup.

Expected behavior

The TTlock integration should set up correctly without errors, allowing full access to its functionalities in Home Assistant.

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 12:46:55 pm (3 occurrences)
Last logged: 12:46:55 pm

Error setting up entry TTlock for ttlock
Error setting up entry Brad Applegate for spotify
Error setting up entry Radio Browser for radio_browser
  + Exception Group Traceback (most recent call last):
  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
  |     result = await component.async_setup_entry(hass, self)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/config/custom_components/ttlock/__init__.py", line 61, in async_setup_entry
  |     await config_entry_oauth2_flow.async_get_config_entry_implementation(
  |   File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 427, in async_get_config_entry_implementation
  |     implementations = await async_get_implementations(hass, config_entry.domain)
  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 417, in async_get_implementations
  |     for impl in await get_impl(hass, domain):
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/src/homeassistant/homeassistant/components/cloud/account_link.py", line 41, in async_provide_implementation
  |     services = await _get_services(hass)
  |                ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/src/homeassistant/homeassistant/components/cloud/account_link.py", line 71, in _get_services
  |     services = await account_link.async_fetch_available_services(
  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/site-packages/hass_nabucasa/account_link.py", line 132, in async_fetch_available_services
  |     resp = await cloud.client.websession.get(
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 659, in _request
  |     conn = await self._connector.connect(
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 557, in connect
  |     proto = await self._create_connection(req, traces, timeout)
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1002, in _create_connection
  |     _, proto = await self._create_direct_connection(req, traces, timeout)
  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1305, in _create_direct_connection
  |     transp, proto = await self._wrap_create_connection(
  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1061, in _wrap_create_connection
  |     sock = await aiohappyeyeballs.start_connection(
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/site-packages/aiohappyeyeballs/impl.py", line 88, in start_connection
  |     else:  # using happy eyeballs
  |                      ^^^^^^^^^^^^
  |   File "/usr/local/lib/python3.12/site-packages/aiohappyeyeballs/_staggered.py", line 91, in staggered_race
  |   File "/usr/local/lib/python3.12/asyncio/taskgroups.py", line 145, in __aexit__
  |     raise me from None
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/usr/local/lib/python3.12/site-packages/aiohappyeyeballs/_staggered.py", line 85, in run_one_coro
    | AssertionError
    +------------------------------------
cloudbr34k84 commented 1 month ago

Sorry i was on my phone looking at this and then went to my computer and it appears ok