apache/hadoop · error · IllegalArgumentException
Too many arguments, Max=2 argument allowed
Error message
Too many arguments, Max=2 argument allowed
What it means
Error "Too many arguments, Max=2 argument allowed" thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java:230
return "\t[-refreshRouterArgs <host:ipc_port> <key> [arg1..argn]]";
} else if (cmd.equals("-refreshSuperUserGroupsConfiguration")) {
return "\t[-refreshSuperUserGroupsConfiguration]";
} else if (cmd.equals("-refreshCallQueue")) {
return "\t[-refreshCallQueue]";
} else if (cmd.equals(DUMP_COMMAND)) {
return "\t[" + DUMP_COMMAND + "]";
}
return getUsage(null);
}
/**
* Usage: validates the maximum number of arguments for a command.
* @param arg List of command line parameters.
*/
private void validateMax(String[] arg) {
if (arg[0].equals("-ls")) {
if (arg.length > 3) {
throw new IllegalArgumentException(
"Too many arguments, Max=2 argument allowed");
}
} else if (arg[0].equals("-getDestination")) {
if (arg.length > 2) {
throw new IllegalArgumentException(
"Too many arguments, Max=1 argument allowed only");
}
} else if (arg[0].equals("-safemode")) {
if (arg.length > 2) {
throw new IllegalArgumentException(
"Too many arguments, Max=1 argument allowed only");
}
} else if (arg[0].equals("-nameservice")) {
if (arg.length > 3) {
throw new IllegalArgumentException(
"Too many arguments, Max=2 arguments allowed");
}
} else if (arg[0].equals("-getDisabledNameservices")) {View on GitHub (pinned to 2add963021)
Solutions
- Pass at most 2 arguments to this dfsrouteradmin subcommand.
- Quote paths containing spaces so they count as a single argument.
- Run the command with -help to see its exact argument list.
When it happens
Trigger: RouterAdmin argument parsing: more than 2 positional arguments supplied to a subcommand.
Common situations: User added extra parameters or unquoted paths to a mount-table subcommand.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/76355c2ef71d0c36.
Report an issue: GitHub.