Home Assistant suddenly started crashing with Zigbee Sonoff 3.0 stick

My Zigbee network used to run fine for many months (using ZHA). Last week, I’ve upgraded my OS from 13.1 to 13.2. Immediately after booting, HA crashed. The last entry in the homeassistant.log file is:

ERROR (bellows.thread_0) [ bellows.uart] Lost serial connection: SerialException('device reports readiness to read but returned no data (device disconnected or multiple access on port?)')

Even after rolling back to version 13.1 of the OS, the issue is not resolved. I’ve ruled out an issue with the Sonoff Zigbee stick itself by connecting it to spare RPI4 with HA. That just worked fine.
I’ve tried different USB ports, but without luck. Sometimes the Zigbee network is up for a few minutes untill HA crashes again with the above log entry in the logfile.
I am not sure anymore what to do next.

Update:

I found out that I have to boot my Home Assistant without the Sonoff zigbee stick connected. When I boot it with the Zigbee dongle inserted, it looks like it is somehow conflicting with my DSMR integration (usb connection to the utility meter). Only when Home Assistant is up and running, I can put the Zigbee Dongle in the Intel NUC USB port and the Zigbee network will get online.
Restarting Home Assistant is not an issue, but rebooting the device will generate the error in the log and causes Home Assistant to crash entirely.

I hope that someone here has any clue…

Thanks

I have a clue. It’s almost certainly caused by the fact that your USB devices are configured by their USB path (eg. /dev/ttyUSB0) instead of /dev/serial/by-id.

ZHA definitely accepts a serial by ID and it is actually recommended to use this in the docs. Not sure whether the DSMR integration also supports it since I do not use it, but technically, it should. (Search around for this before changing the DSMR config).

Basically the USB path is not tied to a particular device. When you reboot (such as after an update), your USB devices will get assigned a path at random if you define them using a path.
Given you have 2 USB devices, the DSMR dongle is being assigned the path which was previously being used by your Zigbee dongle. When ZHA loads, it tries to read from that path but instead of the coordinator, it finds the DSMR dongle.

I suspect the opposite is happening with your DSMR integration - it’s trying to read a Zigbee dongle and throws a fit.
Both scenarios could lead to your instance crashing if the system gets swamped with errors, and honestly you’re lucky this didn’t happen earlier.