apache/cassandra · error · ConfigurationException
Unable to create an instance of the compression service prov
Error message
Unable to create an instance of the compression service provider for %s
What it means
newCompressionProvider reflectively constructs the configured AbstractCompressionProvider used for custom compression implementations. Any construction failure (other than an existing ConfigurationException) is wrapped in a ConfigurationException naming the class. This happens at startup when a custom compression provider is configured.
Source
Thrown at src/java/org/apache/cassandra/utils/FBUtilities.java:760
public static AbstractCompressionProvider newCompressionProvider(String className) throws ConfigurationException
{
try
{
if (!className.contains("."))
className = "org.apache.cassandra.io.compress." + className;
Class<? extends AbstractCompressionProvider> compressionProviderClass =
FBUtilities.classForNameWithoutInitialization(className, "compression service provider", AbstractCompressionProvider.class);
return compressionProviderClass.getConstructor().newInstance();
}
catch (ConfigurationException e)
{
throw e;
}
catch (Exception e)
{
throw new ConfigurationException(String.format("Unable to create an instance of the compression service provider for %s", className), e);
}
}
/**
* Loads and initializes a class.
*
* @return The Class for the given name.
* @param classname Fully qualified classname.
* @param readable Descriptive noun for the role the class plays.
* @throws ConfigurationException If the class cannot be found.
*/
public static <T> Class<T> classForName(String classname, String readable) throws ConfigurationException
{
try
{
return (Class<T>)Class.forName(classname);
}
catch (ClassNotFoundException | NoClassDefFoundError e)View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Correct the provider class name in configuration
- Add the provider jar to lib/ on all nodes and restart
- Verify the class extends AbstractCompressionProvider with a public (Map) constructor
- Check the chained cause for constructor failures
Defensive patterns
Strategy: validation
Validate before calling
try { Class<?> c = Class.forName(className, false, getClass().getClassLoader());
if (!AbstractCompressionProvider.class.isAssignableFrom(c)) throw new IllegalArgumentException("not an AbstractCompressionProvider: " + className); }
catch (ClassNotFoundException e) { throw new IllegalArgumentException("compression provider not found", e); } Try / catch
try {
provider = FBUtilities.newCompressionProvider(className);
} catch (ConfigurationException e) {
// fall back to default compressor or abort startup with cause
throw new IllegalStateException("compression provider init failed", e);
} Prevention
- Only configure class_name when using a non-default compression provider
- Ship provider jars with the same version everywhere
- Keep the (Map) constructor public and stable
- Check schema compression_options for stale class names after upgrades
When it happens
Trigger: compression provider configuration (e.g. class_name under compression_options) pointing to a class that is absent, not an AbstractCompressionProvider, missing the expected (Map) constructor, or whose constructor throws.
Common situations: Custom compression jar not shipped to the cluster; typo in class name; constructor throws on bad parameters; API change after Cassandra upgrade.
Related errors
- create method not found
- Access forbidden
- Cannot access method create in %s
- %s.create() threw an error: %s %s
- Value of %s is too large (%s)
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/d624b9cf5aa6ccc3.
Report an issue: GitHub.