apache/cassandra · error · ConfigurationException

%s is not a parsable int (base10) for %s

Error message

%s is not a parsable int (base10) for %s

What it means

Thrown as a ConfigurationException when the tombstone_threshold compaction option cannot be parsed as a long/int by Long.parseLong. Cassandra validates all compaction strategy options at table creation/ALTER time via validateOptions, so an unparsable numeric value is rejected before the strategy is instantiated.

Source

Thrown at src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java:466

        }
    }

    public static Map<String, String> validateOptions(Map<String, String> options) throws ConfigurationException
    {
        String threshold = options.get(TOMBSTONE_THRESHOLD_OPTION);
        if (threshold != null)
        {
            try
            {
                float thresholdValue = Float.parseFloat(threshold);
                if (thresholdValue < 0)
                {
                    throw new ConfigurationException(String.format("%s must be greater than 0, but was %f", TOMBSTONE_THRESHOLD_OPTION, thresholdValue));
                }
            }
            catch (NumberFormatException e)
            {
                throw new ConfigurationException(String.format("%s is not a parsable int (base10) for %s", threshold, TOMBSTONE_THRESHOLD_OPTION), e);
            }
        }

        String interval = options.get(TOMBSTONE_COMPACTION_INTERVAL_OPTION);
        if (interval != null)
        {
            try
            {
                long tombstoneCompactionInterval = Long.parseLong(interval);
                if (tombstoneCompactionInterval < 0)
                {
                    throw new ConfigurationException(String.format("%s must be greater than 0, but was %d", TOMBSTONE_COMPACTION_INTERVAL_OPTION, tombstoneCompactionInterval));
                }
            }
            catch (NumberFormatException e)
            {
                throw new ConfigurationException(String.format("%s is not a parsable int (base10) for %s", interval, TOMBSTONE_COMPACTION_INTERVAL_OPTION), e);
            }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set tombstone_threshold to a plain base-10 numeric string, e.g. '0.2' (it is parsed as a double elsewhere, so avoid stray characters).
  2. Check the exact value with DESCRIBE TABLE and remove whitespace or invisible characters from the option map.
  3. If a fractional threshold is desired, verify the version's expected format for tombstone_threshold; older versions parse strictly.
  4. Validate the option locally with Long/Double parse before issuing the CQL statement.

Example fix

// before
ALTER TABLE ks.tbl WITH compaction = {'class': 'SizeTieredCompactionStrategy', 'tombstone_threshold': 'twenty'};
// after
ALTER TABLE ks.tbl WITH compaction = {'class': 'SizeTieredCompactionStrategy', 'tombstone_threshold': '0.2'};
Defensive patterns

Strategy: validation

Validate before calling

String v = options.get("tombstone_threshold");
if (v != null) { try { Double.parseDouble(v); } catch (NumberFormatException e) { throw new IllegalArgumentException("tombstone_threshold must be numeric: " + v); } }

Try / catch

try { session.execute(alterCql); } catch (ConfigurationException e) { /* fix option value and retry */ }

Prevention

When it happens

Trigger: Creating or ALTERing a table with compaction option 'tombstone_threshold' set to a non-numeric string, e.g. {tombstone_threshold: 'high'} or {tombstone_threshold: '0.5.1'}.

Common situations: Typo in the option value, passing a decimal or percentage string where a plain integer is expected, quoting/escaping issues in cqlsh that leave stray characters in the value.

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/83fb01115829a531. Report an issue: GitHub.