Question
Why has my client been disconnected ungracefully ?
Answer
Statement
Client ID: UNKNOWN, IP:x.x.x.x disconnected ungracefully.
...
This means that the broker initiated the disconnected based on the Client Take-Over Mechanism.
Typically this is caused by a client losing its connection and re-connecting before the broker was able to detect the same connection loss.
...
Statement
Client ID: abc, IP:x.x.x.x was disconnected. reason: Sent too many concurrent PUBLISH messages.
Client ID: abc, IP:x.x.x.x disconnected ungracefully.
Meaning
Info |
---|
This disconnect reason does only affect clients using MQTT version 5. |
When you see this message, the client got disconnected by the broker because it sent more unacknowledged PUBLISH messages than the Receive Maximum value sent to it by broker in the CONNACK packet.
See MQTT specification.
The Server MUST NOT send more than Receive Maximum QoS 1 and QoS 2 PUBLISH packets for which it has not received PUBACK, PUBCOMP, or PUBREC with a Reason Code of 128 or greater from the Client [MQTT-3.3.4-9]. If it receives more than Receive Maximum QoS 1 and QoS 2 PUBLISH packets where it has not sent a PUBACK or PUBCOMP in response, the Client uses DISCONNECT with Reason Code 0x93 (Receive Maximum exceeded) as described in section 4.13 Handling errors.
Seeing this messages indicates a problem with the MQTT client implementation.
...
Statement
Client ID: abc, IP:x.x.x.x was disconnected. reason: Sent second CONNECT message.
Client ID: abc, IP:x.x.x.x disconnected ungracefully.
Meaning
Info |
---|
This disconnect reason implies a protocol violation by the client |
When you see this message, the client got disconnected by the broker because it sent a second CONNECT packet on an already existing MQTT connection.
See MQTT specification.
After a Network Connection is established by a Client to a Server, the first Packet sent from the Client to the Server MUST be a CONNECT Packet [MQTT-3.1.0-1].
A Client can only send the CONNECT Packet once over a Network Connection. The Server MUST process a second CONNECT Packet sent from a Client as a protocol violation and disconnect the Client [MQTT-3.1.0-2]. See section 4.8 for information about handling errors.
Seeing this messages indicates a problem with the MQTT client implementation.
...
Statement
Disconnecting client with clientId xxxx and ip xxx.xx.xx.xx forcibly via extension system.
Meaning
This statement occurs when using HiveMQ Enterprise Security Extension, which disconnects the client forcefully when the connected client’s authentication is expired.