com.hivemq.client.mqtt.exceptions.MqttDecodeException: Exception while decoding CONNACK: remaining length too short

Hi HiveMQ team,

I have MQTT 3 broker server and a HiveMQ MQTT 5 client that tries to connect to the broker but fails with the following errors:

com.hivemq.client.mqtt.mqtt5.exceptions.Mqtt5DisconnectException: Exception while decoding CONNACK: remaining length too short

Caused by: com.hivemq.client.mqtt.exceptions.MqttDecodeException: Exception while decoding CONNACK: remaining length too short

Apparently this is a known issue according to: Misleading error message when connecting to an MQTT 3 only broker with MQTT 5 · Issue #327 · hivemq/hivemq-mqtt-client · GitHub and HiveMQ team fixed the same in some 1.2 version, as mentioned in the same github comment thread.

My query is: If that issue was really fixed, then in which docker image is that fix available, so I could pull and deploy the same MQTT 3 docker image to resolve the aforementioned errors? Quick support on this issue would be very much appreciated, thanks in advance.

Hi @hussainbadshah

Regarding the ticket you mentioned Misleading error message when connecting to an MQTT 3 only broker with MQTT 5 · Issue #327 · hivemq/hivemq-mqtt-client · GitHub, it’s important to note that this pertains to the hivemq-mqtt-client and not the broker itself.

The issue has been successfully addressed in the hivemq-mqtt-client, and you can find the details of the fix in the ticket as you can see in the provided image:

Best,
Dasha from HiveMQ Team

Hi @Daria_H yes, I stand corrected, this issue was in HiveMQ MQTT client and not in broker.
However, this issue was apparently fixed in the 1.2 version of hivemq-mqtt client and I am using 1.3.2 version of hivemq-mqtt client, in which this fix should be there as it’s a later version than 1.2.

Hi @hussainbadshah

I appreciate your diligence in identifying the source of the issue in the HiveMQ MQTT client and providing information about the versions.

To assist you further, could you please share the steps you took to reproduce the issue? If the reproduction involves a specific bash command or a Java project, kindly provide the details or, in the case of a Java project, share the link to the repository or upload it to a file share. This information will be invaluable for our investigation.

Additionally, to better understand the context, could you let us know which MQTT 3 broker you are using? Knowing the broker version can help us delve deeper into the problem and expedite the resolution process.

Your cooperation in providing these details will significantly aid us in making progress toward a resolution.

Best,
Dasha from HiveMQ Team