Skip to content

async_dispatcher_send error #13

@DarwinData

Description

@DarwinData

Version of the custom_component
v0.0.5

Describe the bug
100s of errors in the logs with this version. Previous version was fine.

log

Add your logs here.
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:350
First occurred: 11:45:17 AM (127 occurrences)
Last logged: 1:51:17 PM

Detected that integration 'persistent_notification' calls async_dispatcher_send from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_dispatcher_send at homeassistant/components/persistent_notification/__init__.py, line 114: async_dispatcher_send(. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+persistent_notification%22

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:987
First occurred: 11:45:17 AM (127 occurrences)
Last logged: 1:51:17 PM

Update for sensor.last_successful_authentication fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 987, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1365, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 86, in run
    result = ctx.run(self.task)
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 73, in run
    return fn(*args, **kwargs)
  File "/config/custom_components/authenticated/sensor.py", line 254, in update
    ipaddress.notify(self.hass)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/config/custom_components/authenticated/sensor.py", line 482, in notify
    async_create(
    ~~~~~~~~~~~~^
        hass, message, title="New successful login", notification_id=self.ip_address
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/components/persistent_notification/__init__.py", line 114, in async_create
    async_dispatcher_send(
    ~~~~~~~~~~~~~~~~~~~~~^
        hass,
        ^^^^^
    ...<2 lines>...
        {notification_id: notifications[notification_id]},
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/dispatcher.py", line 214, in async_dispatcher_send
    hass.verify_event_loop_thread("async_dispatcher_send")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 428, in verify_event_loop_thread
    frame.report_non_thread_safe_operation(what)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 417, in report_non_thread_safe_operation
    report_usage(
    ~~~~~~~~~~~~^
        f"calls {what} from a thread other than the event loop, "
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
        custom_integration_behavior=ReportBehavior.ERROR,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 218, in report_usage
    future.result()
    ~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.14/concurrent/futures/_base.py", line 450, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.14/concurrent/futures/_base.py", line 395, in __get_result
    raise self._exception
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 67, in run_callback
    future.set_result(callback(*args))
                      ~~~~~~~~^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 266, in _report_usage
    _report_usage_integration_frame(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        hass,
        ^^^^^
    ...<4 lines>...
        integration_behavior is ReportBehavior.ERROR,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 366, in _report_usage_integration_frame
    raise RuntimeError(
    ...<5 lines>...
    )
RuntimeError: Detected that integration 'persistent_notification' calls async_dispatcher_send from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_dispatcher_send at homeassistant/components/persistent_notification/__init__.py, line 114: async_dispatcher_send(. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+persistent_notification%22


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions