{"record":{"id":"8513d311f02c94cf","repo":"apache/cassandra","slug":"invalid-guardrails-configuration","errorCode":null,"errorMessage":"Invalid guardrails configuration: ","messagePattern":"Invalid guardrails configuration: ","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":1405,"sourceCode":"        if (writeTombstoneWarn != -1 && writeTombstoneWarn < minTrackedTombstoneCount)\n            throw new ConfigurationException(String.format(\"write_tombstone_warn_threshold (%d) cannot be less than min_tracked_partition_tombstone_count (%d)\",\n                                                           writeTombstoneWarn, minTrackedTombstoneCount));\n    }\n\n    public static GuardrailsOptions getGuardrailsConfig()\n    {\n        return guardrails;\n    }\n\n    private static void applyGuardrails()\n    {\n        try\n        {\n            guardrails = new GuardrailsOptions(conf);\n        }\n        catch (IllegalArgumentException e)\n        {\n            throw new ConfigurationException(\"Invalid guardrails configuration: \" + e.getMessage(), e);\n        }\n    }\n\n    // TODO (expected): move all of the Accord config setup and accessors into AccordConfig\n    private static void applyAccord()\n    {\n        try\n        {\n            accordProgressLogConfig = new DefaultProgressLog.Config();\n            accordProgressLogConfig.concurrency = conf.accord.progress_log_concurrency.or(32);\n            accordProgressLogConfig.maxActiveRunTime = conf.accord.progress_log_query_fallback_timeout.toDuration();\n        }\n        catch (IllegalArgumentException e)\n        {\n            throw new ConfigurationException(\"Invalid accord progress log configuration: \" + e.getMessage(), e);\n        }\n        AccordService.applyProtocolModifiers(getAccord());\n    }","sourceCodeStart":1387,"sourceCodeEnd":1423,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1387-L1423","documentation":"GuardrailsOptions validates its configuration with IllegalArgumentException; DatabaseDescriptor wraps that into a ConfigurationException with the prefix 'Invalid guardrails configuration: ' plus the underlying message, so guardrails misconfiguration fails startup with a clear cause chain.","triggerScenarios":"Any guardrails setting in cassandra.yaml that GuardrailsOptions rejects (e.g. invalid threshold ordering like rows-per-partition warn > fail, unknown/disabled guardrail values, bad regexes), during applyGuardrails at startup.","commonSituations":"Setting a guardrail warn threshold above its fail threshold; enabling a guardrail with a malformed pattern; config copied from a version where a guardrail had different semantics; typos in values (non-numeric where numbers required).","solutions":["Read the wrapped e.getMessage() after the prefix for the exact offending guardrail","Fix the ordering so warn thresholds are <= fail thresholds","Correct or remove the invalid guardrail value in cassandra.yaml","Validate the config against the GuardrailsOptions docs for your Cassandra version"],"exampleFix":"// before (cassandra.yaml)\nguardrails:\n  partition_keys_in_select_warn_threshold: 100\n  partition_keys_in_select_fail_threshold: 50\n// after\nguardrails:\n  partition_keys_in_select_warn_threshold: 50\n  partition_keys_in_select_fail_threshold: 100","handlingStrategy":"try-catch","validationCode":"try { new GuardrailsOptions(conf); } catch (IllegalArgumentException e) { preflightFail(\"guardrails: \" + e.getMessage()); }","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.daemonInitialization(); } catch (ConfigurationException e) { LOG.error(\"Guardrails config rejected: \" + e.getMessage()); System.exit(1); }","preventionTips":["Keep guardrail warn <= fail thresholds","Validate regex-typed guardrails before deploy","Check guardrail docs per Cassandra version","Diff guardrails section when upgrading"],"tags":["configuration","guardrails","validation"],"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-14T16:17:12.679Z"}