custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.92k stars 248 forks source link

[Bug]: async_forward_entry_setup #1376

Closed Elarion245 closed 3 months ago

Elarion245 commented 4 months ago

What happened?

I receive the following warning with the most recent version after upgrading to HAOS 12.4 (may be unrelated, but resulted in a full reboot):

Detected code that calls async_forward_entry_setup for integration ble_monitor with title: Bluetooth Low Energy Monitor and entry_id: 31143dd8cd98276a53e38a03917e4125, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.

Sensor type

I assume independent of sensor?

Relevant log output

2024-07-09 17:36:23.089 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration ble_monitor with title: Bluetooth Low Energy Monitor and entry_id: 31143dd8cd98276a53e38a03917e4125, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2122, in async_forward_entry_setup
_report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1175, in _report_non_awaited_platform_forwards
report(
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
_LOGGER.warning(msg, stack_info=True)
Elarion245 commented 4 months ago

In the meantime I also receive the following message in addition:

Detected that custom integration 'ble_monitor' calls async_forward_entry_setup for integration, ble_monitor with title: Bluetooth Low Energy Monitor and entry_id: 31143dd8cd98276a53e38a03917e4125, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/ble_monitor/__init__.py, line 354: hass.async_create_task(, please create a bug report at https://github.com/custom-components/ble_monitor/issues

In full:

2024-07-25 22:22:04.886 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'ble_monitor' calls async_forward_entry_setup for integration, ble_monitor with title: Bluetooth Low Energy Monitor and entry_id: 31143dd8cd98276a53e38a03917e4125, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/ble_monitor/__init__.py, line 354: hass.async_create_task(, please create a bug report at https://github.com/custom-components/ble_monitor/issues
2024-07-25 22:22:21.846 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration ble_monitor with title: Bluetooth Low Energy Monitor and entry_id: 31143dd8cd98276a53e38a03917e4125, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Ernst79 commented 4 months ago

Did you update ble monitor to the latest version? It should already be fixed

Elarion245 commented 4 months ago

Yes, I am on 12.13.0

Ernst79 commented 4 months ago

Ok, I can conform your issue. Related HA change https://developers.home-assistant.io/blog/2024/06/12/async_forward_entry_setups. Will fix it asap, but can take a few weeks due to holidays

Elarion245 commented 4 months ago

Great news. Many thanks,

Hadatko commented 3 months ago

+1

Ernst79 commented 3 months ago

Fixed in 12.15.0

Elarion245 commented 3 months ago

Confirmed. Many thanks for your efforts!

sahmeepee commented 3 months ago

Many thanks for this. From what I could see my BLE sensors stopped working until I upgraded HAOS to the current version (just applying this update didn't seem to be enough on its own), but I've since done that and it all seems to be working nicely again, so thank you.

teskanoo commented 3 months ago

Thanks Ernst79