apache/cassandra · warning

Failed to initialize specified compression provider

Error message

Failed to initialize specified compression provider {}. Will attempt fallback to default if enabled.

What it means

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.

Solutions

  1. Read the attached exception in the log to identify the root init failure
  2. Correct the 'class' value in the table's compression options to a valid compressor (e.g. LZ4Compressor, SnappyCompressor, DeflateCompressor)
  3. Ensure any custom compressor JAR is on the Cassandra classpath (lib/ or via a supported plugin mechanism)
  4. Set FAIL_ON_MISSING_PROVIDER appropriately if you want hard failure instead of silent fallback

Example fix

// before (schema)
compression = {'class': 'ZstdCompressor'}
// after
compression = {'class': 'org.apache.cassandra.io.compress.ZstdCompressor', 'chunk_length_in_kb': '16'}
Defensive patterns

Strategy: validation

Validate before calling

// Validate the class name before applying compression options:
try { Class.forName(className, false, Compressor.class.getClassLoader()); }
catch (ClassNotFoundException e) { throw new IllegalArgumentException("Unknown compressor: " + className); }

Try / catch

try { applyCompressionOptions(opts); } catch (Throwable t) { log.error("bad compressor class {}", opts.get("class"), t); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/ba220020fd9b11ca. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/io/compress/CompressorRegistry.java:293

        Map<String, String> p = providerConfig.parameters == null ? Collections.emptyMap() : providerConfig.parameters;

        try
        {
            AbstractCompressionProvider compressionProvider = FBUtilities.newCompressionProvider(providerConfig.class_name);
            compressionProvider.init(new HashMap<>(p));

            if (compressionProvider.isHealthy())
            {
                return compressionProvider;
            }
            else
            {
                logger.warn("Compression provider {} is not healthy, attempting fallback.", providerConfig.class_name);
            }
        }
        catch (Throwable e)
        {
            logger.warn("Failed to initialize specified compression provider {}. Will attempt fallback to default if enabled.",
                        providerConfig.class_name,
                        e);
        }

        boolean failOnMissingProvider = Boolean.parseBoolean(p.getOrDefault(FAIL_ON_MISSING_PROVIDER, Boolean.FALSE.toString()));

        if (!failOnMissingProvider)
            return DEFAULT_COMPRESSION_PROVIDER;

        throw new ConfigurationException("Failed to initialize compression provider " + providerConfig);
    }
}

View on GitHub (pinned to 88fd0f6a0e)