Closed haaino closed 6 months ago
Same problem here since HA 2024.5
same issue here...fine when winding back to 2024.4......thanks in advance for a fantastic integration
this has obviously caused some issues as all sensors are now unavailable
errors added for clarity
2024-05-02 09:42:12.253 WARNING (SyncWorker_21) [homeassistant.helpers.frame] Detected that custom integration 'ha_strava' calls async_create_task from a thread at custom_components/ha_strava/init.py, line 796: hass.async_create_task(strava_startup_functions()), please report it to the author of the 'ha_strava' custom integration
File "/config/custom_components/ha_strava/init.py", line 796, in component_reload_handler
hass.async_create_task(strava_startup_functions())
RuntimeError: Detected that custom integration 'ha_strava' calls async_create_task from a thread at custom_components/ha_strava/init.py, line 796: hass.async_create_task(strava_startup_functions()). Please report it to the author of the 'ha_strava' custom integration.
2024-05-02 09:42:12.306 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1973: RuntimeWarning: coroutine 'async_setup_entry.
Additional issues caused by ha core changing the logic to call methods via a thread instead of on the main process.
Detected that custom integration 'ha_strava' calls async_write_ha_state from a thread at custom_components/ha_strava/sensor.py, line 724: self.async_write_ha_state(), please report it to the author of the 'ha_strava' custom integration
Detected that custom integration 'ha_strava' calls async_write_ha_state from a thread at custom_components/ha_strava/sensor.py, line 340: self.async_write_ha_state(), please report it to the author of the 'ha_strava' custom integration
Logger: homeassistant
Source: helpers/frame.py:203
First occurred: 22:07:36 (91 occurrences)
Last logged: 22:07:37
Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_strava/sensor.py", line 724, in strava_data_update_event_handler
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state
self.hass.verify_event_loop_thread("async_write_ha_state")
File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread
frame.report(
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report
_report_integration(what, integration_frame, level, error_if_integration)
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration
raise RuntimeError(
RuntimeError: Detected that custom integration 'ha_strava' calls async_write_ha_state from a thread at custom_components/ha_strava/sensor.py, line 724: self.async_write_ha_state(). Please report it to the author of the 'ha_strava' custom integration.
Unfortunately this issue is going to affect many custom integrations as there wasn't a heads up for the breaking change in HA Core.
Release 3.2.33 should resolve this issue
Thanks for the patience and support 👍🏻
can confirm 3.2.33 has completely resolved the issue, thanks as always for your assistance and prompt fix....very much appeciated
Hi,
I just installed HA 2024.5 and noticed a message in the logfile (see below). Hopefully this means something to someone.
Detected that custom integration 'ha_strava' calls async_create_task from a thread at custom_components/ha_strava/init.py, line 792: hass.async_create_task(strava_startup_functions()), please report it to the author of the 'ha_strava' custom integration
Best regards, Haaino