{"record":{"id":"e27fe4b7cfbfe673","repo":"apache/cassandra","slug":"all-tables-option-should-be-passed-along-with","errorCode":null,"errorMessage":"--all-tables option should be passed along with --keyspace option","messagePattern":"--all-tables option should be passed along with --keyspace option","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/InvalidatePermissionsCache.java","lineNumber":129,"sourceCode":"                    && !allFunctions && StringUtils.isEmpty(functionsInKeyspace) && StringUtils.isEmpty(function)\n                    && !allMBeans && StringUtils.isEmpty(mBean),\n                    \"No resource options allowed without a <role> being specified\");\n\n            probe.invalidatePermissionsCache();\n        }\n        else\n        {\n            List<String> resourceNames = new ArrayList<>();\n\n            // Data Resources\n            if (allKeyspaces)\n                resourceNames.add(DataResource.root().getName());\n\n            if (allTables)\n                if (StringUtils.isNotEmpty(keyspace))\n                    resourceNames.add(DataResource.allTables(keyspace).getName());\n                else\n                    throw new IllegalArgumentException(\"--all-tables option should be passed along with --keyspace option\");\n\n            if (StringUtils.isNotEmpty(table))\n                if (StringUtils.isNotEmpty(keyspace))\n                    resourceNames.add(DataResource.table(keyspace, table).getName());\n                else\n                    throw new IllegalArgumentException(\"--table option should be passed along with --keyspace option\");\n\n            if (StringUtils.isNotEmpty(keyspace) && !allTables && StringUtils.isEmpty(table))\n                resourceNames.add(DataResource.keyspace(keyspace).getName());\n\n            // Roles Resources\n            if (allRoles)\n                resourceNames.add(RoleResource.root().getName());\n\n            if (StringUtils.isNotEmpty(role))\n                resourceNames.add(RoleResource.role(role).getName());\n\n            // Function Resources","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/InvalidatePermissionsCache.java#L111-L147","documentation":"Nodetool's InvalidatePermissionsCache command validates that the --all-tables flag is combined with --keyspace, since 'all tables' is meaningful only within a keyspace scope. When --all-tables is given without a keyspace, execute() throws IllegalArgumentException before any cache invalidation request is sent to the node.","triggerScenarios":"Running `nodetool invalidatepermissionscache --all-tables` (or invoking execute() with allTables=true and keyspace empty) triggers the error.","commonSituations":"Operators scripting permission-cache refreshes forget the --keyspace flag; copy-pasted commands drop the keyspace argument; documentation examples omit it.","solutions":["Add the --keyspace option: nodetool invalidatepermissionscache --all-tables --keyspace <ks>","If all keyspaces are intended, use --all-keyspaces instead so the root/all-keyspaces resource is added","Verify the command line via nodetool help invalidatepermissionscache"],"exampleFix":"// before\nnodetool invalidatepermissionscache --all-tables\n// after\nnodetool invalidatepermissionscache --all-tables --keyspace my_ks","handlingStrategy":"validation","validationCode":"if (args.includes('--all-tables') && !args.includes('--keyspace')) throw new Error('--all-tables requires --keyspace');","typeGuard":null,"tryCatchPattern":"try { runNodetool('invalidatepermissionscache', ...args); } catch (IllegalArgumentException e) { /* inspect message, re-run with --keyspace */ }","preventionTips":["Pair flag options (--all-tables/--table/--function) with their scope options in scripts","Use nodetool help invalidatepermissionscache to confirm required pairings","Wrap nodetool invocations in wrappers that validate flag combinations"],"tags":["cli","validation","permissions"],"backgroundTag":"missing-required-argument","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"}