home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.43k stars 30.68k forks source link

HA crash-looping when trying to use custom quirks in ZHA #125789

Closed AM5800 closed 1 month ago

AM5800 commented 1 month ago

The problem

I have a device that is not yet officially supported by ZHA, so I found a pull request that supposed to fix that and decided to try that out. https://github.com/zigpy/zha-device-handlers/pull/3075

However, I am having problems even before applying the code from the above PR:

I changed configuration.yaml to enable custom quirks and now my HA keeps crash looping(constantly restarts) and I am also having hard time getting meaningful logs from it. I only saw two meaningful exception over time(see below). Every time HA restarts - all logs are empty.

What version of Home Assistant Core has the issue?

core-2024.9.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ZHA

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

I added to configuration.yaml


zha:
   database_path: /config/zigbee.db
   enable_quirks: true
   custom_quirks_path: /config/zha_quirks/

Please note that zha_quirks folder is empty. But for what its worth - it does not matter what I put there.

Anything in the logs that might be useful for us?

At one point I left the system to crash loop for a while and then it finally loaded and I saw these exceptions in the log. But I am not 100% sure what was the state of my experiment at that point(e.g. was there anything in zha_quirks folder or not)

Logger: homeassistant.config_entries
Source: config_entries.py:604
First occurred: 21:07:12 (1 occurrences)
Last logged: 21:07:12

Error setting up entry ConBee II for zha
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/init.py", line 126, in async_setup_entry
    zha_gateway = await Gateway.async_from_config(zha_lib_data)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zha/application/gateway.py", line 233, in async_from_config
    await instance.async_add_executor_job(
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zhaquirks/init.py", line 436, in setup
    DEVICE_REGISTRY.purge_custom_quirks(custom_quirks_path)
  File "/usr/local/lib/python3.12/site-packages/zigpy/quirks/registry.py", line 57, in purge_custom_quirks
    _LOGGER.debug("Removing stale custom v1 quirk: %s", quirk)
  File "/usr/local/lib/python3.12/logging/init.py", line 1527, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/usr/local/lib/python3.12/logging/init.py", line 1684, in _log
    self.handle(record)
  File "/usr/local/lib/python3.12/logging/init.py", line 1700, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.12/logging/init.py", line 1762, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python3.12/logging/init.py", line 1028, in handle
    self.emit(record)
  File "/usr/src/homeassistant/homeassistant/components/zha/helpers.py", line 938, in emit
    async_dispatcher_send(
  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 462, in verify_event_loop_thread
    frame.report_non_thread_safe_operation(what)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 225, in report_non_thread_safe_operation
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 159, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 197, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that integration 'zha' 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/zha/helpers.py, line 938: 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+zha%22.

And

Device <Device model=None manuf=None nwk=0x8A54 ieee=00:17:88:01:0e:25:bb:e2 is_initialized=False> failed to initialize due to unexpected error
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 205, in initialize
    await self._initialize()
  File "/usr/local/lib/python3.12/site-packages/zigpy/util.py", line 136, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 226, in _initialize
    await self.get_node_descriptor()
  File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 191, in get_node_descriptor
    status, _, node_desc = await self.zdo.Node_Desc_req(self.nwk)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 339, in request
    await send_request()
  File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request
    await self.send_packet(
  File "/usr/local/lib/python3.12/site-packages/zigpy_deconz/zigbee/application.py", line 507, in send_packet
    await self._api.aps_data_request(
  File "/usr/local/lib/python3.12/site-packages/zigpy_deconz/api.py", line 882, in aps_data_request
    rsp = await self.send_command(
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy_deconz/api.py", line 508, in send_command
    return await self._command(cmd, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy_deconz/api.py", line 586, in _command
    self._uart.send(command.replace(seq=seq).serialize())
    ^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'send'

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @dmulcahey, @adminiuga, @puddly, @thejulianjes, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zha` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zha` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

brussene commented 1 month ago

I seem to have the same problem. Although the symptoms I am seeing are a bit different, my Home Assistant continues to the function but ZHA freezes and all of my ZHA devices either react really slow or not at all. Only after reloading the ZHA integration things come back to life and start reacting again. Have to reload ZHA 2 or 3 times a day now.

Seemed to be working back in version 2024.8

Context information:

Home Assistant: Core 2024.9.1 Supervisor 2024.09.1 Operating System 13.1 Frontend 20240906.0

ZHA with Sonoff Zigbee 3.0 USB Dongle E (EFR32MG21) running firmware version: 7.4.3.0 build 0 (SiLabs)

Running 1 quirk for my Aqara T1M ceiling light https://github.com/zigpy/zha-device-handlers/pull/3070 See also: https://community.home-assistant.io/t/new-aqara-light-switching-itself-on-unexpectedly/731053/39

Error logs:

Logger: homeassistant.components.automation.verlichting_badkamer_plafond_lamp_schakelaar
Source: helpers/script.py:525
integration: Automation (documentation, issues)
First occurred: September 12, 2024 at 22:55:54 (3 occurrences)
Last logged: September 12, 2024 at 22:55:54

Verlichting - Badkamer - Plafond Lamp (Schakelaar): Choose at step 1: choice 1: If at step 1: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object has no attribute 'send_unicast'
Verlichting - Badkamer - Plafond Lamp (Schakelaar): Choose at step 1: choice 1: Error executing script. Unexpected error for if at pos 1: 'NoneType' object has no attribute 'send_unicast'
Verlichting - Badkamer - Plafond Lamp (Schakelaar): Error executing script. Unexpected error for choose at pos 1: 'NoneType' object has no attribute 'send_unicast'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 646, in async_handle_toggle_service
    await async_handle_light_on_service(light, call)
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 626, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/zha/helpers.py", line 1288, in handler
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/light.py", line 181, in async_turn_on
    await self.entity_data.entity.async_turn_on(
  File "/usr/local/lib/python3.12/site-packages/zha/application/platforms/light/__init__.py", line 389, in async_turn_on
    result = await self._level_cluster_handler.move_to_level_with_on_off(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 85, in wrapper
    return await RETRYABLE_REQUEST_DECORATOR(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/util.py", line 136, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/zcl/__init__.py", line 378, in request
    return await self._endpoint.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request
    return await self.device.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 339, in request
    await send_request()
  File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request
    await self.send_packet(
  File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 764, in send_packet
    status, _ = await self._ezsp.send_unicast(
                      ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'send_unicast'

and

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:245
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: September 12, 2024 at 22:55:55 (12 occurrences)
Last logged: September 12, 2024 at 22:55:55

[139857757119840] Unexpected exception
[139857914248304] Unexpected exception
[139857914246144] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 626, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/zha/helpers.py", line 1288, in handler
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/light.py", line 181, in async_turn_on
    await self.entity_data.entity.async_turn_on(
  File "/usr/local/lib/python3.12/site-packages/zha/application/platforms/light/__init__.py", line 413, in async_turn_on
    result = await self._on_off_cluster_handler.on()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 85, in wrapper
    return await RETRYABLE_REQUEST_DECORATOR(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/util.py", line 136, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/zcl/__init__.py", line 378, in request
    return await self._endpoint.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request
    return await self.device.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 339, in request
    await send_request()
  File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request
    await self.send_packet(
  File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 764, in send_packet
    status, _ = await self._ezsp.send_unicast(
                      ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'send_unicast'

and

Logger: zigpy.zdo
Source: runner.py:189
First occurred: September 12, 2024 at 22:55:54 (489 occurrences)
Last logged: September 12, 2024 at 22:55:55

[0xda90:zdo] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 508, in reply return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 334, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 764, in send_packet status, _ = await self._ezsp.send_unicast( ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'send_unicast'
[0x10cb:zdo] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 508, in reply return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 334, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 764, in send_packet status, _ = await self._ezsp.send_unicast( ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'send_unicast'

and

Logger: zigpy.zcl
Source: runner.py:189
First occurred: September 12, 2024 at 19:31:40 (17 occurrences)
Last logged: September 12, 2024 at 23:13:17

[0x10CB:1:0x0020] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/general.py", line 630, in check_in_response await self.checkin_response(True, self.CHECKIN_FAST_POLL_TIMEOUT, tsn=tsn) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 85, in wrapper return await RETRYABLE_REQUEST_DECORATOR(func)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/util.py", line 136, in retry return await func() ^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/zcl/__init__.py", line 378, in request return await self._endpoint.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request return await self.device.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 339, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 752, in send_packet await self._ezsp.set_extended_timeout( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'set_extended_timeout'
[0x10CB:1:0x0001] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zigpy/zcl/__init__.py", line 416, in reply return await self._endpoint.reply( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 290, in reply return await self.device.reply( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 508, in reply return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 334, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 764, in send_packet status, _ = await self._ezsp.send_unicast( ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'send_unicast'
[0xF137:1:0x0020] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/general.py", line 630, in check_in_response await self.checkin_response(True, self.CHECKIN_FAST_POLL_TIMEOUT, tsn=tsn) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 85, in wrapper return await RETRYABLE_REQUEST_DECORATOR(func)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/util.py", line 136, in retry return await func() ^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/zcl/__init__.py", line 378, in request return await self._endpoint.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request return await self.device.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 339, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 752, in send_packet await self._ezsp.set_extended_timeout( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'set_extended_timeout'
[0x8416:1:0x000a] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zigpy/zcl/__init__.py", line 416, in reply return await self._endpoint.reply( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 290, in reply return await self.device.reply( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 508, in reply return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 334, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 764, in send_packet status, _ = await self._ezsp.send_unicast( ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'send_unicast'
[0x10CB:1:0x0020] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request return await self.device.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 339, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 827, in send_packet raise zigpy.exceptions.DeliveryError( zigpy.exceptions.DeliveryError: Failed to deliver message: <sl_Status.ZIGBEE_DELIVERY_FAILED: 3074> The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/general.py", line 630, in check_in_response await self.checkin_response(True, self.CHECKIN_FAST_POLL_TIMEOUT, tsn=tsn) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 84, in wrapper with wrap_zigpy_exceptions(): File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 76, in wrap_zigpy_exceptions raise ZHAException(message) from exc zha.exceptions.ZHAException: Failed to send request: Failed to deliver message: <sl_Status.ZIGBEE_DELIVERY_FAILED: 3074>
brussene commented 1 month ago

Disabled the quirk, lot less errors in the logs but still after a certain amount of time ZHA freezes. Still have this error though:

Logger: zigpy.zcl
Source: runner.py:189
First occurred: 10:46:00 (4 occurrences)
Last logged: 14:15:43

[0xF137:1:0x0020] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zigpy/zcl/__init__.py", line 378, in request return await self._endpoint.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request return await self.device.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 338, in request with self._pending.new(sequence) as req: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/util.py", line 300, in new raise ControllerException(f"Duplicate TSN: {sequence}") zigpy.exceptions.ControllerException: Duplicate TSN: 17 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/general.py", line 630, in check_in_response await self.checkin_response(True, self.CHECKIN_FAST_POLL_TIMEOUT, tsn=tsn) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 84, in wrapper with wrap_zigpy_exceptions(): File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 76, in wrap_zigpy_exceptions raise ZHAException(message) from exc zha.exceptions.ZHAException: Failed to send request: Duplicate TSN: 17
[0xF137:1:0x0020] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request return await self.device.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 339, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 827, in send_packet raise zigpy.exceptions.DeliveryError( zigpy.exceptions.DeliveryError: Failed to deliver message: <sl_Status.ZIGBEE_DELIVERY_FAILED: 3074> The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/general.py", line 630, in check_in_response await self.checkin_response(True, self.CHECKIN_FAST_POLL_TIMEOUT, tsn=tsn) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 84, in wrapper with wrap_zigpy_exceptions(): File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 76, in wrap_zigpy_exceptions raise ZHAException(message) from exc zha.exceptions.ZHAException: Failed to send request: Failed to deliver message: <sl_Status.ZIGBEE_DELIVERY_FAILED: 3074>
[0x10CB:1:0x0020] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request return await self.device.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 339, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 827, in send_packet raise zigpy.exceptions.DeliveryError( zigpy.exceptions.DeliveryError: Failed to deliver message: <sl_Status.ZIGBEE_DELIVERY_FAILED: 3074> The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/general.py", line 630, in check_in_response await self.checkin_response(True, self.CHECKIN_FAST_POLL_TIMEOUT, tsn=tsn) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 84, in wrapper with wrap_zigpy_exceptions(): File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 76, in wrap_zigpy_exceptions raise ZHAException(message) from exc zha.exceptions.ZHAException: Failed to send request: Failed to deliver message: <sl_Status.ZIGBEE_DELIVERY_FAILED: 3074>
[0xDA90:1:0x0020] Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zigpy/endpoint.py", line 265, in request return await self.device.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/zigpy/device.py", line 339, in request await send_request() File "/usr/local/lib/python3.12/site-packages/zigpy/application.py", line 834, in request await self.send_packet( File "/usr/local/lib/python3.12/site-packages/bellows/zigbee/application.py", line 827, in send_packet raise zigpy.exceptions.DeliveryError( zigpy.exceptions.DeliveryError: Failed to deliver message: <sl_Status.ZIGBEE_DELIVERY_FAILED: 3074> The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/general.py", line 630, in check_in_response await self.checkin_response(True, self.CHECKIN_FAST_POLL_TIMEOUT, tsn=tsn) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 84, in wrapper with wrap_zigpy_exceptions(): File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value) File "/usr/local/lib/python3.12/site-packages/zha/zigbee/cluster_handlers/__init__.py", line 76, in wrap_zigpy_exceptions raise ZHAException(message) from exc zha.exceptions.ZHAException: Failed to send request: Failed to deliver message: <sl_Status.ZIGBEE_DELIVERY_FAILED: 3074>
alexkok commented 1 month ago

Hello, I've recently hit the same symptoms, where the ZHA integration was causing Home Assistant to get into a crash-loop. It always crashed after initializing the ZHA integration. Notably, disabling the integration brought Home Assistant back alive.

After some searching, not finding the causes of the ZHA crash (and subscribed to some issues, under which this one). I decided to update the firmware of the Combee II stick that is attached to my Home Assistant. After updating that, I attached it to Home Assistant again and enabled the integration. This worked for me! Sockets and lights were working directly, and the motion sensors had to be reactivated to get them available inside Home Assistant.

No idea if resolves it for you, but give it a try I guess. Looks like my Combee II stick had an old firmware which Home Assistant couldn't work with anymore. I have no idea which firmware version was on it, but now it's updated to 26780700.

AM5800 commented 1 month ago

@alexkok Amazing! Thank you! Updating the Conbee firmware helped(along with other updates, e.g. HA)

alexkok commented 1 month ago

Great! Good to hear it worked! 🚀