Just Installed Mosquitto Broker, but can't start it

I’m looking to start working with MQTT so I installed the Mosquitto broker add-on. After clicking start the screen flashes (it tries to show the graphs for resource usage and the “start on boot” option turns off). I have not been able to get this stared even after multiple restarts and re installs. If I check the configuration tab it shows “This add-on does not expose configuration for you to mess with…” and if I check Log I have the following:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing... 
[19:22:09] INFO: Certificates found: SSL is available
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:22:09] INFO: Starting NGINX for authentication handling...
[19:22:10] INFO: Starting mosquitto MQTT broker...
1657844530: Warning: Mosquitto should not be run as root/administrator.
[19:22:11] INFO: Successfully send discovery information to Home Assistant.
[19:22:11] INFO: Successfully send service information to the Supervisor.

Current Setup:
Home Assistant 2022.7.4
Supervisor 2022.07.0
Operating System 8.2
Frontend 20220706.0

What options did you set in the configuration of the broker? What is in the acl.conf and accesscontrollist files?

Immediately after installing I can go into the configuration and see the default config. I don’t change anything and just click start. After that I’m not able see anything within the configuration tab anymore. except the message posted above.

As far as the acl.conf and accesscontrollist files, I’m not sure where these are located.

Have you read the docs? Its no wonder the broker wont start if you have not configured it

Hello David,

When following tutorials online the settings are not changed when starting the mqtt broker.
Hope you can help out, like what did you configure before starting ?

1 Like

Create mqtt user and password in ha.
For mqtt config use mqtt for username and password you created for user mqtt.
I think everything else could stay as default.

I came across this thread having just updated an old thread of mine. My Mosquitto implementation has just failed after a Ubuntu upgrade due to a config change. I had to explicitly add the listener port into the config file.

After doing some research on this item I discoverd my issue could be something different.
: Add ons not working properly after snapshot restore - #13 by Protechtedd
because just before starting my working I used a backup file. so tried a few other add-ons and it seems all the addons would not start.

Same problem here. Install Mosquitto broker bit it does noet start.
Here is my log :

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
[10:31:45] 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
[10:31:48] INFO: Starting NGINX for authentication handling...
[10:31:48] INFO: Starting mosquitto MQTT broker...
2023-01-25 10:31:48: Warning: Mosquitto should not be run as root/administrator.
[10:31:53] INFO: Successfully send discovery information to Home Assistant.
[10:31:54] INFO: Successfully send service information to the Supervisor.

Search the internet, looked at youtube examples but de broker does not want to start.

Please help.

I have the same problem. Have anyone solved this problem?

This is my log from mosquitto addon. Addon is started and working.

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
[17:58:24] INFO: Certificates found: SSL is available
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
[17:58:24] INFO: Starting NGINX for authentication handling...
[17:58:24] INFO: Starting mosquitto MQTT broker...
1677171504: Loading config file /share/mosquitto/mosquitto.conf
2023-02-23 17:58:24: Warning: Mosquitto should not be run as root/administrator.
[17:58:25] INFO: Successfully send discovery information to Home Assistant.
[17:58:25] INFO: Successfully send service information to the Supervisor.

How do you know that addon is not working? I don’t see any errors. You have to configure mqtt integration

After I click on Start it is do nothing.
even after clicking start it looks like this:

and under Addons the icon is gray and no longer colored

After reinstall the addon the log seems look like yours. Now it shows:

2023-02-25 12:45:03: New connection from 172.30.33.3:53682 on port 1883.
2023-02-25 12:45:03: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:04: New connection from 172.30.33.3:53694 on port 1883.
2023-02-25 12:45:04: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:05: New connection from 172.30.33.3:53698 on port 1883.
2023-02-25 12:45:05: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:06: New connection from 172.30.33.3:53700 on port 1883.
2023-02-25 12:45:06: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:07: New connection from 172.30.33.3:53716 on port 1883.
2023-02-25 12:45:07: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:08: New connection from 172.30.33.3:53720 on port 1883.
2023-02-25 12:45:08: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:09: New connection from 172.30.33.3:53732 on port 1883.
2023-02-25 12:45:09: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:10: New connection from 172.30.33.3:53770 on port 1883.
2023-02-25 12:45:10: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:11: New connection from 172.30.33.3:53784 on port 1883.
2023-02-25 12:45:11: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:12: New connection from 172.30.33.3:53786 on port 1883.
2023-02-25 12:45:12: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:13: New connection from 172.30.33.3:53796 on port 1883.
2023-02-25 12:45:13: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:14: New connection from 172.30.33.3:53800 on port 1883.
2023-02-25 12:45:14: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:15: New connection from 172.30.33.3:53810 on port 1883.
2023-02-25 12:45:15: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:16: New connection from 172.30.33.3:53822 on port 1883.
2023-02-25 12:45:16: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:17: New connection from 172.30.33.3:53830 on port 1883.
2023-02-25 12:45:17: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:18: New connection from 172.30.33.3:53838 on port 1883.
2023-02-25 12:45:18: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:19: New connection from 172.30.33.3:53842 on port 1883.
2023-02-25 12:45:19: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:20: New connection from 172.30.33.3:37768 on port 1883.
2023-02-25 12:45:20: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:21: New connection from 172.30.33.3:37770 on port 1883.
2023-02-25 12:45:21: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:22: New connection from 172.30.33.3:37774 on port 1883.
2023-02-25 12:45:22: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:23: New connection from 172.30.33.3:37776 on port 1883.
2023-02-25 12:45:23: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:24: New connection from 172.30.33.3:37784 on port 1883.
2023-02-25 12:45:24: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:25: New connection from 172.30.33.3:37792 on port 1883.
2023-02-25 12:45:25: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:26: New connection from 172.30.33.3:37794 on port 1883.
2023-02-25 12:45:26: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:27: New connection from 172.30.33.3:37804 on port 1883.
2023-02-25 12:45:27: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:28: New connection from 172.30.33.3:37816 on port 1883.
2023-02-25 12:45:28: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:29: New connection from 172.30.33.3:37820 on port 1883.
2023-02-25 12:45:29: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:30: New connection from 172.30.33.3:35190 on port 1883.
2023-02-25 12:45:30: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:31: New connection from 172.30.33.3:35204 on port 1883.
2023-02-25 12:45:31: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:32: New connection from 172.30.33.3:35210 on port 1883.
2023-02-25 12:45:32: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:33: New connection from 172.30.33.3:35224 on port 1883.
2023-02-25 12:45:33: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:34: New connection from 172.30.33.3:35238 on port 1883.
2023-02-25 12:45:34: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:35: New connection from 172.30.33.3:35250 on port 1883.
2023-02-25 12:45:35: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:36: New connection from 172.30.33.3:35264 on port 1883.
2023-02-25 12:45:36: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:37: New connection from 172.30.33.3:35276 on port 1883.
2023-02-25 12:45:37: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:38: New connection from 172.30.33.3:35292 on port 1883.
2023-02-25 12:45:38: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:39: New connection from 172.30.33.3:35296 on port 1883.
2023-02-25 12:45:39: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:40: New connection from 172.30.33.3:55648 on port 1883.
2023-02-25 12:45:40: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:41: New connection from 172.30.33.3:55654 on port 1883.
2023-02-25 12:45:41: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:42: New connection from 172.30.33.3:55658 on port 1883.
2023-02-25 12:45:42: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:43: New connection from 172.30.33.3:55660 on port 1883.
2023-02-25 12:45:43: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:44: New connection from 172.30.33.3:55666 on port 1883.
2023-02-25 12:45:44: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:45: New connection from 172.30.33.3:55680 on port 1883.
2023-02-25 12:45:45: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:46: New connection from 172.30.33.3:55694 on port 1883.
2023-02-25 12:45:46: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:47: New connection from 172.30.33.3:55706 on port 1883.
2023-02-25 12:45:47: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:48: New connection from 172.30.33.3:55710 on port 1883.
2023-02-25 12:45:48: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:49: New connection from 172.30.33.3:55718 on port 1883.
2023-02-25 12:45:49: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:50: New connection from 172.30.33.3:56722 on port 1883.
2023-02-25 12:45:50: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:51: New connection from 172.30.33.3:56736 on port 1883.
2023-02-25 12:45:51: Client <unknown> disconnected, not authorised.
2023-02-25 12:45:52: New connection from 172.30.33.3:56740 on port 1883.
2023-02-25 12:45:52: Client <unknown> disconnected, not authorised.

I have dont config the addon last time at it works. I also read you don´t must configure it.

My config looks like:

require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: false
  folder: mosquitto

Any Ideas?

You can open terminal and check if your mqtt is listening like this

netstat -tunlp | grep 1883

or check containers

docker ps

netstat shows:

# netstat -tunlp | grep 1883
tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN      201114/docker-proxy
tcp        0      0 :::1883                 :::*                    LISTEN      201121/docker-proxy

and docker ps shows:

ONTAINER ID   IMAGE                                                           COMMAND           CREATED        STATUS       PORTS                                                                                                                          NAMES
b97b9e821a4f   tsightler/ring-mqtt:5.1.3                                       "/init"           2 hours ago    Up 2 hours   8554/tcp, 55123/tcp                                                                                                            addon_03cabcc9_ring_mqtt
876e53b11de9   homeassistant/aarch64-addon-ssh:9.6.1                           "/init"           3 hours ago    Up 3 hours   0.0.0.0:22->22/tcp, :::22->22/tcp                                                                                              addon_core_ssh
722cec24ea68   homeassistant/aarch64-addon-mosquitto:6.1.3                     "/init"           3 hours ago    Up 3 hours   0.0.0.0:1883-1884->1883-1884/tcp, :::1883-1884->1883-1884/tcp, 0.0.0.0:8883-8884->8883-8884/tcp, :::8883-8884->8883-8884/tcp   addon_core_mosquitto
58cd055c4df6   homeassistant/aarch64-addon-duckdns:1.15.0                      "/init /run.sh"   3 hours ago    Up 3 hours                                                                                                                                  addon_core_duckdns
3b59ddd3776f   homeassistant/aarch64-addon-configurator:5.5.0                  "/init"           3 hours ago    Up 3 hours                                                                                                                                  addon_core_configurator
25b50e79f0b6   homeassistant/aarch64-addon-samba:10.0.0                        "/init"           3 hours ago    Up 3 hours                                                                                                                                  addon_core_samba
b4bdf4768bac   ghcr.io/home-assistant/raspberrypi4-64-homeassistant:2023.2.5   "/init"           8 days ago     Up 3 hours                                                                                                                                  homeassistant
14faa880d5a1   ghcr.io/home-assistant/aarch64-hassio-multicast:2022.02.0       "/init"           2 weeks ago    Up 2 weeks                                                                                                                                  hassio_multicast
872c5927de5f   ghcr.io/home-assistant/aarch64-hassio-audio:2022.07.0           "/init"           2 weeks ago    Up 2 weeks                                                                                                                                  hassio_audio
9fb02f5307c5   ghcr.io/home-assistant/aarch64-hassio-dns:2022.04.1             "/init"           2 weeks ago    Up 2 weeks                                                                                                                                  hassio_dns
e89fce6571df   ghcr.io/home-assistant/aarch64-hassio-cli:2022.11.0             "/init"           2 weeks ago    Up 2 weeks                                                                                                                                  hassio_cli
6573a495de5d   ghcr.io/home-assistant/aarch64-hassio-supervisor:latest         "/init"           2 weeks ago    Up 2 weeks                                                                                                                                  hassio_supervisor
3fbb0a9ac715   ghcr.io/home-assistant/aarch64-hassio-observer:2021.10.0        "/init"           8 months ago   Up 2 weeks   0.0.0.0:4357->80/tcp, :::4357->80/tcp                                                                                          hassio_observer

Well your mqtt addon is working. You need to set up mqtt integration. Create user mqtt with password, select port 1883 and that is it.

I create a user mqtt with a password.

Now I change my config from the addon to:

logins:
  - username: mqtt
    password: here is my passwort
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: false
  folder: mosquitto

I save the changes. Than I click on the start button. But nothing


:

This is my mqtt addon configuration

logins: []
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: true
  folder: mosquitto

You have to create user mqtt and give it a password.
After that go to integration, add integration and choose mqtt.
For broker use homeassistant if this is your host name, user, password and use port 1883.

I have create a user mqtt in home assistant.

I delete the addon mqtt broker and reinstall it.

Now the addon configuration is this:

logins: []
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: false
  folder: mosquitto

It is the same linke yours.

What did you mean with? For broker use homeassistant if this is your host name, user, password and use port 1883.

First of all do you have any device that is on your network and is using mqtt protocol?
If you do have such device or devices than you can set it up using mqtt integration.
Go to add integration choose mqtt and you will end up with config panel like this

Yes I have devices. The work before fine.

I see all the “old” device unter integration mqtt. But all are unavailible.

But in the past unter addons mqtt broker stand stopp and start new and not online start.