apache/cassandra · error · IllegalArgumentException
No resource options specified
Error message
No resource options specified
What it means
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.
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
Example fix
// before nodetool invalidatepermissionscache // after nodetool invalidatepermissionscache --all-roles
Defensive patterns
Strategy: validation
Validate before calling
const resourceFlags = ['--all-keyspaces','--all-roles','--all-tables','--all-functions','--all-mbeans','--keyspace','--table','--function','--functions-in-keyspace','--mbean'];
if (!resourceFlags.some(f => args.includes(f))) throw new Error('No resource option specified'); Try / catch
try { runNodetool('invalidatepermissionscache', ...args); } catch (IllegalArgumentException e) { /* require a resource flag */ } Prevention
- 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
When it happens
Trigger: Invoking `nodetool invalidatepermissionscache` with no resource flags at all (optionally only --role).
Common situations: Bare command run to 'flush everything' out of habit; automation templating drops all optional flags; users assume default-all behavior.
Understand the failure class
Background: "Must pass :limit option" / "Missing required option" — required option errors explained — this error's family across 41 libraries.
Related errors
- --all-tables option should be passed along with --keyspace…
- --table option should be passed along with --keyspace option
- argument for top must be a positive integer.
- arguments for -F are json,yaml only.
- Can not parse replication factor
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/baed2af92919d220.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/tools/nodetool/InvalidatePermissionsCache.java:168
if (StringUtils.isNotEmpty(function))
if (StringUtils.isNotEmpty(functionsInKeyspace))
resourceNames.add(constructFunctionResource(functionsInKeyspace, function));
else
throw new IllegalArgumentException("--function option should be passed along with --functions-in-keyspace option");
else
if (StringUtils.isNotEmpty(functionsInKeyspace))
resourceNames.add(FunctionResource.keyspace(functionsInKeyspace).getName());
// MBeans Resources
if (allMBeans)
resourceNames.add(JMXResource.root().getName());
if (StringUtils.isNotEmpty(mBean))
resourceNames.add(JMXResource.mbean(mBean).getName());
if (resourceNames.isEmpty())
throw new IllegalArgumentException("No resource options specified");
for (String resourceName : resourceNames)
probe.invalidatePermissionsCache(roleName, resourceName);
}
}
private String constructFunctionResource(String functionsInKeyspace, String function) {
try
{
return FunctionResource.fromName("functions/" + functionsInKeyspace + '/' + function).getName();
} catch (ConfigurationException e)
{
throw new IllegalArgumentException("An error was encountered when looking up function definition: " + e.getMessage());
}
}
}View on GitHub (pinned to 88fd0f6a0e)