apache/cassandra · error · ConfigurationException
%s.create() threw an error: %s %s
Error message
%s.create() threw an error: %s %s
What it means
The compressor's static create(Map) method itself threw an exception at runtime; the reflective InvocationTargetException wraps it. If the target exception is a ConfigurationException it is rethrown directly; otherwise this message is thrown, reporting the create() failure with the cause class name and message so the real error (bad options, OOM, native lib crash) is visible.
Source
Thrown at src/java/org/apache/cassandra/io/compress/DefaultCompressionProvider.java:95
}
catch (SecurityException e)
{
throw new ConfigurationException("Access forbidden", e);
}
catch (IllegalAccessException e)
{
throw new ConfigurationException("Cannot access method create in " + compressorClass.getName(), e);
}
catch (InvocationTargetException e)
{
if (e.getTargetException() instanceof ConfigurationException)
throw (ConfigurationException) e.getTargetException();
Throwable cause = e.getCause() == null
? e
: e.getCause();
throw new ConfigurationException(format("%s.create() threw an error: %s %s",
compressorClass.getSimpleName(),
cause.getClass().getName(),
cause.getMessage()),
e);
}
catch (ExceptionInInitializerError e)
{
throw new ConfigurationException("Cannot initialize class " + compressorClass.getName());
}
}
}
View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Read the cause class and message embedded in the error to identify the actual failure and fix it (e.g. install the matching native library, correct the option value).
- Validate compression option values (ranges, formats) before applying them; the inner ConfigurationException path would have shown a clearer message.
- Check Cassandra's system.log for the full stack trace attached via the wrapped InvocationTargetException.
- Increase heap if the cause is OutOfMemoryError, or reduce chunk_length_kb.
Example fix
// before
compression = {'sstable_compression':'LZ4Compressor','chunk_length_kb':'0'}
// after
compression = {'sstable_compression':'LZ4Compressor','chunk_length_kb':'64'} Defensive patterns
Strategy: try-catch
Validate before calling
try {
compressorClass.getMethod("create", Map.class).invoke(null, myOptions);
} catch (InvocationTargetException e) {
throw new IllegalStateException("create() would fail: " + e.getCause(), e.getCause());
} Try / catch
try {
registry.getCompressor(LZ4Compressor.class, opts);
} catch (ConfigurationException e) {
if (e.getMessage().contains(".create() threw an error")) log.error("create() failed: {}", e.getCause(), e);
throw e;
} Prevention
- Validate option values (ranges, formats) before passing them to compression
- Ensure native compression libraries are installed and ABI-compatible in the deployment image
- Reproduce compressor creation in a standalone test to capture the raw cause stack trace
- Monitor heap; create() allocations can OOM on constrained nodes
When it happens
Trigger: createCompressor() invoking create(Map) on a compressor whose body throws any non-ConfigurationException — e.g. invalid chunk_length_kb value, OutOfMemoryError while allocating, UnsatisfiedLinkError from a missing native LZ4/Snappy library, or IllegalArgumentException for malformed parameters.
Common situations: Missing/incompatible native compression libraries on the host; compression option values out of valid range (chunk length too small/large); corrupted option strings; OOM in memory-constrained environments during table creation or startup.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- create method not found
- Access forbidden
- Cannot access method create in %s
- Unable to create an instance of the compression service prov
- Failed to instantiate %s
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/40e8a84e324e7a0b.
Report an issue: GitHub.