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

Handle timeout during setup #188

Closed
bdraco opened this issue Oct 7, 2022 · 2 comments · Fixed by home-assistant/core#80399
Closed

Handle timeout during setup #188

bdraco opened this issue Oct 7, 2022 · 2 comments · Fixed by home-assistant/core#80399

Comments

@bdraco
Copy link
Collaborator

bdraco commented Oct 7, 2022

Logger: homeassistant.config_entries
Source: components/esphome/bluetooth/client.py:66
First occurred: 12:21:49 PM (1 occurrences)
Last logged: 12:21:49 PM

Error setting up entry for homekit_controller
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 460, in send_message_await_response_complex
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 459, in send_message_await_response_complex
    async with async_timeout.timeout(timeout):
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/async_timeout/__init__.py", line 129, in __aexit__
    self._do_exit(exc_type)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

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

Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/homeassistant/components/esphome/bluetooth/client.py", line 64, in _async_wrap_bluetooth_operation
    return await func(self, *args, **kwargs)
  File "/Users/bdraco/home-assistant/homeassistant/components/esphome/bluetooth/client.py", line 323, in read_gatt_char
    return await self._client.bluetooth_gatt_read(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aioesphomeapi/client.py", line 538, in bluetooth_gatt_read
    resp = await self._connection.send_message_await_response_complex(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 462, in send_message_await_response_complex
    raise TimeoutAPIError(
aioesphomeapi.core.TimeoutAPIError: Timeout waiting for response for <class 'api_pb2.BluetoothGATTReadRequest'>

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

Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/homeassistant/config_entries.py", line 365, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/Users/bdraco/home-assistant/homeassistant/components/homekit_controller/__init__.py", line 42, in async_setup_entry
    await conn.async_setup()
  File "/Users/bdraco/home-assistant/homeassistant/components/homekit_controller/connection.py", line 198, in async_setup
    await self.pairing.async_populate_accessories_state(force_update=True)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 534, in async_populate_accessories_state
    await self._async_populate_accessories_state(force_update)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 110, in _async_wrap
    return await func(self, *args, **kwargs)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/client.py", line 76, in _async_wrap
    return await func(*args, **kwargs)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 546, in _async_populate_accessories_state
    await self._populate_accessories_and_characteristics(force_update)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 580, in _populate_accessories_and_characteristics
    await self._populate_char_values(config_changed)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 513, in _populate_char_values
    results = await self._get_characteristics_while_connected(chars)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 717, in _get_characteristics_while_connected
    data = await self._async_request_under_lock(OpCode.CHAR_READ, char)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/pairing.py", line 250, in _async_request_under_lock
    pdu_status, result_data = await ble_request(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/client.py", line 101, in ble_request
    return await _read_pdu(client, decryption_key, handle, tid)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohomekit/controller/ble/client.py", line 137, in _read_pdu
    data = await client.read_gatt_char(handle)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/bleak/__init__.py", line 482, in read_gatt_char
    return await self._backend.read_gatt_char(char_specifier, **kwargs)
  File "/Users/bdraco/home-assistant/homeassistant/components/esphome/bluetooth/client.py", line 52, in _async_wrap_bluetooth_connected_operation
    return await func(self, *args, **kwargs)
  File "/Users/bdraco/home-assistant/homeassistant/components/esphome/bluetooth/client.py", line 66, in _async_wrap_bluetooth_operation
    raise asyncio.TimeoutError(str(err)) from err
asyncio.exceptions.TimeoutError: Timeout waiting for response for <class 'api_pb2.BluetoothGATTReadRequest'>
@bdraco
Copy link
Collaborator Author

bdraco commented Oct 15, 2022

I think we should handle this in HASS instead

bdraco added a commit to bdraco/home-assistant that referenced this issue Oct 15, 2022
thecode pushed a commit to home-assistant/core that referenced this issue Oct 16, 2022
@bdraco
Copy link
Collaborator Author

bdraco commented Oct 18, 2022

fixed via home-assistant/core#80399

@bdraco bdraco closed this as completed Oct 18, 2022
balloob pushed a commit to home-assistant/core that referenced this issue Oct 20, 2022
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

Successfully merging a pull request may close this issue.

1 participant