Zigbee2mqtt items gone after mqtt broker restart

If I restart my mqtt broker, all zigbee2mqtt devices disappears from Home Assistant. I can then restart zigbee2mqtt and everything works OK again, but it’s very annoying. I’ve seen others affected by this, but I haven’t seen any real fix yet, hence me asking.

In short about my setup:

  • SBC with zigbee2mqtt running in docker
  • Router/firewall with mosquitto running on Debian
  • Home Assistant OS running as VM on another computer

Everything is fine until I restart my main mosquitto broker. Restarting SBC is fine, restarting Home Assistant is also fine.

I’ve tried setting up an additional mosquitto broker on my SBC, and then have that mirror “zigbee2mqtt/#” both directions to my main mosquitto broker, but still the same issue.

Is this a configuration issue with mosquitto, zigbee2mqtt or home assistant?