{"record":{"id":"c261ba735784a047","repo":"apache/cassandra","slug":"rejecting-protocol-version-s-s","errorCode":null,"errorMessage":"Rejecting Protocol Version %s < %s.","messagePattern":"Rejecting Protocol Version (.+?) < (.+?)\\.","errorType":"exception","errorClass":"ProtocolException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/transport/ProtocolVersion.java","lineNumber":131,"sourceCode":"            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()\n    {\n        return beta;\n    }\n\n    public static String invalidVersionMessage(int version)\n    {\n        return String.format(\"Invalid or unsupported protocol version (%d); supported versions are (%s)\",\n                             version, String.join(\", \", ProtocolVersion.supportedVersions()));\n    }\n\n    public int asInt()\n    {\n        return num;","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/transport/ProtocolVersion.java#L113-L149","documentation":"Thrown when a client requests a valid but older protocol version while the server is configured to disallow downgrades (allowOlderProtocols is false). The version itself is recognized, but decode() rejects it because it is smaller than the current protocol version (CURRENT). This enforces a minimum protocol version floor on the connection.","triggerScenarios":"A client sends a frame with a valid but deprecated protocol version (e.g. v1/v2/v3) while this server channel requires >= ProtocolVersion.CURRENT; decode() is called with allowOlderProtocols=false and ret.isSmallerThan(CURRENT) is true.","commonSituations":"Legacy drivers pinned to old protocol versions, ops teams hardening clusters by disabling old protocol versions (native_transport_protocol versions settings), or clients reconnecting with cached old-version connections after a server upgrade.","solutions":["Upgrade the client driver or set its protocol version to >= ProtocolVersion.CURRENT","Re-enable older protocol versions in server config if legacy clients must be supported temporarily","Check cassandra.yaml / system properties controlling native protocol min/max version on the server","Audit which clients still use old versions via logs before raising the version floor"],"exampleFix":"// before\nCluster.builder().withProtocolVersion(ProtocolVersion.V3).build();\n// after\nCluster.builder().withProtocolVersion(ProtocolVersion.V4).build();","handlingStrategy":"validation","validationCode":"if (clientProtocolVersion < minSupportedServerProtocol)\n    throw new IllegalArgumentException(\"protocol v\" + clientProtocolVersion + \" rejected; use >= \" + minSupportedServerProtocol);","typeGuard":"boolean allowedOlder(ProtocolVersion v, boolean allowOlderProtocols) { return allowOlderProtocols || !v.isSmallerThan(ProtocolVersion.CURRENT); }","tryCatchPattern":null,"preventionTips":["Before lowering max/min protocol versions on the server, inventory all clients' protocol versions","Set driver protocol version explicitly rather than relying on deprecated defaults","Plan client upgrades before server hardening changes","Alert on old-version connection attempts in server logs"],"tags":["cql-protocol","version-mismatch","deprecated"],"backgroundTag":"unsupported-protocol-version","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}