{"record":{"id":"955f7bcbe659a515","repo":"apache/cassandra","slug":"unsupported-compressor","errorCode":null,"errorMessage":"Unsupported compressor: ","messagePattern":"Unsupported compressor: ","errorType":"exception","errorClass":"ProtocolException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/transport/SimpleClient.java","lineNumber":619,"sourceCode":"                        flusher.enqueue(message.encode(version, outboundStreamId(message)));\n\n                    flusher.maybeWrite(ctx, promise);\n                }\n            });\n            pipeline.remove(this);\n\n            Message.Response message = messageDecoder.decode(ctx.channel(), request);\n            responseConsumer.dispatch(channel, message, (p, ch, req, resp) -> null, null, Overload.NONE);\n        }\n\n        private FrameDecoder frameDecoder(ChannelHandlerContext ctx, BufferPoolAllocator allocator)\n        {\n            Connection conn = ctx.channel().attr(Connection.attributeKey).get();\n            if (conn.getCompressor() == null)\n                return FrameDecoderCrc.create(allocator);\n            if (conn.getCompressor() instanceof Compressor.LZ4Compressor)\n                return FrameDecoderLZ4.fast(allocator);\n            throw new ProtocolException(\"Unsupported compressor: \" + conn.getCompressor().getClass().getCanonicalName());\n        }\n\n        private FrameEncoder frameEncoder(ChannelHandlerContext ctx)\n        {\n            Connection conn = ctx.channel().attr(Connection.attributeKey).get();\n            if (conn.getCompressor() == null)\n                return FrameEncoderCrc.instance;\n            if (conn.getCompressor() instanceof Compressor.LZ4Compressor)\n                return FrameEncoderLZ4.fastInstance;\n            throw new ProtocolException(\"Unsupported compressor: \" + conn.getCompressor().getClass().getCanonicalName());\n        }\n\n        private void configureLegacyPipeline(ChannelHandlerContext ctx)\n        {\n            logger.info(\"Configuring legacy pipeline\");\n            ChannelPipeline pipeline = ctx.pipeline();\n            pipeline.remove(this);\n            pipeline.addAfter(HandlerNames.ENVELOPE_ENCODER, HandlerNames.DECOMPRESSOR, Envelope.Decompressor.instance);","sourceCodeStart":601,"sourceCodeEnd":637,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/transport/SimpleClient.java#L601-L637","documentation":"InitialHandler.frameDecoder() selects the inbound FrameDecoder based on the connection's compressor; only null (none) and LZ4 are supported. If the negotiated compressor is anything else (e.g. Snappy configured via StartupOptions), it throws ProtocolException(\"Unsupported compressor: <class>\").","triggerScenarios":"Client sets COMPRESSION=snappy (or another algorithm) in STARTUP options against SimpleClient, whose frameDecoder only implements no-compression and LZ4.","commonSituations":"Copying client options that specify snappy compression (common with drivers) into the simple test client; mismatch between server-accepted compression and what the test client's pipeline can decode.","solutions":["Use COMPRESSION=lz4 in the client's startup options instead of snappy.","Omit compression entirely (no COMPRESSION option) when using SimpleClient.","If snappy is required, add a FrameDecoderSnappy branch to frameDecoder() mirroring the LZ4 path.","Prefer the official java driver, which supports snappy natively."],"exampleFix":"// before\noptions.put(StartupOptions.COMPRESSION, \"snappy\");\n// after\noptions.put(StartupOptions.COMPRESSION, \"lz4\");","handlingStrategy":"validation","validationCode":"String comp = startupOptions.get(StartupOptions.COMPRESSION);\nif (comp != null && !\"lz4\".equalsIgnoreCase(comp))\n    throw new IllegalArgumentException(\"SimpleClient supports only lz4 or no compression, got: \" + comp);","typeGuard":null,"tryCatchPattern":"try { connect(); } catch (ProtocolException e) { if (e.getMessage().startsWith(\"Unsupported compressor\")) { disableCompression(); reconnect(); } }","preventionTips":["Use only lz4 or no compression with SimpleClient","Don't copy driver connection options (snappy) into the test client","Switch to the java driver for snappy support"],"tags":["compression","snappy","lz4","native-protocol"],"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"}