apache/cassandra · error · ConfigurationException

Invalid configuration, %s should be greater than or equal to

Error message

Invalid configuration, %s should be greater than or equal to 0 (zero)

What it means

The min_sstable_size option of UnifiedCompactionStrategy must be zero or positive; negative byte values are rejected. Zero is explicitly valid and disables the feature. The value is parsed with FBUtilities.parseHumanReadableBytes.

Source

Thrown at src/java/org/apache/cassandra/db/compaction/unified/Controller.java:629

                Overlaps.InclusionMethod.valueOf(toUpperCaseLocalized(s));
            }
            catch (IllegalArgumentException e)
            {
                throw new ConfigurationException(String.format("Invalid overlap inclusion method %s. The valid options are %s.",
                                                               s,
                                                               Arrays.toString(Overlaps.InclusionMethod.values())));
            }
        }

        s = options.remove(MIN_SSTABLE_SIZE_OPTION);
        if (s != null)
        {
            try
            {
                long sizeInBytes = FBUtilities.parseHumanReadableBytes(s);
                // zero is a valid option to disable feature
                if (sizeInBytes < 0)
                    throw new ConfigurationException(String.format("Invalid configuration, %s should be greater than or equal to 0 (zero)",
                                                                   MIN_SSTABLE_SIZE_OPTION));
                long limit = (long) Math.ceil(targetSSTableSize * INVERSE_SQRT_2);
                if (sizeInBytes >= limit)
                    throw new ConfigurationException(String.format("Invalid configuration, %s (%s) should be less than 70%% of the targetSSTableSize (%s)",
                                                                   MIN_SSTABLE_SIZE_OPTION,
                                                                   FBUtilities.prettyPrintMemory(sizeInBytes),
                                                                   FBUtilities.prettyPrintMemory(targetSSTableSize)));
            }
            catch (NumberFormatException e)
            {
                throw new ConfigurationException(String.format("%s is not a valid size in bytes for %s",
                                                               s,
                                                               MIN_SSTABLE_SIZE_OPTION),
                                                 e);
            }
        }

        s = options.remove(SSTABLE_GROWTH_OPTION);

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set min_sstable_size to 0 to disable the feature, or a positive size.
  2. Remove the option entirely for default behavior.
  3. Fix the config generator to never emit negative sizes.

Example fix

// before
'min_sstable_size': '-1MiB'
// after
'min_sstable_size': '0'
Defensive patterns

Strategy: validation

Validate before calling

long v = FBUtilities.parseHumanReadableBytes(opts.get("min_sstable_size"));
if (v < 0) throw new IllegalArgumentException("min_sstable_size must be >= 0");

Try / catch

try { alterTable(); } catch (ConfigurationException e) { logger.error("min_sstable_size invalid: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Setting compaction option 'min_sstable_size' to a parsed value < 0 in Controller.validateOptions — practically requires a malformed negative literal like '-1MiB' that still parses.

Common situations: Typing a leading dash intending a hyphen or bullet; templating bug emitting negative defaults; misunderstanding that 0 disables the feature while negatives are invalid.

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


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