{"record":{"id":"ddec773252606413","repo":"apache/cassandra","slug":"invalid-or-unsupported-protocol-version-d-supp","errorCode":null,"errorMessage":"Invalid or unsupported protocol version (%d); supported versions are (%s)","messagePattern":"Invalid or unsupported protocol version \\((.+?)\\); supported versions are \\((.+?)\\)","errorType":"exception","errorClass":"ProtocolException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/transport/ProtocolVersion.java","lineNumber":118,"sourceCode":"                versions.add(version);\n        return versions;\n    }\n\n    public static ProtocolVersion decode(int versionNum, boolean allowOlderProtocols)\n    {\n        ProtocolVersion ret = versionNum >= MIN_SUPPORTED_VERSION.num && versionNum <= MAX_SUPPORTED_VERSION.num\n                              ? SUPPORTED_VERSIONS[versionNum - MIN_SUPPORTED_VERSION.num]\n                              : null;\n\n        if (ret == null)\n        {\n            // if this is not a supported version check the old versions\n            for (ProtocolVersion version : UNSUPPORTED)\n            {\n                // if it is an old version that is no longer supported this ensures that we respond\n                // with that same version\n                if (version.num == versionNum)\n                    throw new ProtocolException(ProtocolVersion.invalidVersionMessage(versionNum), version);\n            }\n            for (int dseVersion : KNOWN_INVALID_VERSIONS)\n            {\n                if (versionNum == dseVersion)\n                    throw ProtocolException.toSilentException(new ProtocolException(ProtocolVersion.invalidVersionMessage(versionNum)));\n            }\n\n            // If the version is invalid reply with the channel's version\n            throw new ProtocolException(invalidVersionMessage(versionNum));\n        }\n\n        if (!allowOlderProtocols && ret.isSmallerThan(CURRENT))\n            throw new ProtocolException(String.format(\"Rejecting Protocol Version %s < %s.\", ret, ProtocolVersion.CURRENT));\n\n        return ret;\n    }\n\n    public boolean isBeta()","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/transport/ProtocolVersion.java#L100-L136","documentation":"ProtocolException (possibly wrapped as a silent exception) raised by ProtocolVersion.decode when the incoming frame's version number is not a supported version. It first checks historically known but now-unsupported versions so it can respond using that same old version (letting old drivers understand the error), and separately recognizes known-invalid DSE version numbers, producing a silent exception that is not logged. The message enumerates the supported versions so clients can self-correct.","triggerScenarios":"A client connects with a version byte that is neither in the SUPPORTED list nor matched to UNSUPPORTED/KNOWN_INVALID_VERSIONS handling — e.g. version 0, negative, or a too-new speculative version; or connects with a recognized-but-unsupported legacy version (v1/v2), which yields the versioned exception.","commonSituations":"Very old drivers speaking protocol v1/v2 against a server that dropped those versions, clients built against unreleased protocol versions, corrupted version bytes, or DSE-flavored clients hitting OSS Cassandra.","solutions":["Upgrade the client driver so it negotiates a supported native protocol version (see the versions listed in the error message).","Explicitly configure the driver to a supported protocolVersion (e.g. v3, v4, v5).","If forced to keep an old driver, upgrade the server to a version that still supports the legacy protocol, or proxy via a compatible shim.","Inspect the client's version byte / negotiated version config to ensure it is not 0 or a nonstandard value."],"exampleFix":"// before: driver pinned to unsupported legacy protocol\nCluster.builder().withProtocolVersion(ProtocolVersion.V2).build();\n// after: pin to a supported version\nCluster.builder().withProtocolVersion(ProtocolVersion.V4).build();","handlingStrategy":"try-catch","validationCode":"// pick the highest version both sides advertise\nProtocolVersion v = min(highestServerSupported, highestDriverSupported);","typeGuard":null,"tryCatchPattern":"try { connect(); } catch (ProtocolException e) {\n  if (e.getMessage().startsWith(\"Invalid or unsupported protocol version\")) {\n    // retry with a version parsed from the supported list in the message\n    connectWithVersion(parseSupportedVersions(e.getMessage()));\n  }\n}","preventionTips":["Keep drivers within a supported protocol range; upgrade very old clients (v1/v2)","Let the driver negotiate automatically rather than pinning versions","Check for DSE-vs-OSS mismatches when connecting across distributions"],"tags":["cassandra","native-protocol","version-compatibility"],"backgroundTag":"unsupported-version","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}