nats-io/nats-server · error
older protocol %q not supported
Error message
older protocol %q not supported
What it means
Returned when the CONNECT packet's protocol name does not match the supported "MQTT" name and matches the old "MQIsdp" name used by MQTT 3.1. The server does not support the legacy protocol and reports this specific, clearer error instead of a generic protocol-name mismatch.
Source
Thrown at server/mqtt.go:3798
//////////////////////////////////////////////////////////////////////////////
//
// CONNECT protocol related functions
//
//////////////////////////////////////////////////////////////////////////////
// Parse the MQTT connect protocol
func (c *client) mqttParseConnect(r *mqttReader, hasMappings bool) (byte, *mqttConnectProto, error) {
// Protocol name
proto, err := r.readBytes("protocol name", false)
if err != nil {
return 0, nil, err
}
// Spec [MQTT-3.1.2-1]
if !bytes.Equal(proto, mqttProtoName) {
// Check proto name against v3.1 to report better error
if bytes.Equal(proto, mqttOldProtoName) {
return 0, nil, fmt.Errorf("older protocol %q not supported", proto)
}
return 0, nil, fmt.Errorf("expected connect packet with protocol name %q, got %q", mqttProtoName, proto)
}
// Protocol level
level, err := r.readByte("protocol level")
if err != nil {
return 0, nil, err
}
// Spec [MQTT-3.1.2-2]
if level != mqttProtoLevel {
return mqttConnAckRCUnacceptableProtocolVersion, nil, fmt.Errorf("unacceptable protocol version of %v", level)
}
cp := &mqttConnectProto{}
// Connect flags
cp.flags, err = r.readByte("flags")
if err != nil {View on GitHub (pinned to 3a66a489d2)
Solutions
- Upgrade the client library/firmware to use MQTT 3.1.1 or 3.1.2+ (protocol name "MQTT", level 4 or 5)
- Reconfigure the client's protocol name/level (e.g. Paho: set MQTT_VERSION to 3_1_1 or 5)
- If the device cannot be updated, place a protocol-translating bridge in front of the broker
- Confirm the emitted CONNECT bytes: protoName must be "MQTT" not "MQIsdp"
Example fix
// before opts := mqtt.NewClientOptions().SetProtocolVersion(3) // MQIsdp // after opts := mqtt.NewClientOptions().SetProtocolVersion(4) // MQTT 3.1.1
Defensive patterns
Strategy: validation
Validate before calling
// Validate protocol name/version before connecting (client side)
if (opts.protocolVersion === 3 || opts.protocolName === 'MQIsdp') {
throw new Error('MQTT 3.1 (MQIsdp) is not supported; use protocol level 4 or 5')
} Type guard
function isSupportedMqttVersion(opts) {
return opts.protocolVersion === 4 || opts.protocolVersion === 5
} Prevention
- Always configure clients to MQTT 3.1.1 (level 4) or 5
- Audit legacy device firmware for MQIsdp defaults
- Test CONNECT packets with a proxy/sniffer when onboarding old devices
- Bridge legacy clients through a translating proxy if they cannot be upgraded
When it happens
Trigger: A client sends a CONNECT with protocol name "MQIsdp" (MQTT v3.1) — e.g. a very old client library or device firmware configured for protocol level 3.1 / protocol name MQIsdp.
Common situations: Legacy embedded devices or ancient Paho versions defaulting to MQIsdp; misconfigured client library set to MQTT 3.1 instead of 3.1.1/3.1.2+; hardware firmware that predates MQTT 3.1.1.
Related errors
- topic filter cannot be empty
- malformed variable int
- received a second CONNECT packet
- connect flags reserved bit not set to 0
- if Will flag is set to 0, Will Retain flag must be 0 too
AI-assisted analysis of nats-io/nats-server@3a66a489d2 (2026-09-02).
Data as JSON: /api/errors/776a20a6aa4b760b.
Report an issue: GitHub.