core: ZHA unable to start after update to 2023.10.4

The problem

After updating from 2023.10.3 to 10.4, I’m unable to start ZHA. I did a few restarts of HA and even did a complete shutdown and poweron of the VM, but ZHA can’t start anymore. I have no serial connection to a stick for HA, I’m using Wifi to Sonoff Bridge.

I’m running HA in a VM and made a snapshot before upgrading. After I couldn’t solve the ZHA problem, I reverted back to the snapshot (2023.10.3) and ZHA worked without issues.

What version of Home Assistant Core has the issue?

core-2023.10.4

What was the last working version of Home Assistant Core?

core-2023.10.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ZHA

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zha

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-10-21 15:17:32.963 ERROR (MainThread) [homeassistant] Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 1003, in _read_ready__data_received
self._protocol.data_received(data)
File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 81, in data_received
self.frame_received(frame)
File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 108, in frame_received
self.data_frame_received(data)
File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 129, in data_frame_received
self._application.frame_received(self._randomize(data[1:-3]))
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 337, in frame_received
self._protocol(data)
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 119, in __call__
assert expected_id == frame_id
^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
2023-10-21 15:17:32.966 ERROR (MainThread) [bellows.uart] Lost serial connection: AssertionError()
2023-10-21 15:17:32.966 INFO (MainThread) [bellows.ezsp] NCP entered failed state. No application handler registered, ignoring...
2023-10-21 15:17:34.199 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'hum' when rendering '{{ value_json.hum }}'
2023-10-21 15:17:34.199 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'temp' when rendering '{{ value_json.temp }}'
2023-10-21 15:17:37.893 ERROR (MainThread) [zigpy.application] Couldn't start application
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 68, 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/local/lib/python3.11/site-packages/zigpy/application.py", line 198, in startup
await self.initialize(auto_form=auto_form)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 150, in initialize
await self.start_network()
File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 184, in start_network
await self._reset()
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 67, 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
2023-10-21 15:17:37.998 WARNING (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 1 of 3)
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 68, 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/core/gateway.py", line 201, in async_initialize
await self.application_controller.startup(auto_form=True)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 198, in startup
await self.initialize(auto_form=auto_form)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 150, in initialize
await self.start_network()
File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 184, in start_network
await self._reset()
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 67, 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
2023-10-21 15:17:44.215 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'hum' when rendering '{{ value_json.hum }}'
2023-10-21 15:17:44.215 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'temp' when rendering '{{ value_json.temp }}'
2023-10-21 15:17:44.428 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, Motion: False
2023-10-21 15:17:44.428 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, FaceDetect: False
2023-10-21 15:17:44.428 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, PeopleDetect: False
2023-10-21 15:17:44.428 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, VehicleDetect: False
2023-10-21 15:17:44.428 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, DogCatDetect: False
2023-10-21 15:17:44.428 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, MotionAlarm: False
2023-10-21 15:17:44.442 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, Motion: False
2023-10-21 15:17:44.442 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, FaceDetect: False
2023-10-21 15:17:44.442 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, PeopleDetect: False
2023-10-21 15:17:44.442 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, VehicleDetect: False
2023-10-21 15:17:44.442 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, DogCatDetect: False
2023-10-21 15:17:44.442 INFO (MainThread) [reolink_aio.api] Reolink reo01 ONVIF event channel 0, MotionAlarm: False
2023-10-21 15:17:49.530 ERROR (MainThread) [homeassistant] Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 1003, in _read_ready__data_received
self._protocol.data_received(data)
File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 81, in data_received
self.frame_received(frame)
File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 108, in frame_received
self.data_frame_received(data)
File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 129, in data_frame_received
self._application.frame_received(self._randomize(data[1:-3]))
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 337, in frame_received
self._protocol(data)
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 119, in __call__
assert expected_id == frame_id
^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
2023-10-21 15:17:49.533 ERROR (MainThread) [bellows.uart] Lost serial connection: AssertionError()
2023-10-21 15:17:49.533 INFO (MainThread) [bellows.ezsp] NCP entered failed state. No application handler registered, ignoring...
2023-10-21 15:17:54.247 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'hum' when rendering '{{ value_json.hum }}'
2023-10-21 15:17:54.247 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'temp' when rendering '{{ value_json.temp }}'
2023-10-21 15:17:54.470 ERROR (MainThread) [zigpy.application] Couldn't start application
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 68, 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/local/lib/python3.11/site-packages/zigpy/application.py", line 198, in startup
await self.initialize(auto_form=auto_form)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 150, in initialize
await self.start_network()
File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 184, in start_network
await self._reset()
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 67, 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
2023-10-21 15:17:54.474 WARNING (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 2 of 3)
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 68, 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/local/lib/python3.11/site-packages/zigpy/application.py", line 198, in startup
await self.initialize(auto_form=auto_form)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 150, in initialize
await self.start_network()
File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 184, in start_network
await self._reset()
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 67, 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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 201, in async_initialize
await self.application_controller.startup(auto_form=True)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 201, in startup
await self.shutdown()
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 406, in shutdown
await self._dblistener.shutdown()
File "/usr/local/lib/python3.11/site-packages/zigpy/appdb.py", line 187, in shutdown
await self._set_isolation_level(None)
File "/usr/local/lib/python3.11/site-packages/zigpy/appdb.py", line 205, in _set_isolation_level
await self._db._execute(lambda: setattr(self._db, "isolation_level", level))
File "/usr/local/lib/python3.11/site-packages/aiosqlite/core.py", line 126, in _execute
raise ValueError("Connection closed")
ValueError: Connection closed
2023-10-21 15:18:01.506 WARNING (MainThread) [roborock.code_mappings] Missing RoborockMopIntensityS5Max code: 207 - defaulting to 200
2023-10-21 15:18:04.241 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'hum' when rendering '{{ value_json.hum }}'
2023-10-21 15:18:04.242 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'temp' when rendering '{{ value_json.temp }}'
2023-10-21 15:18:06.089 ERROR (MainThread) [homeassistant] Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 1003, in _read_ready__data_received
self._protocol.data_received(data)
File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 81, in data_received
self.frame_received(frame)
File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 108, in frame_received
self.data_frame_received(data)
File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 129, in data_frame_received
self._application.frame_received(self._randomize(data[1:-3]))
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 337, in frame_received
self._protocol(data)
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 119, in __call__
assert expected_id == frame_id
^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
2023-10-21 15:18:06.093 ERROR (MainThread) [bellows.uart] Lost serial connection: AssertionError()
2023-10-21 15:18:06.094 INFO (MainThread) [bellows.ezsp] NCP entered failed state. No application handler registered, ignoring...
2023-10-21 15:18:11.018 ERROR (MainThread) [zigpy.application] Couldn't start application
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 68, 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/local/lib/python3.11/site-packages/zigpy/application.py", line 198, in startup
await self.initialize(auto_form=auto_form)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 150, in initialize
await self.start_network()
File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 184, in start_network
await self._reset()
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 67, 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
2023-10-21 15:18:11.021 WARNING (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 3 of 3)
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 68, 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/local/lib/python3.11/site-packages/zigpy/application.py", line 198, in startup
await self.initialize(auto_form=auto_form)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 150, in initialize
await self.start_network()
File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 184, in start_network
await self._reset()
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 67, 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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 201, in async_initialize
await self.application_controller.startup(auto_form=True)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 201, in startup
await self.shutdown()
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 406, in shutdown
await self._dblistener.shutdown()
File "/usr/local/lib/python3.11/site-packages/zigpy/appdb.py", line 187, in shutdown
await self._set_isolation_level(None)
File "/usr/local/lib/python3.11/site-packages/zigpy/appdb.py", line 205, in _set_isolation_level
await self._db._execute(lambda: setattr(self._db, "isolation_level", level))
File "/usr/local/lib/python3.11/site-packages/aiosqlite/core.py", line 126, in _execute
raise ValueError("Connection closed")
ValueError: Connection closed
2023-10-21 15:18:11.024 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry socket://192.168.0.95:8888 for zha
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 68, 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/local/lib/python3.11/site-packages/zigpy/application.py", line 198, in startup
await self.initialize(auto_form=auto_form)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 150, in initialize
await self.start_network()
File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 184, in start_network
await self._reset()
File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 67, 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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 172, in async_setup_entry
await zha_gateway.async_initialize()
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 214, in async_initialize
raise exc
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 201, in async_initialize
await self.application_controller.startup(auto_form=True)
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 201, in startup
await self.shutdown()
File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 406, in shutdown
await self._dblistener.shutdown()
File "/usr/local/lib/python3.11/site-packages/zigpy/appdb.py", line 187, in shutdown
await self._set_isolation_level(None)
File "/usr/local/lib/python3.11/site-packages/zigpy/appdb.py", line 205, in _set_isolation_level
await self._db._execute(lambda: setattr(self._db, "isolation_level", level))
File "/usr/local/lib/python3.11/site-packages/aiosqlite/core.py", line 126, in _execute
raise ValueError("Connection closed")
ValueError: Connection closed

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Reactions: 9
  • Comments: 17 (1 by maintainers)

Most upvoted comments

I see in Github that the previous ZHA version was merged to version 2023.10.5 … do i wait for this or i also rollback to 2023.10.3?? I have lost mainly all my Zigbee Bulbs but i change my Shelly’s in the switches from detached to switch so lights working again… i can leave like this a bit…

Use the terminal or SSH to reapply version 2023.10.3

$ ha core upgrade --version 2023.10.3

I see in Github that the previous ZHA version was merged to version 2023.10.5 … do i wait for this or i also rollback to 2023.10.3?? I have lost mainly all my Zigbee Bulbs but i change my Shelly’s in the switches from detached to switch so lights working again… i can leave like this a bit…

Use the terminal or SSH to reapply version 2023.10.3

$ ha core upgrade --version 2023.10.3

Thank you, that did the trick