MQTT Suddenly Not Working, [23:52:23] ERROR: Can't setup Home Assistant service mqtt

So I had not added any MQTT devices in a while, but all of them were working well. I created a BLE presence monitor using Monitor

The Monitor is working correctly, and I can see the topics in MQTT Explorer, and I can listen and publish to them in HA, but they wont show up. I created a sensor for them in the sensor yaml, and the sensor show up but is “unknown” so its not pulling it from MQTT. I restarted Mosquitto and noticed this error in the logs:


> [23:52:23] ERROR: Can't setup Home Assistant service mqtt

When I look at my mosquitto logs, I see devices connecting, and then immediately disconnecting, but MQTT explorer doesn’t seem to display this behavior.

1615306241: Client PiHole23824 disconnected.
1615306257: New connection from 192.xxx.xx.xx on port 1883.
[11:10:58] INFO: [INFO] found homeassistant on local database
1615306258: New client connected from 192.xxx.xx.xx as homeassistant6064 (p2, c1, k60, u'homeassistant').
1615306258: Client homeassistant6064 disconnected.
1615306258: New connection from 192.x.x.xx on port 1883.
1615306258: New client connected from 192.1xx.xx.xx as homeassistant6067 (p2, c1, k60, u'homeassistant').
1615306258: Client homeassistant6067 disconnected.
1615306258: New connection from 192.168.xx.xx on port 1883.
1615306258: New client connected from 192.xx.xx.xx as homeassistant6069 (p2, c1, k60, u'homeassistant').
1615306258: Client homeassistant6069 disconnected.

I’ve uninstalled+reinstalled MQTT, I previuosly has 10 devices, 102 entities, and now the only things I get are my two 3D printers, my tasmota tuya-converted devices no longer appear, for example.

I also set up the version of “monitor” on HA that is running off of the HA Pi4, its in a different location so I figured having more than one would be good, these topics, too are not seen by HA but are seen in MQTT explorer.

Where do I begin troubleshooting? I have debated started HA fresh, because when I set this up last summer I didnt really know what I was doing, and starting fresh with a better understanding of everything doesnt sound HORRIBLE, but I am not looking forward to doing this due to MQTT.

This might be related to Mosquitto 5.1.1 is broken? If so just try to roll back MQTT to 5.1.

shit I think you’re right, I didnt see that. Is there a way to roll back without a snapshot?

@deputyd0ng did you find a way to load an older version?

I have Home Assistant Supervised on Debian installed here. Not using the Mosquitto broker offered through HA’s Add-on-Shop. If by any chance your instance runs on the supervised version of HA just uninstall/remove the Mosquitto broker add-on and switch to the Mosquitto MQTT Broker from Debian.

See Section 3 at @Kanga-Who’s notes (https://github.com/Kanga-Who/home-assistant/blob/fc6f6aa7b8c4b124f1e8247265ae0cd9e9f103de/Install Samba%2C Portainer and MQTT.md) about how it is done.

It is really trivial and works pretty well and reliable. No need for HA’s Mosquitto broker add-on anymore.

I have the same issue, apart from installing the distribution MQTT package, is there other solution?

Same issue here, I would like to rollback to an old version of Mosquitto…

Any resolution to this? I have 5.1.1 :frowning:

1 Like

Any solution to this problem?

same here. not working anymore.

Using 5.1.1 too and working, but not in a satisfactory way: it is hanging sometimes and then returns to normal. I can no longer use MQTTexplorer as this causes the broker to fail completely. Sometimes a restart of the add-on helps, sometimes it comes back on its own.
What I have also noticed, when using “Listen to a topic” in MQTT integration (remember, I no longer can use MQTTexplorer), is that it is capturing nothing for a long time and then suddenly I see thousands of MQTT messages listed in one go.
In summary, there is a huge latency and I cannot find any root cause.

yea, this is exactly what I am seeing…

Same issue on my side. To fix this problem and go back to previous setup I retrieved previous Mosquitto broker via snapshot and it is working again. Still showing as 5.1.1 but it is working.

I am bringing up a new HA installation, so no snapshots to downgrade to - and cannot get anything MQTT to work at all. I am basing my new configuration on the old one which worked fine, and this is pretty frustrating. Any help how to get the old Mosquitto plugin back?