apache/cassandra · error · ProtocolException

Rejecting Protocol Version

Error message

Rejecting Protocol Version %s < %s.

What it means

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.

Solutions

  1. Upgrade the client driver or set its protocol version to >= ProtocolVersion.CURRENT
  2. Re-enable older protocol versions in server config if legacy clients must be supported temporarily
  3. Check cassandra.yaml / system properties controlling native protocol min/max version on the server
  4. Audit which clients still use old versions via logs before raising the version floor

Example fix

// before
Cluster.builder().withProtocolVersion(ProtocolVersion.V3).build();
// after
Cluster.builder().withProtocolVersion(ProtocolVersion.V4).build();
Defensive patterns

Strategy: validation

Validate before calling

if (clientProtocolVersion < minSupportedServerProtocol)
    throw new IllegalArgumentException("protocol v" + clientProtocolVersion + " rejected; use >= " + minSupportedServerProtocol);

Type guard

boolean allowedOlder(ProtocolVersion v, boolean allowOlderProtocols) { return allowOlderProtocols || !v.isSmallerThan(ProtocolVersion.CURRENT); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/c261ba735784a047. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/transport/ProtocolVersion.java:131

            for (ProtocolVersion version : UNSUPPORTED)
            {
                // if it is an old version that is no longer supported this ensures that we respond
                // with that same version
                if (version.num == versionNum)
                    throw new ProtocolException(ProtocolVersion.invalidVersionMessage(versionNum), version);
            }
            for (int dseVersion : KNOWN_INVALID_VERSIONS)
            {
                if (versionNum == dseVersion)
                    throw ProtocolException.toSilentException(new ProtocolException(ProtocolVersion.invalidVersionMessage(versionNum)));
            }

            // If the version is invalid reply with the channel's version
            throw new ProtocolException(invalidVersionMessage(versionNum));
        }

        if (!allowOlderProtocols && ret.isSmallerThan(CURRENT))
            throw new ProtocolException(String.format("Rejecting Protocol Version %s < %s.", ret, ProtocolVersion.CURRENT));

        return ret;
    }

    public boolean isBeta()
    {
        return beta;
    }

    public static String invalidVersionMessage(int version)
    {
        return String.format("Invalid or unsupported protocol version (%d); supported versions are (%s)",
                             version, String.join(", ", ProtocolVersion.supportedVersions()));
    }

    public int asInt()
    {
        return num;

View on GitHub (pinned to 88fd0f6a0e)