eclipse-paho / eclipse-paho/paho.mqtt.java
java.lang.IllegalArgumentException: Invalid UTF-8 char: [a]
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 919
- PR merge metrics
- No merged PRs in 30d
Description
Please fill out the form below before submitting, thank you!
- [ ] Bug exists Release Version 1.2.5 ( Master Branch)
I'm trying to connect with mosquito broker via paho client (versions used are **org.eclipse.paho.client.mqttv3-1.2.5.jar** and **org.eclipse.paho.client.mqttv3-1.2.1.jar**)
When I try to connect I'm getting:
```
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: Connection lost (32109) - java.lang.IllegalArgumentException: Invalid UTF-8 char: [a]
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: at org.eclipse.paho.client.mqttv3.internal.CommsSender.handleRunException(CommsSender.java:194)
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: at org.eclipse.paho.client.mqttv3.internal.CommsSender.run(CommsSender.java:171)
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: at java.lang.Thread.run(Thread.java:764)
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: Caused by: java.lang.IllegalArgumentException: Invalid UTF-8 char: [a]
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: at org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage.validateUTF8String(MqttWireMessage.java:407)
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: at org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage.encodeUTF8(MqttWireMessage.java:327)
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: at org.eclipse.paho.client.mqttv3.internal.wire.MqttConnect.getPayload(MqttConnect.java:154)
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: at org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage.getHeader(MqttWireMessage.java:142)
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: at org.eclipse.paho.client.mqttv3.internal.wire.MqttOutputStream.write(MqttOutputStream.java:74)
2020-09-29 20:43:24.233 12057-12057/com.paho.mqtt W/System.err: at org.eclipse.paho.client.mqttv3.internal.CommsSender.run(CommsSender.java:147)
2020-09-29 20:43:24.234 12057-12057/com.paho.mqtt W/System.err: ... 1 more
```
But I didn't get this issue in **org.eclipse.paho.client.mqttv3-1.2.0.jar**
Any help to resolve this?
Thanks in advance
Contributor guide
Research direction
Start with the stack-trace entry points in org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage and MqttConnect.getPayload, then compare their behavior between versions 1.2.0, 1.2.1, and 1.2.5 while reproducing the connection to the Mosquitto broker. Done means the cause of the UTF-8 validation difference is identified and the reported connection no longer fails for the affected input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100