{"record":{"id":"3203215a53c781b4","repo":"apache/cassandra","slug":"index-summary-capacity-option-was-set-incorrectly","errorCode":null,"errorMessage":"index_summary_capacity option was set incorrectly to '<value>', it should be a non-negative integer.","messagePattern":"index_summary_capacity option was set incorrectly to '<value>', it should be a non-negative integer\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1103,"sourceCode":"            if (consensusMigrationCacheSizeInMiB < 0)\n                throw new NumberFormatException(); // to escape duplicating error message\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(\"consensus_migration_cache_size option was set incorrectly to '\"\n                                             + conf.consensus_migration_cache_size + \"', supported values are <integer> >= 0.\", false);\n        }\n\n        // we need this assignment for the Settings virtual table - CASSANDRA-17735\n        conf.counter_cache_size = new DataStorageSpec.LongMebibytesBound(counterCacheSizeInMiB);\n\n        // if set to empty/\"auto\" then use 5% of Heap size\n        indexSummaryCapacityInMiB = (conf.index_summary_capacity == null)\n                                    ? Math.max(1, (int) (Runtime.getRuntime().totalMemory() * 0.05 / 1024 / 1024))\n                                    : conf.index_summary_capacity.toMebibytes();\n\n        if (indexSummaryCapacityInMiB < 0)\n            throw new ConfigurationException(\"index_summary_capacity option was set incorrectly to '\"\n                                             + conf.index_summary_capacity.toString() + \"', it should be a non-negative integer.\", false);\n\n        // we need this assignment for the Settings virtual table - CASSANDRA-17735\n        conf.index_summary_capacity = new DataStorageSpec.LongMebibytesBound(indexSummaryCapacityInMiB);\n\n        if (conf.user_defined_functions_fail_timeout.toMilliseconds() < conf.user_defined_functions_warn_timeout.toMilliseconds())\n            throw new ConfigurationException(\"user_defined_functions_warn_timeout must less than user_defined_function_fail_timeout\", false);\n\n        if (!conf.allow_insecure_udfs && !conf.user_defined_functions_threads_enabled)\n            throw new ConfigurationException(\"To be able to set enable_user_defined_functions_threads: false you need to set allow_insecure_udfs: true - this is an unsafe configuration and is not recommended.\");\n\n        if (conf.allow_extra_insecure_udfs)\n            logger.warn(\"Allowing java.lang.System.* access in UDFs is dangerous and not recommended. Set allow_extra_insecure_udfs: false to disable.\");\n\n        if (conf.scripted_user_defined_functions_enabled)\n            throw new ConfigurationException(\"JavaScript user-defined functions were removed in CASSANDRA-18252. \" +\n                                             \"Hooks are planned to be introduced as part of CASSANDRA-17280\");\n","sourceCodeStart":1085,"sourceCodeEnd":1121,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1085-L1121","documentation":"Thrown when index_summary_capacity resolves to a negative mebibyte value. Cassandra computes the default as max(1, 5% of heap) when unset; an explicit conf.index_summary_capacity value that parses but is negative fails this guard in applySimpleConfig.","triggerScenarios":"cassandra.yaml has index_summary_capacity set to a negative storage bound (e.g. -20MiB). Parsing to a negative LongMebibytesBound passes the initial toMebibytes() conversion but fails the < 0 check.","commonSituations":"Sign errors in hand-edited yaml; automated config generation producing negative capacity; misunderstanding of the option's unit (mebibytes, not percent).","solutions":["Set index_summary_capacity to a non-negative integer mebibyte value (e.g. 128MiB) or remove the key to auto-size to 5% of heap.","Re-run startup after correcting cassandra.yaml."],"exampleFix":"# before\nindex_summary_capacity: -128MiB\n# after\nindex_summary_capacity: 128MiB","handlingStrategy":"validation","validationCode":"Object v = yaml.get(\"index_summary_capacity\");\nif (v != null && String.valueOf(v).trim().startsWith(\"-\"))\n    throw new IllegalArgumentException(\"index_summary_capacity must be a non-negative integer\");","typeGuard":"boolean isValidIndexSummaryCapacity(Object v) {\n    return v == null || (v instanceof Number && ((Number) v).longValue() >= 0);\n}","tryCatchPattern":"try {\n    DatabaseDescriptor.applySimpleConfig();\n} catch (ConfigurationException e) {\n    if (e.getMessage().contains(\"index_summary_capacity\"))\n        logger.error(\"Set index_summary_capacity to non-negative MiB value: {}\", e.getMessage());\n}","preventionTips":["Leave unset for the automatic 5% heap sizing","Remember the unit is mebibytes, not a percentage","Validate yaml before restart in scripted deployments"],"tags":["config","startup","index-summary"],"backgroundTag":"invalid-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}