Zigbee2MQTT crashes and restarts every time I check for OTA updates

I recently added a couple of new devices to the network, and one of them, a SONOFF ZBMINIR2 switch, will periodically have an error when using the physical switch connected to it. So, I found that it can be fixed with a firmware update. But I go and try checking for OTA updates, and either the whole Zigbee2MQTT system crashes and restarts, or the adapter does, I cannot know the difference.

The case is that I lose control of all my zigbee devices for some seconds and I cannot access the Zigbee2MQTT frontend for a moment, then, it comes back. I’ve tried checking for updates of other devices because I thought the new switch could be the problem, but it still does the same for the other devices. I also have realised that if I look at the firmware attribute in HA, for all the devices that support OTA updates, both “installed_version” and “latest_version” have -1 values.

Could anyone help me figure out what I can do to fix my OTA updates?

Thanks!!

What did you expect to happen?

Check for updates succesfully and show if there’s any new version

How to reproduce it (minimal and precise)

  1. OTA tab
  2. Click “Check for updates” in any device

Zigbee2MQTT version

2.1.1

Adapter firmware version

8.0.2 [GA]

Adapter

ZB-GW04 (v1.2)

Setup

docker container in RPi3b+

Debug log

No log is created when it happens, because it instantly crashes after “z2m: Checking if update available for …”

Pi 3 has only 1Gb ram, if HA is running on the same PI, could simply be an ‘out-of-memory’ error.

Wouldn’t that make HA stop working too? It keeps working fine when Zigbee2MQTT stops working.

Also, I’ve tried stopping all other containers and heavy preocesses, and checking for updates when everything else is stopped and most RAM is free, and still crashes as soon as I click “check for updates”

I found this post https://github.com/Koenkk/zigbee2mqtt/issues/12459 with similar error (though in different situation), and its instructions solved my problem too. Following this step solved it https://www.zigbee2mqtt.io/guide/installation/02_docker.html#notes-for-raspberry-pi-users. I feel it’s weird because according ti the documentation, Z2M was just supposed to not work in the first place if I didn’t do that step, and mine worked perfectly until I would try to OTA update, but whatever… It works now