{"record":{"id":"f00714961bcfc168","repo":"apache/cassandra","slug":"unsupported-compression-type","errorCode":null,"errorMessage":"Unsupported compression type: ","messagePattern":"Unsupported compression type: ","errorType":"exception","errorClass":"ProtocolException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/transport/PipelineConfigurator.java","lineNumber":393,"sourceCode":"    }\n\n    protected CQLMessageHandler.MessageConsumer<Message.Request> messageConsumer()\n    {\n        return dispatcher;\n    }\n\n    protected Message.Decoder<Message.Request> messageDecoder()\n    {\n        return Message.requestDecoder();\n    }\n\n    protected FrameDecoder frameDecoder(String compression, BufferPoolAllocator allocator)\n    {\n        if (null == compression)\n            return FrameDecoderCrc.create(allocator);\n        if (compression.equalsIgnoreCase(\"LZ4\"))\n            return FrameDecoderLZ4.fast(allocator);\n        throw new ProtocolException(\"Unsupported compression type: \" + compression);\n    }\n\n    protected FrameEncoder frameEncoder(String compression)\n    {\n        if (Strings.isNullOrEmpty(compression))\n            return FrameEncoderCrc.instance;\n        if (compression.equalsIgnoreCase(\"LZ4\"))\n            return FrameEncoderLZ4.fastInstance;\n        throw new ProtocolException(\"Unsupported compression type: \" + compression);\n    }\n\n    public void configureLegacyPipeline(ChannelHandlerContext ctx, ClientResourceLimits.Allocator limits)\n    {\n        ChannelPipeline pipeline = ctx.channel().pipeline();\n        pipeline.addBefore(ENVELOPE_ENCODER, ENVELOPE_DECODER, new Envelope.Decoder());\n        pipeline.addBefore(INITIAL_HANDLER, MESSAGE_DECOMPRESSOR, Envelope.Decompressor.instance);\n        pipeline.addBefore(INITIAL_HANDLER, MESSAGE_COMPRESSOR, Envelope.Compressor.instance);\n        pipeline.addBefore(INITIAL_HANDLER, MESSAGE_DECODER, PreV5Handlers.ProtocolDecoder.instance);","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/transport/PipelineConfigurator.java#L375-L411","documentation":"ProtocolException thrown when the frame decoder is asked to handle a compression algorithm it does not support. Only null (no compression, CRC-protected framing) and 'lz4' (case-insensitive) are accepted in the modern (v5+) frame pipeline; any other string is rejected. This surfaces the configured compression name from the STARTUP message or config straight into a hard protocol error.","triggerScenarios":"A client sends a STARTUP message (or the endpoint is configured) with a COMPRESSION option set to something other than ''/null or 'lz4' — e.g. 'snappy' on a v5+ connection using the new frame decoder path.","commonSituations":"Drivers configured with snappy compression against a v5+ endpoint, typo'd compression names ('Lz4 ', 'zstd'), or templates carrying settings from other systems.","solutions":["Set the client's compression option to 'lz4' or disable compression (null) for protocol v5+ connections.","If snappy is required, keep the connection on protocol v4 or lower where the legacy envelope path applies.","Correct typos in the compression option value (it is compared case-insensitively but must still be exactly 'lz4').","Upgrade the driver if it advertises an unsupported default compression for v5."],"exampleFix":"// before\ncluster.withCompression(Compression.SNAPPY).withProtocolVersion(ProtocolVersion.V5);\n// after\ncluster.withCompression(Compression.LZ4).withProtocolVersion(ProtocolVersion.V5);","handlingStrategy":"validation","validationCode":"// client-side guard before configuring compression\nString c = compressionName.toLowerCase();\nif (protocolVersion.isGreaterOrEqualTo(ProtocolVersion.V5) && !(c.isEmpty() || c.equals(\"lz4\")))\n    throw new IllegalArgumentException(\"Only null or lz4 supported for v5+ frames\");","typeGuard":null,"tryCatchPattern":"try { session.init(); } catch (ProtocolException e) { if (e.getMessage().startsWith(\"Unsupported compression\")) { fallbackToLz4OrNone(); } }","preventionTips":["Use lz4 or no compression with modern protocol versions","Avoid snappy on v5+ connections","Validate the compression option string before connect"],"tags":["cassandra","compression","native-protocol"],"backgroundTag":"invalid-argument-value","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"}