Mosquitto 5.1.1add-on is broken

After Upgrading to 5.1.1 my whole homeassistant setup is unusable.
We are talking here about the official “Mosquitto broker” add-on running in docker as part of the home assistant installation.
After ther upgrade the CPU usage goes to 25% (normally below 1%).
After downgrading to 5.1 the system seems to work ok again.

The issue is documented here
https://github.com/home-assistant/addons/issues/1887 but there seems no activity since several days

2 Likes

So, it’s a known bug.

But not solved yet

Correct. But it won’t be fixed here, the Github issue is the right spot.

The reputation of the home assistant environment is actually severely damaged by this.

For whatever reason this mqtt issue is not handled and complaints are piling up on github

For a lot of users relying on mqtt as a backbone of their system infrastructure this is very bad.
One of the key advantages of home assistant is the integration of a mqtt broker to get zigbee, zwave and self made devices integrated.

@frenck: this is hurting home assistant reputation. Your help to get this fixed would be highly appreciated.

have you looked at what the difference between 5.1.1 and 5.1 is? It is a single line of code that references the connection password as a password rather than a raw string, specifically for the one that allows HA to connect to the broker.

The dockerfile and executibles that it is built from have not changed one bit.

HOWEVER, the docker image that it pulls might have, but the hash appears to be an alpine linux image from April of 2020… so I have no idea why this update would do anything to break things

@chris_ka can you change the subject to “Mosquitto 5.1.1 add-on is broken”, please? Cause that’s what it is: No add-ons, no problems …

Mosquitto 5.1.1 is the addon, HA addons simply calls it “Mosquitto broker 5.1.1”, which uses an Alpine linux base image v 3.10, which then pulls mosquitto 1.6.3-r0 (as far as i can tell)

I upgraded to 5.1.1 a few days ago and Mqtt was acting weird. It would disconnect several clients randomly whenever I connect mqtt explorer. Downgrade back on version and working fine.

1 Like

Which emphasises my statement. It’s the Mosquitto add-on which is broken, whereas Eclipse Mosquitto in it’s most recent version 2.0.9 runs and incorporates flawless with Home Assistant.

It looks like 5.1.1 pulls a different base image, Alpine 3.10.5, and 5.1 pulls 3.10.2, which I would not expect to be the cause of the problem, but the actual build image for 5.1.1 contains other substantial changes, the kind which should NOT be seen in a x.y.z bump.

Here are the big ones:
5.1:

|1 BASHIO_VERSION=0.5.0 /bin/ash -o pipefail -c apk add --no-cache         bash         jq         tzdata         ca-certificates         curl         bind-tools         && mkdir -p /tmp/bashio     && curl -L -s https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz | tar -xzf - --strip 1 -C /tmp/bashio     && mv /tmp/bashio/lib /usr/lib/bashio     && ln -s /usr/lib/bashio/bashio /usr/bin/bashio     && rm -rf /tmp/bashio

5.1.1:

|5 BASHIO_VERSION=0.12.1 BUILD_ARCH=amd64 JEMALLOC_VERSION=5.2.1 S6_OVERLAY_VERSION=2.1.0.2 TEMPIO_VERSION=2021.01.0 /bin/ash -o pipefail -c set -x     && apk add --no-cache         bash         bind-tools         ca-certificates         curl         jq         tzdata         && apk add --no-cache --virtual .build-deps         build-base         && curl -L -f -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz"         | tar zxvf - -C /     && mkdir -p /etc/fix-attrs.d     && mkdir -p /etc/services.d         && curl -L -f -s "https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2"         | tar -xjf - -C /usr/src     && cd /usr/src/jemalloc-${JEMALLOC_VERSION}     && ./configure     && make     && make install         && mkdir -p /usr/src/bashio     && curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz"         | tar -xzf - --strip 1 -C /usr/src/bashio     && mv /usr/src/bashio/lib /usr/lib/bashio     && ln -s /usr/lib/bashio/bashio /usr/bin/bashio         && curl -L -f -s -o /usr/bin/tempio         "https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}"     && chmod a+x /usr/bin/tempio         && apk del .build-deps     && rm -rf /usr/src/*

obviously i am looking at an amd64 build, but i checked armv7 as well and the version changes are the same.

I do not use hassos or its addons, but I would agree with @chris_ka that this would be reputation damaging, there is clearly a large difference between the images which are causing this issue, unfortunately with docker hub there is no diff function to see what has changed, and tracking down base images is NOT easy, I have been working on it for an hour to get the details pinned down.

The changelog for the addon on github only lists the password schema as the change, which given its version number change is appropriate, but the docker image is far different and well beyond even a x.y bump.

7 Likes

I changed it. But it shouldn’t be necessary. The subtopic is Third party integration and mosquitto 5.1.1 is the add-on.

2 Likes

As I said on GitHub, my supervised amd64 works fine with the mosquito 5.1.1 add-on. Perhaps the problem is in hassos?

I am using hassos based Home Assistant amd64 version (virtual machine) and I have also noticed strange issues with Mosquito 5.1.1. The responses became some kind of slow, although there are no error messages in the Mosquitto logs. For example I have two Mqtt based wifi lights that combined into a group within Home Assistant and I am controlling this group through Zigbee2Mqtt button. Before this version, clicking on the button was toggling both lights at the same time, but now there is a delay between first light and the second light. This is only an example, everything became so slow… Going back to version 5.1 returned everything to normal again.

I am on the same boat. Using official hassos on a raspberry pi 4. Mosquito addon 5.1.1 results in slow response for my MQTT devices (specially shellies connected through shelly discovery script). Reverting back to 5.1 and everything was OK again…

Ha… I knew something is wrong. For last few weeks turning all lights in my house off at once by turning off a light group can take more than 5 seconds. I was thinking what happenned.
Interestingly, the operation might be quick if mqtt light being subject of the test is toggled prior to actual test

What is the way to downgrade? i was looking around but found nothing useful.

I had a couple of weeks old full home assistant backup so I selected only the mosquito addon when restoring from the supervisor/snapshot menu. Worked perfectly.

Check also this comment on the github issue that explains a way to rollback without backup.

Regards,

Thank you for response and idea that it can be restored from backup. It’s most easiest way.

BTW 2 weeks passed and this broken version hasn’t been rolled back from repository.
What’s wrong?