Client <unknown> closed its connection

I’m a complete noob to HASS. Got around to installing mqtt via mosquitto yesterday, but I wasn’t able to get past the configuration. Whenever I click configure and then submit, I get a message saying “Failed to connect”. I checked the logs and they only show:
2023-10-24 19:50:51: New connection from 172.30.32.2:50774 on port 1883.
2023-10-24 19:50:51: Client closed its connection.
I am running HAOS directly on an old intel nuc using ethernet if that helps.
Thanks for any help. I am new to smart homes in general.
I’ll copy and paste the logs I see below:

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
[19:42:49] 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)
[19:42:49] INFO: Starting NGINX for authentication handling…
[19:42:49] INFO: Starting mosquitto MQTT broker…
2023-10-24 19:42:49: mosquitto version 2.0.17 starting
2023-10-24 19:42:49: Config loaded from /etc/mosquitto/mosquitto.conf.
2023-10-24 19:42:49: Loading plugin: /usr/share/mosquitto/go-auth.so
2023-10-24 19:42:49: Warning: Mosquitto should not be run as root/administrator.
2023-10-24 19:42:49: ├── Username/password checking enabled.
2023-10-24 19:42:49: ├── TLS-PSK checking enabled.
2023-10-24 19:42:49: └── Extended authentication not enabled.
2023-10-24 19:42:49: Opening ipv4 listen socket on port 1883.
2023-10-24 19:42:49: Opening ipv6 listen socket on port 1883.
2023-10-24 19:42:49: Opening websockets listen socket on port 1884.
2023-10-24 19:42:49: mosquitto version 2.0.17 running
2023-10-24 19:42:49: New connection from 127.0.0.1:40984 on port 1883.
2023-10-24 19:42:49: Client disconnected due to protocol error.
s6-rc: info: service legacy-services successfully started
[19:42:50] INFO: Successfully send discovery information to Home Assistant.
[19:42:50] INFO: Successfully send service information to the Supervisor.
2023-10-24 19:42:51: New connection from 172.30.32.2:43122 on port 1883.
2023-10-24 19:42:51: Client closed its connection.
2023-10-24 19:44:51: New connection from 172.30.32.2:35328 on port 1883.
2023-10-24 19:44:51: Client closed its connection.
2023-10-24 19:46:51: New connection from 172.30.32.2:34266 on port 1883.
2023-10-24 19:46:51: Client closed its connection.
2023-10-24 19:48:51: New connection from 172.30.32.2:38716 on port 1883.
2023-10-24 19:48:51: Client closed its connection.
2023-10-24 19:50:51: New connection from 172.30.32.2:50774 on port 1883.
2023-10-24 19:50:51: Client closed its connection.

:clap: Welcome!

I don’t use HASSOS, but I believe you need to set an mqtt user/password for it to work. This should help…

I literally just posted another question with the same topic. Perhaps what I found will help you…

1 Like