{"record":{"id":"e9e82daf713d4d38","repo":"apache/cassandra","slug":"this-instance-does-not-support-snappy-compression","errorCode":null,"errorMessage":"This instance does not support Snappy compression","messagePattern":"This instance does not support Snappy compression","errorType":"exception","errorClass":"ProtocolException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/transport/messages/StartupMessage.java","lineNumber":106,"sourceCode":"            throw new ProtocolException(\"Missing value CQL_VERSION in STARTUP message\");\n\n        try\n        {\n            if (new CassandraVersion(cqlVersion).compareTo(new CassandraVersion(\"2.99.0\")) < 0)\n                throw new ProtocolException(String.format(\"CQL version %s is not supported by the binary protocol (supported version are >= 3.0.0)\", cqlVersion));\n        }\n        catch (IllegalArgumentException e)\n        {\n            throw new ProtocolException(e.getMessage());\n        }\n\n        if (options.containsKey(COMPRESSION))\n        {\n            String compression = toLowerCaseLocalized(options.get(COMPRESSION));\n            if (compression.equals(\"snappy\"))\n            {\n                if (Compressor.SnappyCompressor.instance == null)\n                    throw new ProtocolException(\"This instance does not support Snappy compression\");\n\n                if (getSource().header.version.isGreaterOrEqualTo(ProtocolVersion.V5))\n                    throw new ProtocolException(\"Snappy compression is not supported in protocol V5\");\n\n                connection.setCompressor(Compressor.SnappyCompressor.instance);\n            }\n            else if (compression.equals(\"lz4\"))\n            {\n                connection.setCompressor(Compressor.LZ4Compressor.instance);\n            }\n            else\n            {\n                throw new ProtocolException(String.format(\"Unknown compression algorithm: %s\", compression));\n            }\n        }\n\n        connection.setThrowOnOverload(\"1\".equals(options.get(THROW_ON_OVERLOAD)));\n","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/transport/messages/StartupMessage.java#L88-L124","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Change the client driver's compression setting to lz4 or none and reconnect","Install the Snappy native library (e.g. apt-get install libsnappy1 / yum install snappy) and restart Cassandra so SnappyCompressor.instance loads","Verify the platform/architecture is supported by the bundled xerial snappy-jar and use a matching JDK/JVM","Check logs at startup for snappy load errors and confirm cassandra-env/jvm options are not disabling compression"],"exampleFix":"// before (driver config)\ncluster.compression = 'snappy'\n// after\ncluster.compression = 'lz4'","handlingStrategy":"validation","validationCode":"// client-side: verify server supports snappy before enabling\ncluster.metadata.checkCompatibility();\n// prefer probing: connect with compression none, read server release, only set snappy for Cassandra 3.x/4.x on supported platforms\ntypeGuard: null","typeGuard":null,"tryCatchPattern":"try { session = cluster.build(); } catch (NoNodeAvailableException e) { /* fall back to compression none or lz4 */ }","preventionTips":["Default driver compression to lz4, not snappy","Verify native library availability on the target platform before enabling snappy","Test compression settings against the actual deployment image/container"],"tags":["protocol","compression","native-library","client-connection"],"backgroundTag":"unsupported-operation","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"}