Oh…kay, So I have an MQTT hanging up without any warning trigger, despite the watchdog being enabled. Happened now the second time since I got it installed to monitor a Hichi (Tasmota) Power Meter Reader a week ago. And sure thought first it’d be the Hichi, but it’s MQTT failing me
So much about “relying” on MQTT? Yes, I’m “ambitioned amateur”, not a pro. So help interpreting what goes wrong and how I can make it stable much appreciated!
In the entity MQTT Connect Count I see an “Became Unavailable” at 9:21. It did not start when I attemped in the addon. So I rebooted HA, then it was on again. But restarting HA seems a big like the big gun? And I don’t want the MQTT data to be disrupted. I only use a Hichi power reader on it, but that’s important to run constantly and not “accumulate” for time-out period.
I’ve not added an automation to trigger when MQTT Connect Count becomes unavailable for more than two minutes, sending me a notification plus attempting to restart MQTT. Aside I show power consumption in my standard dashboard to also see in case it fails (becomes unavailable), but would prefer to remove it from there.
From the Log:
2025-03-13 09:19:58: mosquitto version 2.0.20 running
2025-03-13 09:20:00: New connection from ::1:51876 on port 1883.
2025-03-13 09:20:00: Client <unknown> disconnected due to protocol error.
2025-03-13 09:20:02: New connection from 172.30.32.1:51253 on port 1883.
2025-03-13 09:20:02: New client connected from 172.30.32.1:51253 as 3zfIwCCZ9M7tunEKcp7b7M (p2, c1, k60, u'homeassistant').
2025-03-13 09:20:03: New connection from 192.168.68.109:54540 on port 1883.
2025-03-13 09:20:03: New client connected from 192.168.68.109:54540 as DVES_DA9B68 (p2, c1, k30, u'mqtt').
[09:20:06] INFO: e[32mSuccessfully send discovery information to Home Assistant.e[0m
[09:20:09] INFO: e[32mSuccessfully send service information to the Supervisor.e[0m
2025-03-13 09:21:22: New connection from 172.30.32.2:60688 on port 1883.
2025-03-13 09:21:22: Client <unknown> closed its connection.
[08:21:46] INFO: e[32mService restart after closinge[0m
[09:21:50] INFO: e[32mStarting mosquitto MQTT broker...e[0m
2025-03-13 09:21:50: mosquitto version 2.0.20 starting
2025-03-13 09:21:50: Config loaded from /etc/mosquitto/mosquitto.conf.
2025-03-13 09:21:50: Warning: Mosquitto should not be run as root/administrator.
2025-03-13 09:21:50: Loading plugin: /usr/share/mosquitto/go-auth.so
[08:21:52] INFO: e[32mService restart after closinge[0m
[09:21:57] INFO: e[32mStarting mosquitto MQTT broker...e[0m
2025-03-13 09:21:58: Warning: Mosquitto should not be run as root/administrator.
2025-03-13 09:21:58: mosquitto version 2.0.20 starting
2025-03-13 09:21:58: Config loaded from /etc/mosquitto/mosquitto.conf.
2025-03-13 09:21:58: Loading plugin: /usr/share/mosquitto/go-auth.so
2025-03-13 09:21:58: ├── Username/password checking enabled.
2025-03-13 09:21:58: ├── TLS-PSK checking enabled.
2025-03-13 09:21:58: └── Extended authentication not enabled.
2025-03-13 09:21:58: Opening ipv4 listen socket on port 1883.
2025-03-13 09:21:58: Opening ipv6 listen socket on port 1883.
2025-03-13 09:21:58: Opening websockets listen socket on port 1884.
2025-03-13 09:21:58: mosquitto version 2.0.20 running
2025-03-13 09:22:03: New connection from ::1:40830 on port 1883.
2025-03-13 09:22:03: New connection from ::1:40834 on port 1883.
2025-03-13 09:22:03: Client <unknown> disconnected due to protocol error.
2025-03-13 09:22:03: Client <unknown> disconnected due to protocol error.
2025-03-13 09:22:06: New connection from 172.30.32.1:43649 on port 1883.
[08:22:08] INFO: e[32mService restart after closinge[0m
[09:22:10] INFO: e[32mStarting mosquitto MQTT broker...e[0m
2025-03-13 09:22:11: Warning: Mosquitto should not be run as root/administrator.
2025-03-13 09:22:11: mosquitto version 2.0.20 starting
2025-03-13 09:22:11: Config loaded from /etc/mosquitto/mosquitto.conf.
2025-03-13 09:22:11: Loading plugin: /usr/share/mosquitto/go-auth.so
2025-03-13 09:22:11: ├── Username/password checking enabled.
2025-03-13 09:22:11: ├── TLS-PSK checking enabled.
2025-03-13 09:22:11: └── Extended authentication not enabled.
2025-03-13 09:22:11: Opening ipv4 listen socket on port 1883.
2025-03-13 09:22:11: Opening ipv6 listen socket on port 1883.
2025-03-13 09:22:11: Opening websockets listen socket on port 1884.
2025-03-13 09:22:11: mosquitto version 2.0.20 running
2025-03-13 09:22:15: New connection from ::1:47756 on port 1883.
2025-03-13 09:22:15: Client <unknown> disconnected due to protocol error.
2025-03-13 09:22:15: New connection from 192.168.68.109:54543 on port 1883.
[08:22:17] INFO: e[32mService restart after closinge[0m
[09:22:21] INFO: e[32mStarting mosquitto MQTT broker...e[0m
2025-03-13 09:22:22: Warning: Mosquitto should not be run as root/administrator.
2025-03-13 09:22:22: mosquitto version 2.0.20 starting
2025-03-13 09:22:22: Config loaded from /etc/mosquitto/mosquitto.conf.
2025-03-13 09:22:22: Loading plugin: /usr/share/mosquitto/go-auth.so
2025-03-13 09:22:22: ├── Username/password checking enabled.
2025-03-13 09:22:22: ├── TLS-PSK checking enabled.
2025-03-13 09:22:22: └── Extended authentication not enabled.
2025-03-13 09:22:22: Opening ipv4 listen socket on port 1883.
2025-03-13 09:22:22: Opening ipv6 listen socket on port 1883.
2025-03-13 09:22:22: Opening websockets listen socket on port 1884.
2025-03-13 09:22:22: mosquitto version 2.0.20 running
2025-03-13 09:22:25: New connection from ::1:33988 on port 1883.
2025-03-13 09:22:25: Client <unknown> disconnected due to protocol error.
2025-03-13 09:22:31: New connection from 172.30.32.1:55397 on port 1883.
2025-03-13 09:22:31: New client connected from 172.30.32.1:55397 as 3zfIwCCZ9M7tunEKcp7b7M (p2, c1, k60, u'homeassistant').
[09:22:33] INFO: e[32mSuccessfully send discovery information to Home Assistant.e[0m
[09:22:38] INFO: e[32mSuccessfully send service information to the Supervisor.e[0m
s6-supervise mosquitto: warning: finish script lifetime reached maximum value - sending it a SIGKILL
s6-supervise nginx: warning: finish script lifetime reached maximum value - sending it a SIGKILL
[08:23:00] INFO: e[32mService restart after closinge[0m
[09:23:02] INFO: e[32mStarting NGINX for authentication handling...e[0m
[09:23:11] INFO: e[32mStarting mosquitto MQTT broker...e[0m
2025-03-13 09:23:13: mosquitto version 2.0.20 starting
2025-03-13 09:23:13: Config loaded from /etc/mosquitto/mosquitto.conf.
2025-03-13 09:23:13: Loading plugin: /usr/share/mosquitto/go-auth.so
2025-03-13 09:23:13: Warning: Mosquitto should not be run as root/administrator.
2025-03-13 09:23:13: ├── Username/password checking enabled.
2025-03-13 09:23:13: ├── TLS-PSK checking enabled.
2025-03-13 09:23:13: └── Extended authentication not enabled.
2025-03-13 09:23:13: Opening ipv4 listen socket on port 1883.
2025-03-13 09:23:13: Opening ipv6 listen socket on port 1883.
2025-03-13 09:23:13: Opening websockets listen socket on port 1884.
2025-03-13 09:23:13: mosquitto version 2.0.20 running
2025-03-13 09:24:03: New connection from ::1:51654 on port 1883.
2025-03-13 09:24:03: Client <unknown> disconnected due to protocol error.
s6-rc: info: service legacy-services: stopping
2025-03-13 09:24:09: mosquitto version 2.0.20 terminating
2025-03-13 09:24:09: Saving in-memory database to /data//mosquitto.db.
s6-svwait: fatal: timed out
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
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
[09:30:12] INFO: e[32mSSL is not enablede[0m
Killed
cont-init: info: /etc/cont-init.d/mosquitto.sh exited 137
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped