{"record":{"id":"baed2af92919d220","repo":"apache/cassandra","slug":"no-resource-options-specified","errorCode":null,"errorMessage":"No resource options specified","messagePattern":"No resource options specified","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/InvalidatePermissionsCache.java","lineNumber":168,"sourceCode":"\n            if (StringUtils.isNotEmpty(function))\n                if (StringUtils.isNotEmpty(functionsInKeyspace))\n                    resourceNames.add(constructFunctionResource(functionsInKeyspace, function));\n                else\n                    throw new IllegalArgumentException(\"--function option should be passed along with --functions-in-keyspace option\");\n            else\n                if (StringUtils.isNotEmpty(functionsInKeyspace))\n                    resourceNames.add(FunctionResource.keyspace(functionsInKeyspace).getName());\n\n            // MBeans Resources\n            if (allMBeans)\n                resourceNames.add(JMXResource.root().getName());\n\n            if (StringUtils.isNotEmpty(mBean))\n                resourceNames.add(JMXResource.mbean(mBean).getName());\n\n            if (resourceNames.isEmpty())\n                throw new IllegalArgumentException(\"No resource options specified\");\n\n            for (String resourceName : resourceNames)\n                probe.invalidatePermissionsCache(roleName, resourceName);\n        }\n    }\n\n    private String constructFunctionResource(String functionsInKeyspace, String function) {\n        try\n        {\n            return FunctionResource.fromName(\"functions/\" + functionsInKeyspace + '/' + function).getName();\n        } catch (ConfigurationException e)\n        {\n            throw new IllegalArgumentException(\"An error was encountered when looking up function definition: \" + e.getMessage());\n        }\n    }\n}","sourceCodeStart":150,"sourceCodeEnd":184,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/InvalidatePermissionsCache.java#L150-L184","documentation":"The command requires at least one resource option (--all-keyspaces, --all-roles, --all-tables, --all-functions, --all-mbeans, or a specific resource) to know what to invalidate. If resourceNames ends up empty after parsing all options, execute() throws IllegalArgumentException.","triggerScenarios":"Invoking `nodetool invalidatepermissionscache` with no resource flags at all (optionally only --role).","commonSituations":"Bare command run to 'flush everything' out of habit; automation templating drops all optional flags; users assume default-all behavior.","solutions":["Pass at least one resource option, e.g. --all-roles or --all-keyspaces","Use the wildcard option matching the scope you want (all-tables + keyspace, etc.)","Review nodetool help invalidatepermissionscache for the full option list"],"exampleFix":"// before\nnodetool invalidatepermissionscache\n// after\nnodetool invalidatepermissionscache --all-roles","handlingStrategy":"validation","validationCode":"const resourceFlags = ['--all-keyspaces','--all-roles','--all-tables','--all-functions','--all-mbeans','--keyspace','--table','--function','--functions-in-keyspace','--mbean'];\nif (!resourceFlags.some(f => args.includes(f))) throw new Error('No resource option specified');","typeGuard":null,"tryCatchPattern":"try { runNodetool('invalidatepermissionscache', ...args); } catch (IllegalArgumentException e) { /* require a resource flag */ }","preventionTips":["Always pass an explicit scope; never run the command bare","Document default scope decisions in runbooks","Include a resource flag in any automation template for this command"],"tags":["cli","validation","permissions"],"backgroundTag":"missing-required-option","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"}