{"record":{"id":"f632d0466ff256ec","repo":"apache/cassandra","slug":"failed-to-initialize-compression-provider-s","errorCode":null,"errorMessage":"Failed to initialize compression provider %s","messagePattern":"Failed to initialize compression provider (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/io/compress/CompressorRegistry.java","lineNumber":303,"sourceCode":"            }\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":285,"sourceCodeEnd":306,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/compress/CompressorRegistry.java#L285-L306","documentation":"When a custom compression provider fails to initialize or reports isHealthy()==false, Cassandra falls back to DefaultCompressionProvider — unless the provider config sets fail_on_missing_provider=true. In that strict mode the fallback is disabled and resolveProvider() throws this ConfigurationException instead, aborting startup/registration.","triggerScenarios":"resolveProvider() called with a provider whose class cannot be loaded/instantiated, whose init() throws, or whose isHealthy() returns false, while the provider parameters contain fail_on_missing_provider=true (or FAIL_ON_MISSING_PROVIDER set truthy).","commonSituations":"Production setups that must not silently fall back from a hardware-accelerated provider to the software default; misconfigured provider class_name or provider init parameters (e.g. missing native library) combined with strict fail-on-missing mode.","solutions":["Fix the underlying provider failure: check the preceding WARN log ('Failed to initialize specified compression provider') for the root cause (class not found, init exception, unhealthy).","Set fail_on_missing_provider=false (or remove it) in the provider's parameters to allow fallback to DefaultCompressionProvider.","Correct the class_name to a loadable AbstractCompressionProvider implementation on the classpath.","If the provider requires external resources (native libs, services), install/verify them before starting Cassandra."],"exampleFix":"// before\ncassandra.yaml: compressor_providers: { LZ4: { class_name: com.example.FastProvider, parameters: { fail_on_missing_provider: true } } }\n// after\ncassandra.yaml: compressor_providers: { LZ4: { class_name: com.example.FastProvider, parameters: { fail_on_missing_provider: false } } }","handlingStrategy":"try-catch","validationCode":"ParameterizedClass pc = ...;\nboolean strict = Boolean.parseBoolean(pc.parameters.getOrDefault(\"fail_on_missing_provider\", \"false\"));\ntry { Class.forName(pc.class_name); } catch (ClassNotFoundException e) { if (strict) throw e; else log.warn(\"Provider missing, default will be used\"); }","typeGuard":null,"tryCatchPattern":"try {\n    registry.registerProviders(providers);\n} catch (ConfigurationException e) {\n    if (e.getMessage().startsWith(\"Failed to initialize compression provider\")) {\n        log.warn(\"Falling back to default compression provider\");\n    } else throw e;\n}","preventionTips":["Set fail_on_missing_provider=false unless silent fallback is unacceptable","Pre-verify the provider class exists on the classpath before startup (Class.forName smoke test)","Confirm provider init() dependencies (native libs, services) are present in the deployment image","Watch for the preceding WARN log line to find the real init failure"],"tags":["configuration","compression","startup"],"backgroundTag":"missing-dependency","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"}