gobridge

Runbook: MQTT Ingress Poison / Malformed or Oversized Broker Packet

Applies to: MQTT (paho) transport sessions. Audience: on-call operators. Risk: for a cap-violating publish, each poison drop is an acknowledged, deliberate message loss — the bridge acks a publish it refuses to process. The session itself stays healthy; the urgency is finding the publisher, not saving the bridge. A malformed or oversized packet from the broker is different: nothing is acked, but the session drops its connection and reads not ready for at least 30 s after each reject; see Broker sends a malformed or oversized packet.

Background

The MQTT CONNECT advertises one inbound limit the broker can enforce: the whole-packet Maximum Packet Size (max_payload_bytes + a 128 KiB metadata allowance). The bridge’s finer caps — max_payload_bytes itself, the ingress metadata byte cap (128 KiB), and the User Property count cap (128) — are local: a compliant broker forwards any packet whose total fits, even when an individual cap is violated. Any authorized publisher can therefore produce such a packet, accidentally or deliberately.

The bridge acks-and-drops these packets (MQTTIngressPoisonDropped, Error log once per violation class, Debug for repeats). It must not do anything else: an un-acked rejection is redelivered by the broker on every clean_start=false resume, and a session-terminal rejection would loop restart → redeliver → terminal forever — a permanent, publisher-triggerable kill switch for every route on the session.

Two violation classes are handled earlier, at the raw pre-decode guard, because only a broken broker can produce them: malformed MQTT structure and a packet larger than the advertised Maximum Packet Size. See Broker sends a malformed or oversized packet.

Symptom

Diagnosis

  1. Read the Error log for the violation class, topic, and sizes. Repeated drops of the same class log at Debug — raise the log level temporarily if you need per-message evidence, and for the real User Property count of a truncated packet.
  2. Identify the publisher from the topic and broker-side logs/ACLs. The bridge cannot name the publisher — MQTT carries no producer identity.
  3. Decide whether the traffic is legitimate:
    • Legitimate but over-cap (e.g. a producer legitimately sends 300 KiB payloads against a 256 KiB max_payload_bytes): raise the cap.
    • Producer bug (runaway header count, unbounded metadata): fix the producer.
    • Hostile (deliberate cap probing): revoke the publisher’s broker ACL.

Remediation

Alerting

Alert on ANY non-zero MQTTIngressPoisonDropped rate: it is always either a misconfigured cap, a broken producer, or hostile traffic — never steady-state normal.

Broker sends a malformed or oversized packet

The raw pre-decode guard rejects a packet with a malformed MQTT structure, or one larger than the Maximum Packet Size the bridge advertised in CONNECT (max_payload_bytes + 128 KiB), before Paho decodes it. The packet never reaches a route, and nothing is acked. The guard drops the connection, not the session: the session reconnects and is never terminal (ADR 0021).

Symptom

Diagnosis

  1. Read the Error log. The packet size and the limit tell an oversized packet from a malformed one.
  2. Find what sent the packet. A compliant broker never forwards a packet above the client’s Maximum Packet Size and never sends malformed MQTT, so the cause is the broker or something between the broker and the bridge: a proxy, a load balancer, a WebSocket gateway.

Remediation

Alerting

Alert on ANY non-zero MQTTIngressRejected: a compliant broker never sends the packets it counts. On an MQTT 3.1.1 session there is one more cause, a broker in-flight limit above receive_maximum; see the next section.

On an MQTT 3.1.1 session

A session with protocol_version: v3.1.1 changes three things on this page (MQTT 3.1.1):