{"record":{"id":"ea03b0de98f82e6d","repo":"apache/cassandra","slug":"denylist-initial-load-retry-must-be-a-positive-int","errorCode":null,"errorMessage":"denylist_initial_load_retry must be a positive integer.","messagePattern":"denylist_initial_load_retry must be a positive integer\\.","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":5549,"sourceCode":"    }\n\n    public static void setDenylistRefreshSeconds(int seconds)\n    {\n        if (seconds <= 0)\n            throw new IllegalArgumentException(\"denylist_refresh must be a positive integer.\");\n\n        conf.denylist_refresh = new DurationSpec.IntSecondsBound(seconds);\n    }\n\n    public static int getDenylistInitialLoadRetrySeconds()\n    {\n        return conf.denylist_initial_load_retry.toSeconds();\n    }\n\n    public static void setDenylistInitialLoadRetrySeconds(int seconds)\n    {\n        if (seconds <= 0)\n            throw new IllegalArgumentException(\"denylist_initial_load_retry must be a positive integer.\");\n\n        conf.denylist_initial_load_retry = new DurationSpec.IntSecondsBound(seconds);\n    }\n\n    public static ConsistencyLevel getDenylistConsistencyLevel()\n    {\n        return conf.denylist_consistency_level;\n    }\n\n    public static void setDenylistConsistencyLevel(ConsistencyLevel cl)\n    {\n        conf.denylist_consistency_level = cl;\n    }\n\n    public static int getDenylistMaxKeysPerTable()\n    {\n        return conf.denylist_max_keys_per_table;\n    }","sourceCodeStart":5531,"sourceCodeEnd":5567,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L5531-L5567","documentation":"DatabaseDescriptor.setDenylistInitialLoadRetrySeconds requires a strictly positive number of seconds for denylist_initial_load_retry, the retry interval for the initial deny-list load. Zero or negative ints throw IllegalArgumentException.","triggerScenarios":"Calling setDenylistInitialLoadRetrySeconds(0) or negative; e.g. denylist_initial_load_retry: 0 in cassandra.yaml.","commonSituations":"Hand-edited config with 0 or negative retry interval, or programmatic config code using 0 as a 'no retry' sentinel.","solutions":["Pass a positive integer (>= 1 second)","Remove the invalid value from cassandra.yaml to use the default","Validate the seconds value at the call site before setting"],"exampleFix":"// before\nDatabaseDescriptor.setDenylistInitialLoadRetrySeconds(0);\n// after\nDatabaseDescriptor.setDenylistInitialLoadRetrySeconds(30);","handlingStrategy":"validation","validationCode":"if (seconds <= 0) throw new IllegalArgumentException(\"denylist_initial_load_retry must be a positive integer\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.setDenylistInitialLoadRetrySeconds(v); } catch (IllegalArgumentException e) { logger.error(\"invalid denylist_initial_load_retry: {}\", e.getMessage()); }","preventionTips":["Validate retry intervals are positive before calling the setter","Do not use 0 as a no-retry sentinel in cassandra.yaml","Rely on defaults when unsure of valid bounds"],"tags":["config","validation","denylist"],"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-14T21:17:11.552Z"}