homeassistant-blitzortung icon indicating copy to clipboard operation
homeassistant-blitzortung copied to clipboard

blitzortung is doing a non-thread safe operation

Open Mariusthvdb opened this issue 3 months ago • 0 comments

2024-03-23 20:28:57.295 ERROR (SyncWorker_7) [homeassistant.util.logging] Exception in _on_connection_change when dispatching 'blitzortung_mqtt_connected': ()
Traceback (most recent call last):
  File "/config/custom_components/blitzortung/__init__.py", line 222, in _on_connection_change
    sensor.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 992, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1175, in _async_write_ha_state
    hass.states.async_set(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1964, in async_set
    self._bus.async_fire(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1290, in async_fire
    self._hass.async_add_hass_job(job, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 603, in async_add_hass_job
    task = self.loop.create_task(hassjob.target(*args), name=hassjob.name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 457, in create_task
    task = tasks.Task(coro, loop=self, name=name, context=context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 795, in call_soon
    self._check_thread()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 832, in _check_thread
    raise RuntimeError(
RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one

which can crash the whole system, dixit core HA devs...

please have a look to fix this currenty, have to disable the integration because of it

Mariusthvdb avatar Mar 23 '24 21:03 Mariusthvdb