core: ZHA fails to initialize and crashes Home Assistant
The problem
Whenever I reboot Home Assistant, the ZHA integration fails to initialize due to a TimeoutError with approximately a 50% chance.
When this happens, the HASS frontend completely loses connection after about a minute after the reboot. Apart from the ZHA errors there are no related errors visible in the log file.
Edit: as @puddly suggested the issue might not be ZHA failing to initialize, as this could be a symptom of the hanging/freezing of Home Assistant itself.
What version of Home Assistant Core has the issue?
core-2024.1.2
What was the last working version of Home Assistant Core?
core-2023.12.1
What type of installation are you running?
Home Assistant Container
Integration causing the issue
ZHA
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zha/
Diagnostics information
config_entry-zha-ff591d6fd696473209f0e6b86613d098.json.txt
Example YAML snippet
No response
Anything in the logs that might be useful for us?
2024-01-13 20:07:45.709 DEBUG (MainThread) [homeassistant.components.zha] ZHA storage file does not exist or was already removed
2024-01-13 20:07:50.431 ERROR (bellows.thread_0) [bellows.uart] CRC error in frame b'9c2791907e' (b'9190' != b'140c')
2024-01-13 20:07:56.889 DEBUG (MainThread) [homeassistant.components.zha] Failed to set up ZHA
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 74, in command
return await future
^^^^^^^^^^^^
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 163, in async_setup_entry
zha_gateway = await ZHAGateway.async_from_config(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 193, in async_from_config
await instance.async_initialize()
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 211, in async_initialize
await app.startup(auto_form=True)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 226, in startup
await self.initialize(auto_form=auto_form)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 142, in initialize
await self.load_network_info(load_devices=False)
File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 251, in load_network_info
(nwk,) = await ezsp.getNodeId()
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 215, in _command
return await self._protocol.command(name, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 73, in command
async with asyncio_timeout(EZSP_CMD_TIMEOUT):
File "/usr/local/lib/python3.11/asyncio/timeouts.py", line 111, in __aexit__
raise TimeoutError from exc_val
TimeoutError
### Additional information
This issue occured before updating to 2024, but then Home Assistant did not crash.
I am using a Sonoff Zigbee 3.0 Plus V2 with a USB 2.0 extension cable.
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Reactions: 4
- Comments: 29 (14 by maintainers)
@trentnbauer Your problem is not related to this issue and your logs don’t contain a single
ERROR.@Wagner545 @Captainjman2 @Hopsen @fredd589 All of your problem are not related to this issue.
The problem As described before. After some hours zha stops working and fails to initialize. After restarting HA it works again for some hours.
What version of Home Assistant Core has the issue? core-2024.1.2 and core-2024.1.3
What was the last working version of Home Assistant Core? core-2023.12.1
What type of installation are you running? HA OS
Integration causing the issue ZHA, using Sky Connect Stick
I’ll try to save the logs next Tim before restarting and add them.
The problem Same problem as described by the person who opened this issue.
What version of Home Assistant Core has the issue? core-2024.1.2 and core-2024.1.3
What was the last working version of Home Assistant Core? core-2023.12.1
What type of installation are you running? HA OS
Integration causing the issue ZHA
Link to integration documentation on our website https://www.home-assistant.io/integrations/zha/
Diagnostics information I don’t seem to have the download option.
Example YAML snippet No response
Anything in the logs that might be useful for us? home-assistant_2024-01-18T03-43-09.027Z.log
Hi All,
I started encountering the same issue yesterday morning. Waking up to Home Assistant unable to wrap up after the usual soft-reboot in the night. It looked like ZHA was stopping Home Assistant from wrapping up and no automations were working. A bunch of other integrations did also not load correctly. ZHA was constantly initializing but unable to get to the stage where it “Failed Setup, will retry”. I tried disabling and re-enable the integration but without success.
The only changes I did the evening before was to install some other Add-ons such a Uptime Kuma and a few other integrations to test it out.
Here is my setup at the time of the event:
Raspberry PI 4 Running Home Assistant Core version core-2023.12.1. Sonoff Zigbee Bridge, flash with ZHA ZBBridge Tasmota. Program Version | 9.5.0(zbbridge)
I spend yesterday trying to debug the issue. I did an upgraded to the following: Home Assistant Core 2024.1.3 Supervisor: 2023.12.1 Operating System: 11.4 Frontend: 20240104.0
I power cycled the Sonoff Zigbee Bridge as well, but that did not change anything.
I’m now in a state where Home Assistant works but after every soft-reboot or full reboot. Many integrations fails at startup and I need to manually reload them. ZHA is now constantly in the “Failed Setup, will retry”.
The only thing I have not tried yet is to power cycle my Raspberry Pi. I have also thought about updating my Sonoff Zigbee Bridge, but I’m hesitated to do that because I know that worked before and nothing has changed.
My logs are not giving me anything concrete beside the same error messages: