apache/cassandra · error · IllegalArgumentException

--all-tables option should be passed along with --keyspace…

Error message

--all-tables option should be passed along with --keyspace option

What it means

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.

Solutions

  1. Add the --keyspace option: nodetool invalidatepermissionscache --all-tables --keyspace <ks>
  2. If all keyspaces are intended, use --all-keyspaces instead so the root/all-keyspaces resource is added
  3. Verify the command line via nodetool help invalidatepermissionscache

Example fix

// before
nodetool invalidatepermissionscache --all-tables
// after
nodetool invalidatepermissionscache --all-tables --keyspace my_ks
Defensive patterns

Strategy: validation

Validate before calling

if (args.includes('--all-tables') && !args.includes('--keyspace')) throw new Error('--all-tables requires --keyspace');

Try / catch

try { runNodetool('invalidatepermissionscache', ...args); } catch (IllegalArgumentException e) { /* inspect message, re-run with --keyspace */ }

Prevention

When it happens

Trigger: Running `nodetool invalidatepermissionscache --all-tables` (or invoking execute() with allTables=true and keyspace empty) triggers the error.

Common situations: Operators scripting permission-cache refreshes forget the --keyspace flag; copy-pasted commands drop the keyspace argument; documentation examples omit it.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/e27fe4b7cfbfe673. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/nodetool/InvalidatePermissionsCache.java:129

                    && !allFunctions && StringUtils.isEmpty(functionsInKeyspace) && StringUtils.isEmpty(function)
                    && !allMBeans && StringUtils.isEmpty(mBean),
                    "No resource options allowed without a <role> being specified");

            probe.invalidatePermissionsCache();
        }
        else
        {
            List<String> resourceNames = new ArrayList<>();

            // Data Resources
            if (allKeyspaces)
                resourceNames.add(DataResource.root().getName());

            if (allTables)
                if (StringUtils.isNotEmpty(keyspace))
                    resourceNames.add(DataResource.allTables(keyspace).getName());
                else
                    throw new IllegalArgumentException("--all-tables option should be passed along with --keyspace option");

            if (StringUtils.isNotEmpty(table))
                if (StringUtils.isNotEmpty(keyspace))
                    resourceNames.add(DataResource.table(keyspace, table).getName());
                else
                    throw new IllegalArgumentException("--table option should be passed along with --keyspace option");

            if (StringUtils.isNotEmpty(keyspace) && !allTables && StringUtils.isEmpty(table))
                resourceNames.add(DataResource.keyspace(keyspace).getName());

            // Roles Resources
            if (allRoles)
                resourceNames.add(RoleResource.root().getName());

            if (StringUtils.isNotEmpty(role))
                resourceNames.add(RoleResource.role(role).getName());

            // Function Resources

View on GitHub (pinned to 88fd0f6a0e)