Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

...