apache/cassandra · error · ConfigurationException

If the ' ' option is set to false no other options must be…

Error message

If the '%s' option is set to false no other options must be specified

What it means

When compression is disabled via {'enabled': 'false'}, no other compression options may accompany it. CompressionParams.fromMap throws ConfigurationException if additional sub-options are present alongside enabled=false, because they would be silently meaningless.

Solutions

  1. Remove all other keys, leaving compression = {'enabled': 'false'}
  2. Re-enable compression instead if the options are still wanted
  3. Scrub the option map of stale keys when toggling enabled

Example fix

// before
compression = {'enabled': 'false', 'class': 'LZ4Compressor', 'chunk_length_in_kb': '16'}
// after
compression = {'enabled': 'false'}
Defensive patterns

Strategy: validation

Validate before calling

if ("false".equalsIgnoreCase(opts.get("enabled")) && opts.size() > 1)
    throw new IllegalArgumentException("No other compression options allowed with enabled:false");

Try / catch

try { compressionParams = CompressionParams.fromMap(opts); } catch (ConfigurationException e) { if (e.getMessage().contains("set to false")) { /* strip extra options */ } throw e; }

Prevention

When it happens

Trigger: compression = {'enabled': 'false', 'chunk_length_in_kb': '16'} in CREATE/ALTER TABLE; programmatic maps where enablement is toggled but leftover tuning options remain.

Common situations: Scripts that flip enabled to false while keeping previous options; copying a disabled-compression template that still lists stale options.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/schema/CompressionParams.java:98

                                                                       Collections.emptyMap());

    private final ICompressor sstableCompressor;
    private final int chunkLength;
    private final int maxCompressedLength;  // In content we store max length to avoid rounding errors causing compress/decompress mismatch.
    private final double minCompressRatio;  // In configuration we store min ratio, the input parameter.
    private final ImmutableMap<String, String> otherOptions; // Unrecognized options, can be used by the compressor

    public static CompressionParams fromMap(Map<String, String> opts)
    {
        Map<String, String> options = copyOptions(opts);

        String sstableCompressionClass;

        if (!opts.isEmpty() && isEnabled(opts) && !options.containsKey(CLASS))
            throw new ConfigurationException(format("Missing sub-option '%s' for the 'compression' option.", CLASS));

        if (!removeEnabled(options) && !options.isEmpty())
            throw new ConfigurationException(format("If the '%s' option is set to false no other options must be specified", ENABLED));
        else
            sstableCompressionClass = removeSSTableCompressionClass(options);

        int chunkLength = removeChunkLength(options);
        double minCompressRatio = removeMinCompressRatio(options);

        CompressionParams cp = new CompressionParams(sstableCompressionClass, options, chunkLength, minCompressRatio);
        cp.validate();

        return cp;
    }

    public Class<? extends ICompressor> klass()
    {
        return sstableCompressor.getClass();
    }

    public static CompressionParams noCompression()

View on GitHub (pinned to 88fd0f6a0e)