apache/cassandra · error · ProtocolException
Snappy compression is not supported in protocol V5
Error message
Snappy compression is not supported in protocol V5
What it means
Starting with native protocol V5, Cassandra no longer allows Snappy compression; only lz4 is supported. If a client negotiates protocol V5 (or higher) and sends STARTUP with COMPRESSION=snappy, this ProtocolException is thrown and the connection is rejected.
Solutions
- Switch the client driver's compression to lz4
- Force the driver to use protocol V4 if Snappy must be kept (set protocol version explicitly in the driver config)
- Upgrade driver settings to the recommended lz4 compression for Cassandra 4+
Example fix
// before (driver config) compression: 'snappy' // after compression: 'lz4'
Defensive patterns
Strategy: validation
Validate before calling
// Only set snappy when the cluster supports protocol V4 if (serverProtocolVersion < ProtocolVersion.V5) cluster.compression = 'snappy'; else cluster.compression = 'lz4';
Try / catch
catch (protocol errors on connect) and retry with lz4 compression
Prevention
- Use lz4 for all Cassandra 4+ clients
- Do not pin snappy in driver configs when protocol V5+ is negotiated
- Check driver protocol version defaults after upgrades
When it happens
Trigger: Client driver configured with snappy compression AND connecting with native protocol version >= V5 (default in recent drivers connecting to Cassandra 4+).
Common situations: Upgrading Cassandra to 4.x+ where V5 is the default protocol version while the driver still has legacy snappy compression configured; driver version pinned to V5+ against a snappy-configured client; mixed fleet where older nodes accepted snappy on V4 but newer ones reject it.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- This instance does not support Snappy compression
- Invalid uncompressed frame length
- Provided frame does not appear to be LZ4 compressed
- Provided frame does not appear to be Snappy compressed
- Unknown compression algorithm
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/27c995ee215e3e6c.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/transport/messages/StartupMessage.java:109
{
if (new CassandraVersion(cqlVersion).compareTo(new CassandraVersion("2.99.0")) < 0)
throw new ProtocolException(String.format("CQL version %s is not supported by the binary protocol (supported version are >= 3.0.0)", cqlVersion));
}
catch (IllegalArgumentException e)
{
throw new ProtocolException(e.getMessage());
}
if (options.containsKey(COMPRESSION))
{
String compression = toLowerCaseLocalized(options.get(COMPRESSION));
if (compression.equals("snappy"))
{
if (Compressor.SnappyCompressor.instance == null)
throw new ProtocolException("This instance does not support Snappy compression");
if (getSource().header.version.isGreaterOrEqualTo(ProtocolVersion.V5))
throw new ProtocolException("Snappy compression is not supported in protocol V5");
connection.setCompressor(Compressor.SnappyCompressor.instance);
}
else if (compression.equals("lz4"))
{
connection.setCompressor(Compressor.LZ4Compressor.instance);
}
else
{
throw new ProtocolException(String.format("Unknown compression algorithm: %s", compression));
}
}
connection.setThrowOnOverload("1".equals(options.get(THROW_ON_OVERLOAD)));
ClientState clientState = state.getClientState();
clientState.setClientOptions(options);
String driverName = options.get(DRIVER_NAME);View on GitHub (pinned to 88fd0f6a0e)