{"record":{"id":"b2de6cef038b26b4","repo":"apache/cassandra","slug":"enable-active-update-and-disable-active-update-can","errorCode":null,"errorMessage":"enable-active-update and disable-active-update cannot be used together","messagePattern":"enable-active-update and disable-active-update cannot be used together","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/SetAuthCacheConfig.java","lineNumber":104,"sourceCode":"        {\n            authCacheMBean.setMaxEntries(maxEntries);\n            probe.output().out.println(\"Changed Max Entries to \" + maxEntries);\n        }\n\n        if (activeUpdate != null)\n        {\n            authCacheMBean.setActiveUpdate(activeUpdate);\n            probe.output().out.println(\"Changed Active Update to \" + activeUpdate);\n        }\n    }\n\n    private Boolean getActiveUpdate(Boolean enableActiveUpdate, Boolean disableActiveUpdate)\n    {\n        if (enableActiveUpdate == null && disableActiveUpdate == null)\n            return null;\n\n        if (enableActiveUpdate != null && disableActiveUpdate != null)\n            throw new IllegalArgumentException(\"enable-active-update and disable-active-update cannot be used together\");\n\n        return Boolean.TRUE.equals(enableActiveUpdate) ? Boolean.TRUE : Boolean.FALSE;\n    }\n}\n","sourceCodeStart":86,"sourceCodeEnd":109,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/SetAuthCacheConfig.java#L86-L109","documentation":"Nodetool SetAuthCacheConfig computes the desired active-update state from the --enable-active-update and --disable-active-update flags. Supplying both is contradictory, so getActiveUpdate throws this IllegalArgumentException. It happens purely client-side before any cache configuration is applied.","triggerScenarios":"`nodetool setauthcacheconfig <cache> --enable-active-update --disable-active-update` — both flags set in one invocation.","commonSituations":"Scripted invocations where both booleans were set from variables defaulting to true; copy-paste merging of enable and disable examples.","solutions":["Use only --enable-active-update to turn it on","Use only --disable-active-update to turn it off","Omit both flags to leave active-update unchanged","Fix the calling script so only one flag is ever set"],"exampleFix":"// before\nnodetool setauthcacheconfig roles-cache --enable-active-update --disable-active-update\n// after\nnodetool setauthcacheconfig roles-cache --enable-active-update","handlingStrategy":"validation","validationCode":"[ -n \"$ENABLE\" ] && [ -n \"$DISABLE\" ] && { echo \"pick one of --enable-active-update/--disable-active-update\"; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build the flag list from mutually exclusive conditions, never two raw booleans","Default to omitting both flags when state is unchanged","Test generated command lines before execution"],"tags":["nodetool","cli","auth-cache","mutually-exclusive-flags"],"backgroundTag":"mutually-exclusive-flags","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"}