apache/cassandra · warning · CommandLine.ParameterException

Unknown subcommand '

Error message

Unknown subcommand '

What it means

The Help command walks the list of command names given on the command line, resolving each against the parent command's subcommands. When a name does not resolve, it throws CommandLine.ParameterException("Unknown subcommand '<name>'."). The message is truncated in this index because the name is concatenated at runtime.

Source

Thrown at src/java/org/apache/cassandra/tools/nodetool/Help.java:95

                                              colorScheme;

        if (commands == null)
        {
            // If the parent command is the top-level command, print help for the top-level command.
            printTopCommandUsage(parent, colors, out);
            return;
        }

        if (parent.isAbbreviatedSubcommandsAllowed())
            throw new CommandLine.ParameterException(parent, "Abbreviated subcommands are not allowed.");

        // Print help for the last command in the list of commands.
        CommandLine subcommand = parent;
        for (String command : commands)
        {
            subcommand = subcommand.getSubcommands().get(command);
            if (subcommand == null)
                throw new CommandLine.ParameterException(parent, "Unknown subcommand '" + command + "'.", null, command);
        }

        subcommand.usage(out, colors);
    }

    public static void printTopCommandUsage(CommandLine command, CommandLine.Help.ColorScheme colors, PrintWriter writer)
    {
        if (command == null)
            return;

        StringBuilder sb = new StringBuilder();
        CommandLine.Help help = command.getHelpFactory().create(command.getCommandSpec(), colors);
        if (!(help instanceof CassandraCliHelpLayout))
        {
            command.usage(writer, colors);
            return;
        }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Run `nodetool help` alone to list valid subcommands and check spelling
  2. Verify the subcommand exists in your Cassandra version's nodetool
  3. If scripting, validate command names against `nodetool help` output before invoking

Example fix

// before
nodetool help compactoinstats   # typo
// after
nodetool help compactionstats
Defensive patterns

Strategy: validation

Validate before calling

# check the subcommand exists before asking for its help
nodetool help | grep -qw "$SUBCMD" && nodetool help "$SUBCMD"

Try / catch

try { cmd.execute(args); } catch (CommandLine.ParameterException e) { System.err.println(e.getMessage()); cmd.usage(System.err); }

Prevention

When it happens

Trigger: `nodetool help foo` where 'foo' is not a registered subcommand; typos; calling help for a command that exists only in newer Cassandra versions.

Common situations: Typo in command name; using a command name from a different Cassandra version's nodetool; assuming tool names from other projects (e.g. `nodetool repair` variants that don't exist).

Related errors


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