Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to AWS IoT core: "Exception while decoding CONNACK: remaining length too short" #284

Closed
alex-vovk opened this issue Feb 28, 2022 · 1 comment
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@alex-vovk
Copy link

alex-vovk commented Feb 28, 2022

Expected behavior

Connected to the AWS IoT Core and subscribed to the topic.

Actual behavior

Connection fails. The following output is provided:

Client 'UNKNOWN@private-endpoint.iot.us-east-1.amazonaws.com' sending CONNECT MqttConnect{keepAlive=60, cleanStart=true, sessionExpiryInterval=0}
Client 'UNKNOWN@private-endpoint.iot.us-east-1.amazonaws.com' DISCONNECTED Exception while decoding CONNACK: remaining length too short
Exception while decoding CONNACK: remaining length too short

To Reproduce

Steps

Run from the terminal:
mqtt-cli.exe subscribe --topic "#" --showTopics --host private-endpoint.us-east-1.amazonaws.com --port 8883 --secure --cert certificate.pem.crt --key private.pem.key --verbose --debug

Reproducer code

Details

  • Affected MQTT CLI version(s):
  • Used JVM version:
4.5.1
Picocli 4.5.0
JVM: 14 (Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 14+36-1461)
OS: Windows 10 10.0 amd64

Workaround

Add switch to MQTT 3 and set QOS to 0 by adding the following parameters: '--mqttVersion 3 --qos 0'
For example: mqtt-cli.exe subscribe --topic "#" --showTopics --host private-endpoint.us-east-1.amazonaws.com --port 8883 --secure --cert certificate.pem.crt --key private.pem.key --verbose --debug --mqttVersion 3 --qos 0

@MicWalter
Copy link

I'm closing this issue as at the time where you reported this issue AWS IoT core did not support MQTT5 and you ran into this issue: hivemq/hivemq-mqtt-client#327

As AWS added MQTT 5 support it should work now

@MicWalter MicWalter added invalid This doesn't seem right bug Something isn't working labels Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants