CE Broker Disconnects client for malformed String

In event.log file, whenever it logs “Client ID: xxxxx, IP: was disconnected. reason: Sent a PUBLISH with malformed UTF-8 String for ‘topic’.” message, how to replicate such scenario? and what should be solution for?

Hello @patelaryam ,

Thank you for the outreach!

Typically, this log indicates that the topic value that was submitted with the publish packet did not meet the MQTT specifications for topic designation, or there may have been a permissions issue.

Would it be possible to provide the publish message that was sent, causing this error?

Aaron from HiveMQ Team

Thanks for reply @AaronTLFranz

from event.log, it just logs

  1. Client ID: xxxx, IP:, Clean Start: true, Session Expiry: 0 connected.

  2. Client ID: xxxx, IP: was disconnected. reason: Sent a PUBLISH with malformed UTF-8 String for ‘topic’.

    Is there any way to trace both TopicName and Payload from HiveMQ-CE Broker-Settings?

Hello @patelaryam ,

The topic name and payload should be available on the client itself - these are what is being submitted from the client to the broker during the publish request. More information on the formation of the Publish request within MQTT is available here.

Could I have you verify the current client in use, and the publish command that is being sent from the client? This command would be the one that is being read as having a malformed topic string.

Aaron from HiveMQ Team

@AaronTLFranz The scenario is… there are thousands of Embedded-Devices deployed in remote-areas and a CE-Broker is serving them… how could we trace TopicName and Payload from a particular one?

       That's why if you can provide a way to trace such details from CE-Broker-Settings or either from one of Extension-hook to troubleshoot for....

Hello @patelaryam ,

To confirm, is this happening on a wide array of varying clients, or a specific set of client IDs? Are these client IDs assigned dynamically, or are they assigned specific IDs?

Additionally, does the HiveMQ.log file contain any references to this specific client ID?

The error provided indicates that the topic provided for a specific PUBLISH request is outside of MQTT parameters, resulting in a disconnect.

As an extra note, there is an available extension, MQTT Message Log Extension, that will allow you to receive more verbose diagnostic logs. This is available here.

Aaron from HiveMQ Team

@AaronTLFranz ,

  1. It happens to a specific set of ClientIds.
  2. ClientIds are manually assigned at the time of Installation.
  3. HiveMq.log file doesn’t have any kind of info… for this scenario.
  4. Thanks for Message Log Extension for further Diagnosis… we will integrate and get back to you soon.

Amit from Tvadartham Technologies Pvt Ltd