{"record":{"id":"76355c2ef71d0c36","repo":"apache/hadoop","slug":"too-many-arguments-max-2-argument-allowed","errorCode":null,"errorMessage":"Too many arguments, Max=2 argument allowed","messagePattern":"Too many arguments, Max=2 argument allowed","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java","lineNumber":230,"sourceCode":"      return \"\\t[-refreshRouterArgs <host:ipc_port> <key> [arg1..argn]]\";\n    } else if (cmd.equals(\"-refreshSuperUserGroupsConfiguration\")) {\n      return \"\\t[-refreshSuperUserGroupsConfiguration]\";\n    } else if (cmd.equals(\"-refreshCallQueue\")) {\n      return \"\\t[-refreshCallQueue]\";\n    } else if (cmd.equals(DUMP_COMMAND)) {\n      return \"\\t[\" + DUMP_COMMAND + \"]\";\n    }\n    return getUsage(null);\n  }\n\n  /**\n   * Usage: validates the maximum number of arguments for a command.\n   * @param arg List of command line parameters.\n   */\n  private void validateMax(String[] arg) {\n    if (arg[0].equals(\"-ls\")) {\n      if (arg.length > 3) {\n        throw new IllegalArgumentException(\n            \"Too many arguments, Max=2 argument allowed\");\n      }\n    } else if (arg[0].equals(\"-getDestination\")) {\n      if (arg.length > 2) {\n        throw new IllegalArgumentException(\n            \"Too many arguments, Max=1 argument allowed only\");\n      }\n    } else if (arg[0].equals(\"-safemode\")) {\n      if (arg.length > 2) {\n        throw new IllegalArgumentException(\n            \"Too many arguments, Max=1 argument allowed only\");\n      }\n    } else if (arg[0].equals(\"-nameservice\")) {\n      if (arg.length > 3) {\n        throw new IllegalArgumentException(\n            \"Too many arguments, Max=2 arguments allowed\");\n      }\n    } else if (arg[0].equals(\"-getDisabledNameservices\")) {","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java#L212-L248","documentation":"Error \"Too many arguments, Max=2 argument allowed\" thrown in apache/hadoop.","triggerScenarios":"RouterAdmin argument parsing: more than 2 positional arguments supplied to a subcommand.","commonSituations":"User added extra parameters or unquoted paths to a mount-table subcommand.","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."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}