Mosquitto MQTT Broker Repeatedly Drops Connection

I’m using the Mosquito MQTT Broker and I’ve had several instances in the last few months where the broker is no longer listening to any MQTT messages that have been subscribed to. When this happens, I’ve tried the following; (1) reloading the integration (2) disabling and re-enabling the integration with no success. The only thing that works is to delete the Mosquitto MQTT broker entirely and then reinstall. It works fine for a period of time but then this issue reappears.

Here is some version info:

  • Installation method Home Assistant OS
  • Core 2026.5.4
  • Supervisor 2026.05.1
  • Operating System 17.2
  • Frontend 20260429.4

I have logging enabled for MQTT but when looking at the logs, I only see a generic system WARNING message:

2026-06-07 14:18:55.241 WARNING (MainThread) [homeassistant.components.mqtt.client] Error returned from MQTT server: The connection was lost.

Any ideas or debugging tips would be greatly appreciated! I’ve been running HA/MQTT for several years with little issues until now. Without MQTT working, my installation is severely crippled as I have numerous motion sensors and devices thru Tasmota that depend on MQTT messaging - Thanks, Rob

PS I’m having trouble location version info the Mosquitto MQTT broker but it was installed a few days ago so it is probably “latest”

Maybe try a stand along installation of the mosquitto? I installed it this way and never had problems.

What are you running as a server?
Running into CPU or memory limitations?

Have you considered updating your Core and OS to the latest version?

  • Core2026.6.2
  • Operating System17.3

I'm running a Pi 3 with 4Gb of memory. I took a brief look at the real time plots of CPU and memory usage and they seem to be OK. I will revisit these plots once I get MQTT up and running again. I wish the debug logs gave more specific information as to why the broker stopped listening to published topics.

I have updated since the last crash of Mosquitto but I have been doing recent updates in an effort to prevent the broker from dying on me with no luck. I guess it doesn't hurt to try again at this point.

I run a stand alone MQTT Broker, but I remember issues with Core 2026.5.4

Like here :down_arrow:

Unless you did some fancy soldering, AFAIK, these have only 1gb of memory.

If this is the case and the Issue LiQuid mentioned doesn't help, it might be you are running out of memory.

Yes, my error, only 1 GB. From the memory usage utility in HA, it looks like I'm using about 60% of the memory on average.

And during higher CPU usage times more than 100% including using the SD card as swap space...

CPU usage is minimal (~3%) under normal loads, ie viewing sensor data. I don't use any high-resource intensive integrations so this minimal CPU value is representative for the major of the time.

As an aside, Since the original posting of this topic a few weeks I've updated the HA core to 2026.6.4 and reinstalled the mosquitto MQTT broker and I have had no problems, fingers crossed.

After a few weeks of running fine, this problem with Mosquitto MQTT is back, the broker is “deaf” from hearing any MQTT messages being sent.

I posted this issue back in early June 2026, since then, the problem is still persisting and now the mqtt connection drops within a few days and it never gets restored. As mentioned in my earlier posting, the only way to get the MQTT broker to work is to delete the integration and do a fresh install. After my last reinstall, I enabled mqtt logging and have captured the moment that MQTT drops connections and fails to restore. The following log snippet shows normal mqtt transaction and then an exception happens and then no more mqtt. pay attention to events with timestamp starting at 2026-07-12 09:55:35.736


026-07-12 09:55:20.778 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '{"temperature": 66.8,"humidity": 74.7,"pressure": 29.320}' with variables {'entity_id': 'sensor.basement_humidity', 'name': 'Basement Humidity', 'this': <template TemplateStateFromEntityId(sensor.basement_humidity)>} with default value 'default' and Template<template=({{ value_json.humidity }}) renders=2568>

2026-07-12 09:55:20.780 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '{"temperature": 66.8,"humidity": 74.7,"pressure": 29.320}' with variables {'entity_id': 'sensor.basement_enviromental_temperature_sensor', 'name': 'Basement Temperature', 'this': <template TemplateStateFromEntityId(sensor.basement_enviromental_temperature_sensor)>} with default value 'default' and Template<template=({{ value_json.temperature }}) renders=2568>

2026-07-12 09:55:20.781 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '{"temperature": 66.8,"humidity": 74.7,"pressure": 29.320}' with variables {'entity_id': 'sensor.basement_pressure', 'name': 'Basement Pressure', 'this': <template TemplateStateFromEntityId(sensor.basement_pressure)>} with default value 'default' and Template<template=({{ value_json.pressure }}) renders=2568>

2026-07-12 09:55:35.736 DEBUG (MainThread) [homeassistant.components.mqtt.client] Mosquitto Mqtt Broker: connection closed 71

2026-07-12 09:55:35.843 DEBUG (MainThread) [homeassistant.components.mqtt.client] Disconnected from MQTT server core-mosquitto:1883 (Unspecified error)

2026-07-12 09:55:35.849 WARNING (MainThread) [homeassistant.components.mqtt.client] Error returned from MQTT server: The connection was lost.

2026-07-12 09:55:48.072 DEBUG (MainThread) [homeassistant.components.mqtt.client] Error re-connecting to MQTT server due to exception: [Errno 111] Connection refused

2026-07-12 09:56:03.477 DEBUG (MainThread) [homeassistant.components.mqtt.client] Error re-connecting to MQTT server due to exception: timed out

2026-07-12 09:56:18.509 DEBUG (MainThread) [homeassistant.components.mqtt.client] Error re-connecting to MQTT server due to exception: timed out

2026-07-12 09:56:31.567 DEBUG (MainThread) [homeassistant.components.mqtt.client] Error re-connecting to MQTT server due to exception: [Errno 113] Host is unreachable

Here is some version info, I’m running this on RPi3

  • nstallation method Home Assistant OS
  • Core 2026.7.1
  • Supervisor 2026.06.2
  • Operating System 17.2
  • Frontend 20260624.4

Any ideas? This is very frustrating to say the least and has only been a problem in the last 3 months, I’ve been running mqtt on HA for several years. Thanks in Advance, Rob

If I were a betting man, I’d say your Pi3 is running out of memory & killing the connection. Just because you say it averages at 60% doesn’t mean there aren’t spikes where it goes to 100%.

Face it, it’s time to retire that Pi & move on to something with more memory. HA install docs for the Pi now recommend at least 2GB for that reason.

You could move HA to a new machine like a NUC and run the MQTT broker on the old RPI3. Might be able to run something like Pihole on the RPI3 at same time.

I will probably take that path and try new hardware. I have a RPI5 I could try this out on. I do daily backups of my HA so hopefully it will be easy to use the backup to restore my settings a config on the new device. I think a RPI4 with 4G of memory might be a good replacement. I can’t wait for the AI bubble to burst as it has really blown up the prices of devices with 8 or 16 Gb of memory. Thanks, Rob