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

  1. Set 'class' to a valid compressor class, e.g. 'org.apache.cassandra.io.compress.LZ4Compressor'
  2. To disable compression entirely, use {'enabled': 'false'} instead of an empty class
  3. 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

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


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