MQTT Broker "Failed to connect"

I just did a fresh install of home assistant and am trying to set up MQTT. I Installed the Mosquitto Broker, started it and can see in the log that some devices (lights, smart switches etc) are successfully connecting to the broker. However when home assistant detects MQTT, it always fails to connect.

At the beginning I thought that maybe my other home assistant instance with MQTT was interfering, but the second Raspberry Pi is turned off now. I tried reinstalling and restarting Mosquitto Broker several times, cleared cache, used a different browser etc. But I always get the “Failed to connect” message. What could be the problem here?

I can not find anything usefull in either the Mosquitto Log nor the supervisor log

I once got this log below, but all the other times the configuration failed, there was not comment in the log file at all.

Supervisor log:

ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto
INFO (MainThread) [supervisor.auth] Auth request from ‘core_mosquitto’ for ‘mqtt-user’
INFO (MainThread) [supervisor.auth] Successful login for ‘mqtt-user’

Mosquitto Log:

[14:28:03] 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)
[14:28:04] INFO: Starting NGINX for authentication handling…
[14:28:04] INFO: Starting mosquitto MQTT broker…
2025-02-14 14:28:04: Warning: Mosquitto should not be run as root/administrator.
2025-02-14 14:28:04: mosquitto version 2.0.20 starting
2025-02-14 14:28:04: Config loaded from /etc/mosquitto/mosquitto.conf.
2025-02-14 14:28:04: Loading plugin: /usr/share/mosquitto/go-auth.so
2025-02-14 14:28:04: ├── Username/password checking enabled.
2025-02-14 14:28:04: ├── TLS-PSK checking enabled.
2025-02-14 14:28:04: └── Extended authentication not enabled.
2025-02-14 14:28:04: Opening ipv4 listen socket on port 1883.
2025-02-14 14:28:04: Opening ipv6 listen socket on port 1883.
2025-02-14 14:28:04: Opening websockets listen socket on port 1884.
2025-02-14 14:28:04: mosquitto version 2.0.20 running
2025-02-14 14:28:05: New connection from ::1:53050 on port 1883.
2025-02-14 14:28:05: Client disconnected due to protocol error.
s6-rc: info: service legacy-services successfully started
[14:28:08] INFO: Successfully send discovery information to Home Assistant.
[14:28:08] INFO: Successfully send service information to the Supervisor.
2025-02-14 14:28:27: New connection from 172.30.32.2:37334 on port 1883.
2025-02-14 14:28:27: Client closed its connection.
2025-02-14 14:28:50: New connection from 192.168.178.56:60209 on port 1883.
2025-02-14 14:28:50: New client connected from 192.168.178.56:60209 as fan (p2, c1, k30, u’mqtt-user’).
2025-02-14 14:28:50: New connection from 192.168.178.34:65025 on port 1883.
2025-02-14 14:28:50: New client connected from 192.168.178.34:65025 as LightSwitch (p2, c1, k30, u’mqtt-user’).
2025-02-14 14:28:51: New connection from 192.168.178.49:55730 on port 1883.
2025-02-14 14:28:51: New client connected from 192.168.178.49:55730 as 3D-printer (p2, c1, k30, u’mqtt-user’).
2025-02-14 14:30:27: New connection from 172.30.32.2:48546 on port 1883.
2025-02-14 14:30:27: Client closed its connection.
2025-02-14 14:32:27: New connection from 172.30.32.2:50800 on port 1883.
2025-02-14 14:32:27: Client closed its connection.
2025-02-14 14:34:27: New connection from 172.30.32.2:33318 on port 1883.
2025-02-14 14:34:27: Client closed its connection.
2025-02-14 14:36:27: New connection from 172.30.32.2:33746 on port 1883.
2025-02-14 14:36:27: Client closed its connection.
2025-02-14 14:38:27: New connection from 172.30.32.2:55168 on port 1883.
2025-02-14 14:38:27: Client closed its connection.