Just Installed Mosquitto Broker, but can't start it

Keep me posted!

I completely reinstalled homeassistant on a new hard drive and immediately imported a backup. Then I installed the two addons “Mosquitto broker” and “Ring-MQTT with Video Streaming” and started them successfully. Now everything works again.

1 Like

Im faced with exactly the same as detailed in this thread. I had MQTT working a few dats ago until yetsterday. THen I tried to connect my CAD device and in the process something broke the Mosquitto server. It does not apear to start , but i think it is acually running in the back ground as the “discovered new devices” appears and when click configure it takes the auto settings from Mosquitto and shows my CAD entities (unknown) but still the mosquitto server is showing the red dot indicating its not running…

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/mosquitto.sh
[16:35:22] INFO: SSL is not enabled
cont-init: info: /etc/cont-init.d/mosquitto.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun mosquitto (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
s6-rc: info: service legacy-services successfully started
[16:35:23] INFO: Starting NGINX for authentication handling...
[16:35:23] INFO: Starting mosquitto MQTT broker...
2023-03-17 16:35:23: Warning: Mosquitto should not be run as root/administrator.
[16:35:24] INFO: Successfully send discovery information to Home Assistant.
[16:35:24] INFO: Successfully send service information to the Supervisor.

EDIT 1: Yesterday I installed a back up from 2 days ago when the Mosquitto broker was last working…nothing, still the same issue. Is it possible that someting in the very core of HA gets affected and isnt cleared when a full back up is restored?
Is thre anyway to flush out the HA system (supervisor) s othat it clears its “Cache” in affect?

EDIT 2: I have Node Red installed and I disabled that yesterday as I dont use it. But now even trying to start that Addon fails…this definately looks like a system issue to me.

EDIT 3: and here is the proof of that theory that mosquitto is actually running but not being reported as such in the system:

2023-03-17 16:35:23: Warning: Mosquitto should not be run as root/administrator.
[16:35:24] INFO: Successfully send discovery information to Home Assistant.
[16:35:24] INFO: Successfully send service information to the Supervisor.
2023-03-17 16:35:23: mosquitto version 2.0.11 starting
2023-03-17 16:35:23: Config loaded from /etc/mosquitto/mosquitto.conf.
2023-03-17 16:35:23: Loading plugin: /usr/share/mosquitto/go-auth.so
2023-03-17 16:35:23:  ├── Username/password checking enabled.
2023-03-17 16:35:23:  ├── TLS-PSK checking enabled.
2023-03-17 16:35:23:  └── Extended authentication not enabled.
2023-03-17 16:35:23: Opening ipv4 listen socket on port 1883.
2023-03-17 16:35:23: Opening ipv6 listen socket on port 1883.
2023-03-17 16:35:23: Opening websockets listen socket on port 1884.
2023-03-17 16:35:23: mosquitto version 2.0.11 running
2023-03-17 16:35:23: New connection from 127.0.0.1:36308 on port 1883.
2023-03-17 16:35:23: Client <unknown> closed its connection.
2023-03-17 16:40:01: New connection from 172.30.32.1:34209 on port 1883.
2023-03-17 16:40:01: New client connected from 172.30.32.1:34209 as 27Ov3X6p9m5IUUeI0qv9wu (p2, c1, k60, u'homeassistant').
2023-03-17 16:40:01: Client 27Ov3X6p9m5IUUeI0qv9wu disconnected.
2023-03-17 16:40:01: New connection from 172.30.32.1:41315 on port 1883.
2023-03-17 16:40:01: New client connected from 172.30.32.1:41315 as 7fsWq098VfsktoigzMOa6b (p2, c1, k60, u'homeassistant').
2023-03-17 16:48:28: Client 7fsWq098VfsktoigzMOa6b closed its connection.
2023-03-17 16:49:01: New connection from 172.30.32.1:55513 on port 1883.
2023-03-17 16:49:01: New client connected from 172.30.32.1:55513 as 2bi2rWmgh2PC57A7nygWLT (p2, c1, k60, u'homeassistant').
2023-03-17 16:56:37: New connection from 172.30.32.1:55631 on port 1883.
2023-03-17 16:56:37: New client connected from 172.30.32.1:55631 as 6risTGz90E5uDq6XjUkVnh (p2, c1, k60, u'mqttuser').
2023-03-17 16:56:37: Client 6risTGz90E5uDq6XjUkVnh disconnected.
2023-03-17 16:56:42: New connection from 172.30.32.1:42451 on port 1883.
2023-03-17 16:56:42: New client connected from 172.30.32.1:42451 as 4PoJwJVr154Fnios64TwAW (p2, c1, k60, u'mqttuser').
2023-03-17 16:58:11: Client 2bi2rWmgh2PC57A7nygWLT has exceeded timeout, disconnecting.
2023-03-17 17:05:23: Saving in-memory database to /data//mosquitto.db.
2023-03-17 17:35:25: Saving in-memory database to /data//mosquitto.db.
2023-03-17 18:05:26: Saving in-memory database to /data//mosquitto.db.
2023-03-17 18:35:27: Saving in-memory database to /data//mosquitto.db.
2023-03-17 19:05:28: Saving in-memory database to /data//mosquitto.db.
2023-03-17 19:35:29: Saving in-memory database to /data//mosquitto.db.
2023-03-17 20:05:30: Saving in-memory database to /data//mosquitto.db.
2023-03-17 20:35:31: Saving in-memory database to /data//mosquitto.db.
2023-03-17 21:05:32: Saving in-memory database to /data//mosquitto.db.

Update: there was a supervisor update that came out this week. Once I installed that, I was able to re install add-ons again and also start the Mosquitto add-on finally showing the green started dot… so the problem is now fixed. But that didn’t mean there was any issue with the latest HA core update, rather some how I managed to corrupt the supervisor. If it happened again to me then I would likely reload the latest supervisor using the Terminal commands.

I know this is an old thread, but in case it helps somebody…

After a restore from a backup, I could not get Mosquitto broker to start. If you clicked start, the logs would say it started, but the red circle remained in the top right corner indicating it had stopped. It also clearly was not running, because I could not start Zigbee2MQTT.

After reading this thread and banging my head against a wall, I found the solution elsewhere - You need to do a physical reboot of the machine HA is on. Not an HA reboot. You need to power off and power on the machine. This fixed my issue, and I was able to start the add on.

5 Likes

This was a life saver – after 2 days of starting over!

This saved me so much time, I just couldn’t get it to work until I saw this and then powered off the RPi4 and then all worked as it should…

Thanks so much

Thanks @ nacummins1! Stumbled on this thread while going through the same problem. Been messing with if off and on for two days. This worked like a champ!

Thanks a lot. I really love the people who post their solution just to help out others :+1:

Wow. I wish we knew WHY this works, but it works.

I had restarted RingMQTT, Mosquitto, HA and still it would not work. Restarting the hardware did work.

Very strange.

1 Like

Restarting the hardware worked for me as well and luckily I didn’t have to do any other reinstalls, only a hardware restart and everything was back working.

Thank you for the solution!

Also worked for me today. So frustrating that it took me so long to figure out.