home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.91k stars 30.98k forks source link

Bluetooth: Task exception was never retrieved #100105

Closed nawwman closed 1 year ago

nawwman commented 1 year ago

The problem

Noticed the following errors in my logs, don't know what it is as I don't even use bluetooth for anything

What version of Home Assistant Core has the issue?

core-2023.9.1

What was the last working version of Home Assistant Core?

core-2023.8.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

components/bluetooth/util.py

Link to integration documentation on our website

No response

Diagnostics information

System Information

version core-2023.9.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.5
os_name Linux
os_version 6.1.21-v7
arch armv7l
timezone Europe/Berlin
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4815 Installed Version | 1.32.1 Stage | running Available Repositories | 1286 Downloaded Repositories | 29
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 10.5 -- | -- update_channel | stable supervisor_version | supervisor-2023.08.3 agent_version | 1.5.1 docker_version | 23.0.6 disk_total | 28.5 GB disk_used | 15.8 GB healthy | true supported | true board | rpi3 supervisor_api | ok version_api | ok installed_addons | File editor (5.6.0), Samba share (10.0.2), Z-Wave JS (0.1.89), Node-RED (14.4.5), Advanced SSH & Web Terminal (15.0.7), Grafana (9.0.3), Log Viewer (0.15.1), InfluxDB (4.7.0), Home Assistant Google Drive Backup (0.111.1), Mosquitto broker (6.3.1), Zigbee2MQTT (1.33.0-1)
Dashboards dashboards | 2 -- | -- resources | 21 views | 5 mode | storage
Recorder oldest_recorder_run | September 7, 2023 at 17:22 -- | -- current_recorder_run | September 9, 2023 at 09:16 estimated_db_size | 279.10 MiB database_engine | sqlite database_version | 3.41.2

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant
Source: components/bluetooth/util.py:78
First occurred: September 9, 2023 at 09:17:48 (5844 occurrences)
Last logged: 09:59:26

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 348, in _async_restart_scanner
    await self._async_reset_adapter()
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/scanner.py", line 364, in _async_reset_adapter
    result = await async_reset_adapter(self.adapter, self.mac_address)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/util.py", line 78, in async_reset_adapter
    return await recover_adapter(adapter_id, mac_address)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 393, in recover_adapter
    if adapter and await _power_cycle_adapter(adapter):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 468, in _power_cycle_adapter
    return await _execute_reset(adapter)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 554, in _execute_reset
    power_state_before_reset = await adapter.get_powered()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 265, in get_powered
    response = await self.protocol.send("ReadControllerInformation", self.idx)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetooth_auto_recovery/recover.py", line 153, in send
    with asyncio_timeout(self.timeout):
TypeError: 'Timeout' object does not support the context manager protocol

Additional information

No response

bdraco commented 1 year ago

duplicate of https://github.com/home-assistant/core/issues/99977#issuecomment-1712518332