{"record":{"id":"612ec0b8497ff11d","repo":"apache/cassandra","slug":"s-is-requested-but-not-allowed-restart-cassandra","errorCode":null,"errorMessage":"%s is requested but not allowed, restart cassandra with -D%s=true to allow it","messagePattern":"(.+?) is requested but not allowed, restart cassandra with -D(.+?)=true to allow it","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategyOptions.java","lineNumber":158,"sourceCode":"            if (expiredCheckFrequency < 0)\n            {\n                throw new ConfigurationException(String.format(\"%s must not be negative, but was %d\", EXPIRED_SSTABLE_CHECK_FREQUENCY_SECONDS_KEY, expiredCheckFrequency));\n             }\n        }\n        catch (NumberFormatException e)\n        {\n            throw new ConfigurationException(String.format(\"%s is not a parsable int (base10) for %s\", optionValue, EXPIRED_SSTABLE_CHECK_FREQUENCY_SECONDS_KEY), e);\n        }\n\n\n        optionValue = options.get(UNSAFE_AGGRESSIVE_SSTABLE_EXPIRATION_KEY);\n        if (optionValue != null)\n        {\n            if (!(optionValue.equalsIgnoreCase(\"true\") || optionValue.equalsIgnoreCase(\"false\")))\n                throw new ConfigurationException(String.format(\"%s is not 'true' or 'false' (%s)\", UNSAFE_AGGRESSIVE_SSTABLE_EXPIRATION_KEY, optionValue));\n\n            if (optionValue.equalsIgnoreCase(\"true\") && !UNSAFE_AGGRESSIVE_SSTABLE_EXPIRATION_ENABLED)\n                throw new ConfigurationException(String.format(\"%s is requested but not allowed, restart cassandra with -D%s=true to allow it\",\n                                                               UNSAFE_AGGRESSIVE_SSTABLE_EXPIRATION_KEY, ALLOW_UNSAFE_AGGRESSIVE_SSTABLE_EXPIRATION.getKey()));\n        }\n\n        uncheckedOptions.remove(COMPACTION_WINDOW_SIZE_KEY);\n        uncheckedOptions.remove(COMPACTION_WINDOW_UNIT_KEY);\n        uncheckedOptions.remove(TIMESTAMP_RESOLUTION_KEY);\n        uncheckedOptions.remove(EXPIRED_SSTABLE_CHECK_FREQUENCY_SECONDS_KEY);\n        uncheckedOptions.remove(UNSAFE_AGGRESSIVE_SSTABLE_EXPIRATION_KEY);\n\n        uncheckedOptions = SizeTieredCompactionStrategyOptions.validateOptions(options, uncheckedOptions);\n\n        return uncheckedOptions;\n    }\n}\n","sourceCodeStart":140,"sourceCodeEnd":173,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategyOptions.java#L140-L173","documentation":"Setting unsafe_aggressive_sstable_expiration to 'true' is only permitted when the JVM was started with -Dcassandra.allow_unsafe_aggressive_sstable_expiration=true. Otherwise validateOptions throws this ConfigurationException telling you the exact system property to set.","triggerScenarios":"validateOptions with unsafe_aggressive_sstable_expiration='true' while UNSAFE_AGGRESSIVE_SSTABLE_EXPIRATION_ENABLED (derived from the ALLOW_UNSAFE_AGGRESSIVE_SSTABLE_EXPIRATION system property) is false, i.e. Cassandra started without the -D flag.","commonSituations":"Enabling aggressive sstable expiration (dangerous: can drop data in unexpired windows) in table options without the corresponding node startup flag, e.g. after migrating config to a new cluster; container images without custom JVM opts.","solutions":["Restart Cassandra with -Dcassandra.allow_unsafe_aggressive_sstable_expiration=true added to JVM options (cassandra-env.sh JVM_OPTS or JVM_EXTRA_OPTS)","Understand the risk first: the flag disables safe max_window_bounds checks and can cause data loss","Alternatively keep the option at 'false' or remove it","Verify the property took effect before retrying the ALTER TABLE"],"exampleFix":"// before (cassandra-env.sh)\nJVM_OPTS=\"$JVM_OPTS\"\n// after\nJVM_OPTS=\"$JVM_OPTS -Dcassandra.allow_unsafe_aggressive_sstable_expiration=true\"","handlingStrategy":"validation","validationCode":"if (\"true\".equalsIgnoreCase(opts.get(\"unsafe_aggressive_sstable_expiration\")) &&\n    !Boolean.getBoolean(\"cassandra.allow_unsafe_aggressive_sstable_expiration\"))\n    throw new IllegalStateException(\"set -Dcassandra.allow_unsafe_aggressive_sstable_expiration=true on the server first\");","typeGuard":null,"tryCatchPattern":"try {\n    session.execute(alterStmt);\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"is requested but not allowed\")) {\n        // add -Dcassandra.allow_unsafe_aggressive_sstable_expiration=true to server JVM opts and restart\n    }\n    throw e;\n}","preventionTips":["Add the -D flag to cassandra-env.sh JVM_OPTS on every node of clusters that need the feature","Remember the flag requires a full node restart, not a reload","Re-evaluate the risk: aggressive expiration can delete unexpired data","Keep cluster configs in sync to avoid the error reappearing on new nodes"],"tags":["cassandra","configuration","compaction","system-property","feature-flag"],"backgroundTag":"feature-not-enabled","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"}