{"record":{"id":"776a20a6aa4b760b","repo":"nats-io/nats-server","slug":"older-protocol-q-not-supported","errorCode":null,"errorMessage":"older protocol %q not supported","messagePattern":"older protocol %q not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/mqtt.go","lineNumber":3798,"sourceCode":"//////////////////////////////////////////////////////////////////////////////\n//\n// CONNECT protocol related functions\n//\n//////////////////////////////////////////////////////////////////////////////\n\n// Parse the MQTT connect protocol\nfunc (c *client) mqttParseConnect(r *mqttReader, hasMappings bool) (byte, *mqttConnectProto, error) {\n\t// Protocol name\n\tproto, err := r.readBytes(\"protocol name\", false)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\t// Spec [MQTT-3.1.2-1]\n\tif !bytes.Equal(proto, mqttProtoName) {\n\t\t// Check proto name against v3.1 to report better error\n\t\tif bytes.Equal(proto, mqttOldProtoName) {\n\t\t\treturn 0, nil, fmt.Errorf(\"older protocol %q not supported\", proto)\n\t\t}\n\t\treturn 0, nil, fmt.Errorf(\"expected connect packet with protocol name %q, got %q\", mqttProtoName, proto)\n\t}\n\n\t// Protocol level\n\tlevel, err := r.readByte(\"protocol level\")\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\t// Spec [MQTT-3.1.2-2]\n\tif level != mqttProtoLevel {\n\t\treturn mqttConnAckRCUnacceptableProtocolVersion, nil, fmt.Errorf(\"unacceptable protocol version of %v\", level)\n\t}\n\n\tcp := &mqttConnectProto{}\n\t// Connect flags\n\tcp.flags, err = r.readByte(\"flags\")\n\tif err != nil {","sourceCodeStart":3780,"sourceCodeEnd":3816,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/mqtt.go#L3780-L3816","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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\""],"exampleFix":"// before\nopts := mqtt.NewClientOptions().SetProtocolVersion(3) // MQIsdp\n// after\nopts := mqtt.NewClientOptions().SetProtocolVersion(4) // MQTT 3.1.1\n","handlingStrategy":"validation","validationCode":"// Validate protocol name/version before connecting (client side)\nif (opts.protocolVersion === 3 || opts.protocolName === 'MQIsdp') {\n  throw new Error('MQTT 3.1 (MQIsdp) is not supported; use protocol level 4 or 5')\n}","typeGuard":"function isSupportedMqttVersion(opts) {\n  return opts.protocolVersion === 4 || opts.protocolVersion === 5\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["mqtt","protocol","compatibility"],"backgroundTag":"unsupported-mqtt-protocol-version","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}