apache/cassandra · error · ConfigurationException

accord.cache_size option was set incorrectly to '<value>', s

Error message

accord.cache_size option was set incorrectly to '<value>', supported values are <integer> >= 0.

What it means

accord.cache_size must be a non-negative integer (MiB) or 'auto'. applySimpleConfig converts any parse failure or negative value into ConfigurationException naming the accord.cache_size option and its accepted format.

Source

Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:1060

        catch (NumberFormatException e)
        {
            throw new ConfigurationException("paxos_cache_size option was set incorrectly to '"
                                             + conf.paxos_cache_size + "', supported values are <integer> >= 0.", false);
        }

        try
        {
            // if accordCacheSizeInMiB option was set to "auto" then size of the cache should be "max(10% of Heap (in MB), 1MB)
            accordCacheSizeInMiB = (conf.accord.cache_size == null)
                                  ? Math.max(1, (int) ((Runtime.getRuntime().totalMemory() * 0.10) / 1024 / 1024))
                                  : conf.accord.cache_size.toMebibytes();

            if (accordCacheSizeInMiB < 0)
                throw new NumberFormatException(); // to escape duplicating error message
        }
        catch (NumberFormatException e)
        {
            throw new ConfigurationException("accord.cache_size option was set incorrectly to '"
                                             + conf.accord.cache_size + "', supported values are <integer> >= 0.", false);
        }

        try
        {
            // if accordWorkingSetSizeInMiB option was set to "auto" then size of the working set should be "max(5% of Heap (in MB), 1MB)
            // if negative, there is no limit
            accordWorkingSetSizeInMiB = (conf.accord.working_set_size == null)
                                  ? Math.max(1, (int) ((Runtime.getRuntime().totalMemory() * 0.05) / 1024 / 1024))
                                  : conf.accord.working_set_size.toMebibytes();
        }
        catch (NumberFormatException e)
        {
            throw new ConfigurationException("accord.working_set_size option was set incorrectly to '"
                                             + conf.accord.working_set_size + "', supported values are <integer> >= 0.", false);
        }

        try

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Set accord.cache_size to a plain non-negative integer of MiB, e.g. 512
  2. Use 'auto' for max(10% of heap, 1MiB)
  3. Remove the key if Accord cache tuning is not needed
  4. Restart the node

Example fix

// before (cassandra.yaml)
accord:
  cache_size: 512MB
// after
accord:
  cache_size: 512
// or
accord:
  cache_size: auto
Defensive patterns

Strategy: validation

Validate before calling

Object v = yaml.get("accord").get("cache_size");
if (v != null && !"auto".equals(v) && Long.parseLong(v.toString()) < 0) throw new IllegalArgumentException(v);

Try / catch

try { DatabaseDescriptor.daemonInitialization(); }
catch (ConfigurationException e) { LOG.fatal(e.getMessage()); System.exit(1); }

Prevention

When it happens

Trigger: Node startup with accord.cache_size in cassandra.yaml that is negative, non-numeric, or unit-suffixed (common with Accord/transactional config newly added in this version).

Common situations: Fresh Accord configuration copied with units ('512MB'); a leftover negative placeholder from tooling; YAML value accidentally quoted as a string with extra text.

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/55afe066d7429ec8. Report an issue: GitHub.