{"record":{"id":"ba220020fd9b11ca","repo":"apache/cassandra","slug":"failed-to-initialize-specified-compression-provide","errorCode":null,"errorMessage":"Failed to initialize specified compression provider {}. Will attempt fallback to default if enabled.","messagePattern":"Failed to initialize specified compression provider (.+?)\\. Will attempt fallback to default if enabled\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/io/compress/CompressorRegistry.java","lineNumber":293,"sourceCode":"        Map<String, String> p = providerConfig.parameters == null ? Collections.emptyMap() : providerConfig.parameters;\n\n        try\n        {\n            AbstractCompressionProvider compressionProvider = FBUtilities.newCompressionProvider(providerConfig.class_name);\n            compressionProvider.init(new HashMap<>(p));\n\n            if (compressionProvider.isHealthy())\n            {\n                return compressionProvider;\n            }\n            else\n            {\n                logger.warn(\"Compression provider {} is not healthy, attempting fallback.\", providerConfig.class_name);\n            }\n        }\n        catch (Throwable e)\n        {\n            logger.warn(\"Failed to initialize specified compression provider {}. Will attempt fallback to default if enabled.\",\n                        providerConfig.class_name,\n                        e);\n        }\n\n        boolean failOnMissingProvider = Boolean.parseBoolean(p.getOrDefault(FAIL_ON_MISSING_PROVIDER, Boolean.FALSE.toString()));\n\n        if (!failOnMissingProvider)\n            return DEFAULT_COMPRESSION_PROVIDER;\n\n        throw new ConfigurationException(\"Failed to initialize compression provider \" + providerConfig);\n    }\n}\n","sourceCodeStart":275,"sourceCodeEnd":306,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/compress/CompressorRegistry.java#L275-L306","documentation":"resolveProvider wraps provider initialization in a catch-all (Throwable) and logs this warning when instantiating the configured compression provider throws. It then continues attempting fallback to the default provider if enabled. The root cause and stack trace are attached to this log entry.","triggerScenarios":"Class.forName/instantiation of the configured compressor class throws — class missing from classpath, constructor exception, or isHealthy() itself throwing during resolution of the compression_options class_name.","commonSituations":"Typo in the compression class name in compression options; custom compressor jar not on the classpath; plugin constructor throwing due to missing config (e.g. chunk length incompatibility); upgrading Cassandra to a version where a previously available compressor class was removed.","solutions":["Read the attached exception in the log to identify the root init failure","Correct the 'class' value in the table's compression options to a valid compressor (e.g. LZ4Compressor, SnappyCompressor, DeflateCompressor)","Ensure any custom compressor JAR is on the Cassandra classpath (lib/ or via a supported plugin mechanism)","Set FAIL_ON_MISSING_PROVIDER appropriately if you want hard failure instead of silent fallback"],"exampleFix":"// before (schema)\ncompression = {'class': 'ZstdCompressor'}\n// after\ncompression = {'class': 'org.apache.cassandra.io.compress.ZstdCompressor', 'chunk_length_in_kb': '16'}","handlingStrategy":"validation","validationCode":"// Validate the class name before applying compression options:\ntry { Class.forName(className, false, Compressor.class.getClassLoader()); }\ncatch (ClassNotFoundException e) { throw new IllegalArgumentException(\"Unknown compressor: \" + className); }","typeGuard":null,"tryCatchPattern":"try { applyCompressionOptions(opts); } catch (Throwable t) { log.error(\"bad compressor class {}\", opts.get(\"class\"), t); }","preventionTips":["Always use fully-qualified compressor class names from the official list","Ship custom compressor jars with the node and verify classpath before schema changes","Test compression settings in staging before production ALTERs"],"tags":["compression","classpath","init-failure"],"backgroundTag":"module-init-failed","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"}