{"record":{"id":"20cef0e1d442dd7b","repo":"apache/cassandra","slug":"cannot-create-compressionparams-for-stored-paramet","errorCode":null,"errorMessage":"Cannot create CompressionParams for stored parameters","messagePattern":"Cannot create CompressionParams for stored parameters","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/io/compress/CompressionMetadata.java","lineNumber":116,"sourceCode":"            int optionCount = stream.readInt();\n            Map<String, String> options = new HashMap<>(optionCount);\n            for (int i = 0; i < optionCount; ++i)\n            {\n                String key = stream.readUTF();\n                String value = stream.readUTF();\n                options.put(key, value);\n            }\n            int chunkLength = stream.readInt();\n            int maxCompressedSize = Integer.MAX_VALUE;\n            if (hasMaxCompressedSize)\n                maxCompressedSize = stream.readInt();\n            try\n            {\n                parameters = new CompressionParams(compressorName, chunkLength, maxCompressedSize, options);\n            }\n            catch (ConfigurationException e)\n            {\n                throw new RuntimeException(\"Cannot create CompressionParams for stored parameters\", e);\n            }\n\n            dataLength = stream.readLong();\n            chunkOffsets = readChunkOffsets(stream);\n            compressionDictionary = CompressionDictionary.deserialize(stream, compressionDictionaryManager);\n        }\n        catch (FileNotFoundException | NoSuchFileException e)\n        {\n            throw new RuntimeException(e);\n        }\n        catch (IOException e)\n        {\n            throw new CorruptSSTableException(e, chunksIndexFile);\n        }\n\n        return new CompressionMetadata(chunksIndexFile, parameters,\n                                       chunkOffsets, chunkOffsets.size(), dataLength,\n                                       compressedLength, compressionDictionary);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java#L98-L134","documentation":"CompressionMetadata.open() reads the stored compression parameters (compressor name, chunk length, options) from the -CompressionInfo.db file and rebuilds a CompressionParams. Because the parameters were persisted earlier, any ConfigurationException (unknown compressor, bad chunk size, invalid option) is rethrown as a RuntimeException noting the parameters came from stored metadata — the file cannot be read even though the schema that wrote it may have changed.","triggerScenarios":"Opening a compressed SSTable whose CompressionInfo.db contains a compressor name not on the classpath/registry, an invalid chunk length, or options incompatible with the current CompressionParams validation.","commonSituations":"Downgrade or rolling upgrade where a newer compressor class is unavailable; SSTables copied from a cluster with custom compression providers; hand-edited or corrupted metadata files; removed custom compressor plugin.","solutions":["Install/register the missing compressor class (custom provider JAR) on this node","Use nodetool scrub or recompress the table (e.g. alter table ... WITH compression + full repair/rewrite) so metadata is regenerated with valid parameters","Fix cassandra.yaml/config so the compressor resolves; if downgrading, first rewrite SSTables with the older compressor","Verify the CompressionInfo.db file is not corrupted by comparing with replicas"],"exampleFix":"// before\nALTER TABLE ks.t WITH compression = {'class': 'CustomCompressor'}; // then copy SSTables to node lacking the class\n// after\nALTER TABLE ks.t WITH compression = {'class': 'LZ4Compressor'};\n// then run a full rewrite (scrub/upgrade-sstables) before moving data between nodes","handlingStrategy":"validation","validationCode":"// Pre-check compressor availability before opening stored metadata\nString name = /* compressorName from CompressionInfo.db */;\nif (!CompressorRegistry.instance.hasCompressor(name))\n    throw new IllegalStateException(\"Compressor not available on this node: \" + name);","typeGuard":null,"tryCatchPattern":"try { CompressionMetadata.open(file, len); }\ncatch (RuntimeException e) { /* msg 'Cannot create CompressionParams...' */ reinstallOrRewriteSSTable(); }","preventionTips":["Keep custom compressor plugins installed identically on all nodes","Rewrite SSTables with the old compressor before downgrading","Avoid hand-editing compression metadata files","Pin compression classes in schema to built-ins when portability matters"],"tags":["compression","sstable","configuration","compatibility"],"backgroundTag":"invalid-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}