Mosquitto 5.1.1add-on is broken

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?

I think I have a path to overcome the problem. I used the following procedure to get 5.1.1 working for me.

  1. Take a snapshot (complete) from your current home assistant instance
  2. go to the mosquitto add-on page and copy your configuration into an text editor for later use.
  3. deinstall the mosquitto add-on
  4. install mosquitto 5.1.1 and copy the configuration back from the editor
  5. start the add-on

This solved the problem in my installation

Could you please post that on the github issue too?

already done. Infact I posted it first on github

1 Like

I can’t feel it helped me - the 5.1.1 version is still much slower than 5.1 for me. Reverted back to 5.1.

I just cannot understand that could possible be the problem…

I experienced the same with 5.1.1 installed from scratch. No disconnections but everything seemed slower and got a lot of log messages “No ACK from MQTT server in 10”. Went back to 5.1 and working fine since.