Zigbee2MQTT suddenly can't connect to MQTT server

Hello,
I’ve been using Mosquitto and Zigbee2MQTT for months now, my config was working perfectly.
But for about one week now, without noticiable changes, connection between Mosquitto and Z2M is broken.
I’ve spent few hours trying to debug it myself, I’ve done countless reboots, tried a lot of config variations, none with success.
Devices still works because I can control them using the “exposed” tab on the Zigbee2MQTT web interface.
The only clue I have is that there has been a Mosquitto update around the date it started to stop working (but I can’t find the exact update installation date), but since a new update came out, still broken.
Currently I’ve restored my initial config (which worked fine), which is basically all to default (empty Logins in Mosquitto, empty MQTT part in Z2M).
I’ve waiting few days to see if an update might help.
Does anyone can help me please ?

Z2M logs

Zigbee2MQTT:error 2023-09-07 09:09:34: Not connected to MQTT server!
Zigbee2MQTT:error 2023-09-07 09:09:37: Not connected to MQTT server!

Mosquitto logs

2023-09-07 08:01:53: New connection from 172.30.33.1:54978 on port 1883.
2023-09-07 08:01:53: New client connected from 172.30.33.1:54978 as mqttjs_fe4f771f (p2, c1, k60, u'addons').
2023-09-07 08:01:53: Client mqttjs_fe4f771f disconnected due to malformed packet.

2023-09-07 08:01:54: New connection from 172.30.33.1:54994 on port 1883.
2023-09-07 08:01:54: New client connected from 172.30.33.1:54994 as mqttjs_fe4f771f (p2, c1, k60, u'addons').
2023-09-07 08:01:54: Client mqttjs_fe4f771f disconnected due to malformed packet.

Theses messages keep appearing around every minutes. If I stop Z2M, messages also stops.

Versions
Zigbee2MQTT v1.33.0-1
Mosquitto broker v6.3.1 (problem initially occured while on v6.3.0)
Home Assistant 2023.9.0 (problem initially occured while on previous version)
Supervisor 2023.08.3
Operating System 10.5
Frontend 20230906.1 - latest

Those are normal. They are the supervisor 's watchdog connections. I think you can (temporarily) disable this if you want to confirm:

Other folk with this issue:

Thank you for your answer.
I’ve checked, none of my addons has Watchdog enabled.
As I said, those lines stop showing when I stop Z2M, so it’s looks like it related.
Thanks for the other post, I’ll have a look.

I had a lot of troubles, too. But they went away when I restored Mosquitto back to 6.2.1

1 Like

I didn’t realized that the addon backups include the “binaries”.
In my case, I had to revert Mosquitto to 6.2.1 + Z2M to 1.32.2-1.
Thanks for the suggestion @stigvi !

1 Like

Just reverting MQTT to 6.2.1 was enough for me. My backup was from 27 Aug 2023

Thanks for all informations

I now had similar issues after updating Home Assistant and Mosquitto & Z2M add-on.

Z2M Add-on was just not running anymore randomly. For no reason it stopped running sometimes. Tried watchdog on/off etc. Sometimes it lasted for a day sometimes I had to restart everything after couple of hours.
Was bugging me for days and wife complained already why light is often not working … Checked logs, searched here and found this thread gladly :slight_smile:

I was running on
HA: 2024.9.3
HA OS: 11.5
Mosquitto: 6.4.1
Z2M: 1.40.2-1

All on a Raspb. Pi, nothing special.

Thanks to this thread I tried rolling back Mosquitto to the backup of the add-on upgrade which rolled it back to 6.3.0 and now everything works stable and flawless again.