yandex_smart_home icon indicating copy to clipboard operation
yandex_smart_home copied to clipboard

Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0xxxxxxx

Open to4ko opened this issue 9 months ago • 22 comments

с обновления ХА 2024.4.4 начались регулярные вылеты - лог забивается ошибка (как приведена ниже) и потом Супер стопает все.

2024-05-01 20:23:56.040 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f12b5603f70>() Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) RuntimeError: Cannot enter into task <Task pending name='listen state_changed' coro=<async_setup_notifier.<locals>._state_change_listener() running at /config/custom_components/yandex_smart_home/notifier.py:287> cb=[set.remove()]> while another task <Task finished name="event trigger {'domain': 'automation', 'name': 'system_update_available_and_installed_notification', 'home_assistant_start': True, 'variables': {'this': {'entity_id': 'automation.system_update_available_and_installed_notification', 'state': 'on', 'attributes': {'id': 'system_update_available_and_installed_notification', 'last_triggered': datetime.datetime(2024, 5, 1, 15, 57, 30, 269271, tzinfo=datetime.timezone.utc), 'mode': 'queued', 'current': 0, 'max': 10, 'friendly_name': 'system_update_available_and_installed_notification', 'icon': 'mdi:tune'}, 'last_changed': '2024-05-01T16:04:56.570965+00:00', 'last_reported': '2024-05-01T16:04:56.570990+00:00', 'last_updated': '2024-05-01T16:04:56.570965+00:00', 'context': {'id': '01HWTEDQKTMAAMQDSG9GR31K97', 'parent_id': None, 'user_id': None}}}, 'trigger_data': {'id': '0', 'idx': '0', 'alias': None}}" result=None> is being executed. 2024-05-01 20:23:56.056 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f12d46f03a0>() Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) RuntimeError: Cannot enter into task <Task pending name='Task-172845' coro=<YandexNotifier.async_event_handler() running at /config/custom_components/yandex_smart_home/notifier.py:173> cb=[gather.<locals>._done_callback() at /usr/local/lib/python3.12/asyncio/tasks.py:767]> while another task <Task finished name="event trigger {'domain': 'automation', 'name': 'system_update_available_and_installed_notification', 'home_assistant_start': True, 'variables': {'this': {'entity_id': 'automation.system_update_available_and_installed_notification', 'state': 'on', 'attributes': {'id': 'system_update_available_and_installed_notification', 'last_triggered': datetime.datetime(2024, 5, 1, 15, 57, 30, 269271, tzinfo=datetime.timezone.utc), 'mode': 'queued', 'current': 0, 'max': 10, 'friendly_name': 'system_update_available_and_installed_notification', 'icon': 'mdi:tune'}, 'last_changed': '2024-05-01T16:04:56.570965+00:00', 'last_reported': '2024-05-01T16:04:56.570990+00:00', 'last_updated': '2024-05-01T16:04:56.570965+00:00', 'context': {'id': '01HWTEDQKTMAAMQDSG9GR31K97', 'parent_id': None, 'user_id': None}}}, 'trigger_data': {'id': '0', 'idx': '0', 'alias': None}}" result=None> is being executed. 2024-05-01 20:23:56.060 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f12b5602bf0>() Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) RuntimeError: Cannot enter into task <Task pending name='Task-172846' coro=<YandexNotifier.async_event_handler() running at /config/custom_components/yandex_smart_home/notifier.py:173> cb=[gather.<locals>._done_callback() at /usr/local/lib/python3.12/asyncio/tasks.py:767]> while another task <Task finished name="event trigger {'domain': 'automation', 'name': 'system_update_available_and_installed_notification', 'home_assistant_start': True, 'variables': {'this': {'entity_id': 'automation.system_update_available_and_installed_notification', 'state': 'on', 'attributes': {'id': 'system_update_available_and_installed_notification', 'last_triggered': datetime.datetime(2024, 5, 1, 15, 57, 30, 269271, tzinfo=datetime.timezone.utc), 'mode': 'queued', 'current': 0, 'max': 10, 'friendly_name': 'system_update_available_and_installed_notification', 'icon': 'mdi:tune'}, 'last_changed': '2024-05-01T16:04:56.570965+00:00', 'last_reported': '2024-05-01T16:04:56.570990+00:00', 'last_updated': '2024-05-01T16:04:56.570965+00:00', 'context': {'id': '01HWTEDQKTMAAMQDSG9GR31K97', 'parent_id': None, 'user_id': None}}}, 'trigger_data': {'id': '0', 'idx': '0', 'alias': None}}" result=None> is being executed. 2024-05-01 20:23:56.065 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f12a3e9bee0>() Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) RuntimeError: Cannot enter into task <Task pending name='Task-172847' coro=<YandexNotifier.async_event_handler() running at /config/custom_components/yandex_smart_home/notifier.py:173> cb=[gather.<locals>._done_callback() at /usr/local/lib/python3.12/asyncio/tasks.py:767]> while another task <Task finished name="event trigger {'domain': 'automation', 'name': 'system_update_available_and_installed_notification', 'home_assistant_start': True, 'variables': {'this': {'entity_id': 'automation.system_update_available_and_installed_notification', 'state': 'on', 'attributes': {'id': 'system_update_available_and_installed_notification', 'last_triggered': datetime.datetime(2024, 5, 1, 15, 57, 30, 269271, tzinfo=datetime.timezone.utc), 'mode': 'queued', 'current': 0, 'max': 10, 'friendly_name': 'system_update_available_and_installed_notification', 'icon': 'mdi:tune'}, 'last_changed': '2024-05-01T16:04:56.570965+00:00', 'last_reported': '2024-05-01T16:04:56.570990+00:00', 'last_updated': '2024-05-01T16:04:56.570965+00:00', 'context': {'id': '01HWTEDQKTMAAMQDSG9GR31K97', 'parent_id': None, 'user_id': None}}}, 'trigger_data': {'id': '0', 'idx': '0', 'alias': None}}" result=None> is being executed. 2024-05-01 20:23:56.073 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback <_asyncio.TaskStepMethWrapper object at 0x7f12a3e9a770>() Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) RuntimeError: Cannot enter into task <Task pending name='Task-172848' coro=<YandexNotifier.async_event_handler() running at /config/custom_components/yandex_smart_home/notifier.py:173> cb=[gather.<locals>._done_callback() at /usr/local/lib/python3.12/asyncio/tasks.py:767]> while another task <Task finished name="event trigger {'domain': 'automation', 'name': 'system_update_available_and_installed_notification', 'home_assistant_start': True, 'variables': {'this': {'entity_id': 'automation.system_update_available_and_installed_notification', 'state': 'on', 'attributes': {'id': 'system_update_available_and_installed_notification', 'last_triggered': datetime.datetime(2024, 5, 1, 15, 57, 30, 269271, tzinfo=datetime.timezone.utc), 'mode': 'queued', 'current': 0, 'max': 10, 'friendly_name': 'system_update_available_and_installed_notification', 'icon': 'mdi:tune'}, 'last_changed': '2024-05-01T16:04:56.570965+00:00', 'last_reported': '2024-05-01T16:04:56.570990+00:00', 'last_updated':

to4ko avatar May 01 '24 17:05 to4ko

Не совсем понятно, что тут происходит. Нужен полный home-assistant.log и полный лог супервизора. Отключение интеграции на странице Настройки - Интеграции решает проблему? Какая версия компонента? (посмотреть в файле custom_conponents/yandex_smart_home/manifest.json)

dext0r avatar May 01 '24 18:05 dext0r

полный лог - 180мб, но в нем вопщем то и нет ничего, кроме ошибок приведенных выше. http://gofile.me/6V9I1/YjNeRPXwX

лог супера - в этот раз до супера не дошло, сделал рестарт контейнера, в следующий раз дождусь когда он притушит всех.

отключать интеграцию пока не пробовал

версия - "version": "0.6.12"

to4ko avatar May 01 '24 18:05 to4ko

а вот с 2024.5.0 прилетело

2024-05-01 22:20:23.635 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:2006: RuntimeWarning: coroutine 'YandexNotifier.async_event_handler' was never awaited def get_debug(self): 2024-05-01 22:20:23.635 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'ImportExecutor_0'. 2024-05-01 22:20:23.636 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'ImportExecutor_0'.

to4ko avatar May 01 '24 19:05 to4ko

Сохраняется ли проблема если отключить автоматизации: automation.system_update_available_and_installed_notification и automation.system_error_counter? Судя по логу наблюдается рекурсия между этими двумя автоматизациями

dext0r avatar May 02 '24 05:05 dext0r

отключил, проверю. но судя по синему чату - у людей без этих авто все норм. да и еще один инстанс у меня на 2024.4.0 работает без проблем

to4ko avatar May 02 '24 06:05 to4ko

даже часа не продержался инстанс

`2024-05-02 09:48:48.313 ERROR (SyncWorker_54) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 316, in _put_conn self.pool.put(conn, block=False) File "/usr/local/lib/python3.12/queue.py", line 137, in put raise Full queue.Full

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'SyncWorker_53'. 2024-05-02 09:48:48.355 WARNING (SyncWorker_54) [py.warnings] /usr/src/homeassistant/homeassistant/helpers/trace.py:76: RuntimeWarning: coroutine 'YandexNotifier.async_event_handler' was never awaited variables_cv.set(dict(variables))

2024-05-02 09:48:48.362 ERROR (SyncWorker_54) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 316, in _put_conn self.pool.put(conn, block=False) File "/usr/local/lib/python3.12/queue.py", line 137, in put raise Full queue.Full

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'SyncWorker_54'. 2024-05-02 09:48:48.369 ERROR (SyncWorker_54) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 316, in _put_conn self.pool.put(conn, block=False) File "/usr/local/lib/python3.12/queue.py", line 137, in put raise Full queue.Full

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'SyncWorker_54'. 2024-05-02 09:48:48.382 ERROR (SyncWorker_54) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 316, in _put_conn self.pool.put(conn, block=False) File "/usr/local/lib/python3.12/queue.py", line 137, in put raise Full queue.Full

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'SyncWorker_54'. 2024-05-02 09:48:48.383 WARNING (SyncWorker_54) [py.warnings] /usr/src/homeassistant/homeassistant/helpers/trace.py:79: RuntimeWarning: coroutine 'YandexNotifier.async_event_handler' was never awaited for key, value in variables.items()

2024-05-02 09:48:48.384 ERROR (SyncWorker_54) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 316, in _put_conn self.pool.put(conn, block=False) File "/usr/local/lib/python3.12/queue.py", line 137, in put raise Full queue.Full

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'SyncWorker_54'. 2024-05-02 09:48:48.402 ERROR (SyncWorker_54) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 316, in _put_conn self.pool.put(conn, block=False) File "/usr/local/lib/python3.12/queue.py", line 137, in put raise Full queue.Full

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'SyncWorker_54'. 2024-05-02 09:48:48.404 ERROR (SyncWorker_54) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 316, in _put_conn self.pool.put(conn, block=False) File "/usr/local/lib/python3.12/queue.py", line 137, in put raise Full queue.Full

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'SyncWorker_54'. 2024-05-02 09:48:48.425 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 316, in _put_conn self.pool.put(conn, block=False) File "/usr/local/lib/python3.12/queue.py", line 137, in put raise Full queue.Full

During handling of the above exception, another exception occurred:`

to4ko avatar May 02 '24 06:05 to4ko

на старте ХА насыпает

This error originated from a custom integration.

Logger: homeassistant Source: custom_components/yandex_smart_home/notifier.py:288 integration: Yandex Smart Home (documentation, issues) First occurred: 09:51:36 (170 occurrences) Last logged: 09:51:40

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'ImportExecutor_0'.

to4ko avatar May 02 '24 06:05 to4ko

Тоже нужен полный home-assistant.log, нужно смотреть какие события были вокруг этих исключений.

dext0r avatar May 02 '24 07:05 dext0r

на старте ХА насыпает

This error originated from a custom integration.

Logger: homeassistant Source: custom_components/yandex_smart_home/notifier.py:288 integration: Yandex Smart Home (documentation, issues) First occurred: 09:51:36 (170 occurrences) Last logged: 09:51:40

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather fut = ensure_future(arg, loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future loop = events.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'ImportExecutor_0'.

ссылка на полный лог http://gofile.me/6V9I1/JR2Pz8SrK

to4ko avatar May 02 '24 07:05 to4ko

Вижу, что активный спам начинается после сообщения: 2024-05-02 09:48:48.311 WARNING (SyncWorker_54) [urllib3.connectionpool] Connection pool is full, discarding connection: 192-168-1-47.69bcc3bed480455882f6dbffa7d34b1b.plex.direct. Connection pool size: 10 На этом адресе живёт плекс? Если попробовать временно выключить интеграцию с ним?

dext0r avatar May 02 '24 08:05 dext0r

Да. Тоже его вырубил. Мониторю

to4ko avatar May 02 '24 08:05 to4ko

вопщем без плекса пока живет. попробовал отключить интеграцию яндкса, сделал ребут ХА. включил и снова сделал ребут. логи приложил

без яндекса http://gofile.me/6V9I1/wci7Pao89

с яндексом http://gofile.me/6V9I1/xkKDAEBYh

to4ko avatar May 02 '24 11:05 to4ko

вопщем без плекса пока живет. попробовал отключить интеграцию яндкса, сделал ребут ХА. включил и снова сделал ребут. логи приложил

без яндекса http://gofile.me/6V9I1/wci7Pao89

с яндексом http://gofile.me/6V9I1/xkKDAEBYh

Особой разницы не вижу. Меня только смущает

2024-05-02 14:55:59.206 ERROR (ImportExecutor_0) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/yandex_smart_home/notifier.py", line 288, in _state_change_listener
    await asyncio.gather(*[n.async_event_handler(event) for n in hass.data[DOMAIN][NOTIFIERS]])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 831, in gather
    fut = ensure_future(arg, loop=loop)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 693, in ensure_future
    loop = events.get_event_loop()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/events.py", line 702, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'ImportExecutor_0'.
2024-05-02 14:55:59.209 WARNING (ImportExecutor_0) [py.warnings] /usr/src/homeassistant/homeassistant/core.py:727: RuntimeWarning: coroutine 'YandexNotifier.async_event_handler' was never awaited
  @callback

Мне не удаётся воспроизвести эту ситуацию у себя :( Уходит ли эта ошибка если добавить "import_executor": false в custom_components/yandex_smart_home/manifest.json?

dext0r avatar May 02 '24 13:05 dext0r

добавление запрета на экзекьютор не меняет ситуацию

http://gofile.me/6V9I1/W9glELtiy

to4ko avatar May 02 '24 15:05 to4ko

init.py.zip Распаковать и подменить custom_components/yandex_smart_home/init.py Фикс не окончательный, просто для проверки теории.

dext0r avatar May 02 '24 15:05 dext0r

увы, лучше не стало

image

home-assistant (3).log

to4ko avatar May 02 '24 16:05 to4ko

Ещё одна попытка :) Archive.zip - заменить init.py и notifier.py Перед этим стоит попробовать отключить hass_diagnostics, возможно она оказывает влияние.

dext0r avatar May 03 '24 06:05 dext0r

по мотивам вот этого https://github.com/home-assistant/core/issues/115071#issuecomment-2042086465

стал проверять и вот что нашлось https://github.com/AlexxIT/YandexStation/issues/503

его Алексей поправил - мониторю дальше

to4ko avatar May 03 '24 07:05 to4ko

У меня проблема была, что zeroconf работает в отдельном потоке. И из своего отдельного потока он пытался добавить задачу в асинхронную петлю основного потока. Такое конечно же нельзя делать.

ERROR (SyncWorker_54) - тоже означает, что ошибка происходит не в основном потоке. Поэтому нужно очень аккуратно работать с петлёй основного потока.

AlexxIT avatar May 03 '24 07:05 AlexxIT

Похоже проблема в hass_diagnostics, при её отключении ошибки пропадают.

dext0r avatar May 04 '24 09:05 dext0r

я после вчерашнего сообщения в чате его удалил на всех инстансах и применил фикс на statistics. значительно спокойней задышал ХА

to4ko avatar May 04 '24 09:05 to4ko

Верно. hass_diagnostics тоже нужно чинить

AlexxIT avatar May 04 '24 09:05 AlexxIT