apache/cassandra · error · ProtocolException

This instance does not support Snappy compression

Error message

This instance does not support Snappy compression

What it means

Cassandra throws this ProtocolException during native-protocol handshake when a client requests Snappy frame compression but the SnappyCompressor singleton is null, meaning the Snappy native library was not available at JVM startup. Cassandra loads Snappy via org.xerial.snappy; if the bundled native library cannot load (missing libsnappy, unsupported platform/arch), the compressor instance is never created and Snappy cannot be offered.

Solutions

  1. Change the client driver's compression setting to lz4 or none and reconnect
  2. Install the Snappy native library (e.g. apt-get install libsnappy1 / yum install snappy) and restart Cassandra so SnappyCompressor.instance loads
  3. Verify the platform/architecture is supported by the bundled xerial snappy-jar and use a matching JDK/JVM
  4. Check logs at startup for snappy load errors and confirm cassandra-env/jvm options are not disabling compression

Example fix

// before (driver config)
cluster.compression = 'snappy'
// after
cluster.compression = 'lz4'
Defensive patterns

Strategy: validation

Validate before calling

// client-side: verify server supports snappy before enabling
cluster.metadata.checkCompatibility();
// prefer probing: connect with compression none, read server release, only set snappy for Cassandra 3.x/4.x on supported platforms
typeGuard: null

Try / catch

try { session = cluster.build(); } catch (NoNodeAvailableException e) { /* fall back to compression none or lz4 */ }

Prevention

When it happens

Trigger: A CQL/native-protocol client sends a STARTUP message with COMPRESSION=snappy (lowercased) while Compressor.SnappyCompressor.instance is null because the Snappy native library failed to load on this node (e.g. missing OS package, unsupported architecture, or a build without snappy support).

Common situations: Client drivers configured with snappy compression (common default in some drivers) connecting to a node where libsnappy is absent; running Cassandra on unusual platforms (ARM, Alpine) where the bundled snappy native binding cannot load; minimal container images without required native libraries.

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


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

Appendix: source

Thrown at src/java/org/apache/cassandra/transport/messages/StartupMessage.java:106

            throw new ProtocolException("Missing value CQL_VERSION in STARTUP message");

        try
        {
            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)));

View on GitHub (pinned to 88fd0f6a0e)