apache/cassandra · error · ConfigurationException
The '%s' option must not be empty. To disable compression us
Error message
The '%s' option must not be empty. To disable compression use 'enabled' : false
What it means
removeSSTableClassOption rejects a compression map where the 'class' key is present but empty or null, because Cassandra cannot resolve an ICompressor implementation from an empty class name. The message points to the correct way to disable compression: 'enabled' : false.
Source
Thrown at src/java/org/apache/cassandra/schema/CompressionParams.java:422
return Double.parseDouble(ratio);
}
return DEFAULT_MIN_COMPRESS_RATIO;
}
/**
* Removes the option specifying the name of the compression class
*
* @param options the options
* @return the name of the compression class
*/
private static String removeSSTableCompressionClass(Map<String, String> options)
{
if (options.containsKey(CLASS))
{
String clazz = options.remove(CLASS);
if (clazz == null || clazz.isEmpty())
throw new ConfigurationException(format("The '%s' option must not be empty. To disable compression use 'enabled' : false", CLASS));
return clazz;
}
return null;
}
/**
* Returns {@code true} if the options contains the {@code enabled} option and that its value is
* {@code true}, otherwise returns {@code false}.
*
* @param options the options
* @return {@code true} if the options contains the {@code enabled} option and that its value is
* {@code true}, otherwise returns {@code false}.
*/
public static boolean isEnabled(Map<String, String> options)
{
String enabled = options.get(ENABLED);View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Set 'class' to a valid compressor class, e.g. 'org.apache.cassandra.io.compress.LZ4Compressor'
- To disable compression entirely, use {'enabled': 'false'} instead of an empty class
- Remove the empty 'class' key so defaults are applied
Example fix
// before
{'class': ''}
// after
{'enabled': 'false'} Defensive patterns
Strategy: validation
Validate before calling
if (opts.containsKey("class") && (opts.get("class") == null || opts.get("class").isEmpty())) throw new IllegalArgumentException("class must not be empty; use {'enabled':'false'} to disable"); Try / catch
try { params = CompressionParams.fromMap(opts); } catch (ConfigurationException e) { log.error("empty compression class", e); } Prevention
- Use {'enabled': 'false'} to disable compression, never an empty class key
- Check for empty-string values when merging compression option maps
- Write a config lint test that fails on empty 'class' values
When it happens
Trigger: Calling CompressionParams.fromMap with options containing {'class': ''} or {'class': null} (key present, value empty).
Common situations: Programmatic schema builders concatenating maps and leaving class blank; YAML/cqlsh configs where a placeholder value was never filled in; tooling that strips the class name but keeps the key.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Invalid negative or null
- chunk_length_in_kb must be a power of 2
- Invalid negative min_compress_ratio
- min_compress_ratio can either be 0 or greater than or equal
- Invalid value of auto_snapshot_ttl: ${conf.auto_snapshot_ttl
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/c22da8ec07d56ac1.
Report an issue: GitHub.