MQTT bad topic name crash #9381
Replies: 5 comments 2 replies
-
One clarification: these logs suggest a connection crash, not a RabbitMQ crash. I supposed RabbitMQ actually keeps handling other connections, correct? Do you know what these characters are? I guess what we see in the logs is not what they really were. |
Beta Was this translation helpful? Give feedback.
-
According to the log, it's an exception on a single connection, the RabbitMQ node should still be up. You can purge the queue or set a TTL of 0 for messages on it using a policy to make RabbitMQ itself delete the message. Without any details about what the unsupported value is, all I can think of is #9059, a fix for which has shipped in |
Beta Was this translation helpful? Give feedback.
-
@petervanalst can you have a guess as to what value and in what MQTT |
Beta Was this translation helpful? Give feedback.
-
Yes the consumer connection fails. RabbitMQ keeps handling other connections. But the consumer cannot resume operation with the specific queue, the connection will keep crashing until the bad message is gone. The device sent a corrupted version of a message with topic: "sva/86995103114911/alarm/strhgw", having a numeric value message of: 0, or: 1. The bad device is blocked and being replaced, i do not have a packet capture. Maybe i can find out more by looking at the good devices. |
Beta Was this translation helpful? Give feedback.
-
I suspect the same behaviour to happen in 3.11.x, but not in the latest 3.13 beta. We could remove that specific strict check (checking if a topic name is valid UTF-8 when sending a PUBLISH packet to the client) for 3.12 if we wanted. The proper solution here would be to optionally introduce more checks when RabbitMQ receives MQTT packets: upon parsing packets, RabbitMQ could check that all data is valid according to the spec, and otherwise either terminate the connection or if this case would have happened in MQTT 5.0, RabbitMQ could reply with a PUBACK and reason code The AMQP 1.0 plugin for example defines a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
A device is able to send a message with unsupported characters in topic name that will crash RabbitMQ on handling the queue.
I cannot get rid of the message by trying to consume it, RabbitMQ crashes. Trying to get and/or remove it via management frontend will crash with 500 error.
Deleting the queue, and let it be created again looks the only way to resume operation.
Reproduction steps
Problematic device is one of about 2k devices that are connected. Others can have unparseable messages but will not crash RabbitMQ.
Expected behavior
RabbitMQ needs to reject messages with unsupported characters in topic name.
At least give a way to drop single message without affecting other messages in queue.
Additional context
Using rabbitmq:3.12.3-management with MQTT plugin, clustered using three nodes in separate docker environments.
Crash log
Beta Was this translation helpful? Give feedback.
All reactions