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

**URL:** <https://community.hivemq.com/t/com-hivemq-client-mqtt-exceptions-mqttdecodeexception-exception-while-decoding-connack-remaining-length-too-short/2500>\
**Category:** Uncategorized\
**Created:** [November 20, 2023, 6:31am UTC](https://community.hivemq.com/t/com-hivemq-client-mqtt-exceptions-mqttdecodeexception-exception-while-decoding-connack-remaining-length-too-short/2500 "2023-11-20T06:31:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hussainbadshah](https://avatars.discourse-cdn.com/v4/letter/h/a698b9/32.png) [@hussainbadshah](https://community.hivemq.com/u/hussainbadshah)\
**Post date:** [November 20, 2023, 6:31am UTC](https://community.hivemq.com/t/com-hivemq-client-mqtt-exceptions-mqttdecodeexception-exception-while-decoding-connack-remaining-length-too-short/2500/1 "2023-11-20T06:31:39Z")

</div>

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](https://github.com/hivemq/hivemq-mqtt-client/issues/327) 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.

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [November 21, 2023, 12:41pm UTC](https://community.hivemq.com/t/com-hivemq-client-mqtt-exceptions-mqttdecodeexception-exception-while-decoding-connack-remaining-length-too-short/2500/2 "2023-11-21T12:41:05Z")

</div>

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](https://github.com/hivemq/hivemq-mqtt-client/issues/327), 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](https://github.com/hivemq/hivemq-mqtt-client/issues/327) as you can see in the provided image:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/hivemq1/original/1X/f337d1f5e5af558d0abf40388d2fb71ec20c0f02.jpeg)

Best,  
Dasha from HiveMQ Team

---

<div class="post-metadata">

**Author:** ![hussainbadshah](https://avatars.discourse-cdn.com/v4/letter/h/a698b9/32.png) [@hussainbadshah](https://community.hivemq.com/u/hussainbadshah)\
**Post date:** [November 22, 2023, 5:18am UTC](https://community.hivemq.com/t/com-hivemq-client-mqtt-exceptions-mqttdecodeexception-exception-while-decoding-connack-remaining-length-too-short/2500/3 "2023-11-22T05:18:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [November 22, 2023, 8:10am UTC](https://community.hivemq.com/t/com-hivemq-client-mqtt-exceptions-mqttdecodeexception-exception-while-decoding-connack-remaining-length-too-short/2500/4 "2023-11-22T08:10:42Z")

</div>

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
