{"record":{"id":"e679a4990268d194","repo":"apache/cassandra","slug":"table-option-should-be-passed-along-with-keysp","errorCode":null,"errorMessage":"--table option should be passed along with --keyspace option","messagePattern":"--table 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":135,"sourceCode":"        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\n            if (allFunctions)\n                resourceNames.add(FunctionResource.root().getName());\n\n            if (StringUtils.isNotEmpty(function))\n                if (StringUtils.isNotEmpty(functionsInKeyspace))\n                    resourceNames.add(constructFunctionResource(functionsInKeyspace, function));","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/InvalidatePermissionsCache.java#L117-L153","documentation":"InvalidatePermissionsCache builds a table-scoped DataResource when --table is used, which is only valid together with --keyspace identifying the table's keyspace. If --table is set without --keyspace, execute() throws IllegalArgumentException.","triggerScenarios":"Running `nodetool invalidatepermissionscache --table <table>` without `--keyspace <ks>`.","commonSituations":"Operator assumes the table name alone is unambiguous; scripted commands from another tool pass only the table name; typos drop the keyspace flag.","solutions":["Pass the keyspace: nodetool invalidatepermissionscache --table <table> --keyspace <ks>","If the whole keyspace should be invalidated, drop --table and use only --keyspace","Use fully qualified syntax check with nodetool help invalidatepermissionscache"],"exampleFix":"// before\nnodetool invalidatepermissionscache --table users\n// after\nnodetool invalidatepermissionscache --table users --keyspace my_ks","handlingStrategy":"validation","validationCode":"if (args.includes('--table') && !args.includes('--keyspace')) throw new Error('--table requires --keyspace');","typeGuard":null,"tryCatchPattern":"try { runNodetool('invalidatepermissionscache', ...args); } catch (IllegalArgumentException e) { /* handle missing --keyspace */ }","preventionTips":["Always specify table as keyspace.table mentally and pass both flags","Validate flag combos in CI scripts before running against production","Prefer keyspace-level invalidation when the whole keyspace changes"],"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"}