apache/cassandra · error · ConfigurationException
compressor_providers entry is missing required 'class_name
Error message
compressor_providers entry is missing required 'class_name': %s
What it means
Each compressor_providers entry is a ParameterizedClass that must name the provider implementation via its class_name field. resolveProvider() throws ConfigurationException when class_name is null because there is nothing to instantiate. Without class_name Cassandra cannot know which AbstractCompressionProvider to construct for the given compressor key.
Solutions
- Add the class_name field to the compressor_providers entry, e.g. 'LZ4: { class_name: com.example.MyCompressionProvider }'.
- If you meant to use the built-in implementation, remove the entry entirely — absence of a provider falls back to DefaultCompressionProvider.
- Validate that the config parser maps your YAML key to the expected class_name field (ParameterizedClass expects class_name, not class or className).
Example fix
// before
cassandra.yaml: compressor_providers: { LZ4: { } }
// after
cassandra.yaml: compressor_providers: { LZ4: { class_name: com.example.MyCompressionProvider } } Defensive patterns
Strategy: validation
Validate before calling
if (cfg.compressorProviders != null)
for (Map.Entry<String, ParameterizedClass> e : cfg.compressorProviders.entrySet())
if (e.getValue() == null || e.getValue().class_name == null)
throw new IllegalArgumentException("compressor_providers entry for '" + e.getKey() + "' missing class_name"); Type guard
boolean hasClassName(ParameterizedClass pc) { return pc != null && pc.class_name != null && !pc.class_name.trim().isEmpty(); } Try / catch
try {
registry.registerProviders(providers);
} catch (ConfigurationException e) {
if (e.getMessage().contains("missing required 'class_name'")) log.error("Add class_name to compressor_providers entry");
throw e;
} Prevention
- Always specify class_name for every compressor_providers entry
- Remove entries entirely (instead of leaving them empty) to use the default provider
- Remember the field name is class_name (snake_case), not className
- Validate cassandra.yaml structurally before startup
When it happens
Trigger: registerProviders() resolving a provider config whose ParameterizedClass.class_name is null — e.g. a YAML entry like 'LZ4:' with an empty value, or a programmatically constructed ParameterizedClass without class_name set.
Common situations: YAML map entries where the value is omitted or left blank; refactoring code that builds ParameterizedClass objects and forgets to set class_name; copying config examples that use a different field name.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- Cannot create CompressionParams for stored parameters
- commitlog_disk_access_mode =
- compressed_read_ahead_buffer_size_in_kb must be at least…
- compressed_read_ahead_buffer_size must be at least 256KiB…
- <ConfigurationException message>
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/7a73e05249c15730.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/io/compress/CompressorRegistry.java:273
if (parameterizedClass == null)
parameterizedClass = providerOptions.get(type.abbreviation);
return parameterizedClass;
}
/**
* Returns a compression provider with configuration specified in the config file.
* If the provider fails to initialize or is not healthy, will attempt to fall back to the default provider
* if enabled in the configuration.
*
* @param providerConfig the configuration for the provider
* @return the compression provider instance
* @throws ConfigurationException if both the specified and fallback providers fail to initialize
*/
AbstractCompressionProvider resolveProvider(ParameterizedClass providerConfig)
{
if (providerConfig.class_name == null)
throw new ConfigurationException("compressor_providers entry is missing required 'class_name': " + providerConfig);
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)View on GitHub (pinned to 88fd0f6a0e)