apache/hadoop · error · IllegalArgumentException

Unknown Command: {}

Error message

Unknown Command: {}

What it means

Error "Unknown Command: {}" thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java:451

        manageNameservice(subcmd, nsId);
      } else if ("-getDisabledNameservices".equals(cmd)) {
        getDisabledNameservices();
      } else if ("-refresh".equals(cmd)) {
        refresh(address);
      } else if ("-refreshRouterArgs".equals(cmd)) {
        exitCode = genericRefresh(argv, i);
      } else if ("-refreshSuperUserGroupsConfiguration".equals(cmd)) {
        exitCode = refreshSuperUserGroupsConfiguration();
      } else if ("-refreshCallQueue".equals(cmd)) {
        exitCode = refreshCallQueue();
      } else if (ADD_ALL_COMMAND.equals(cmd)) {
        if (addAllMount(argv, i)) {
          System.out.println("Successfully added all mount points ");
        } else {
          exitCode = -1;
        }
      } else {
        throw new IllegalArgumentException("Unknown Command: " + cmd);
      }
    } catch (IllegalArgumentException arge) {
      debugException = arge;
      exitCode = -1;
      System.err.println(cmd.substring(1) + ": " + arge.getLocalizedMessage());
      printUsage(cmd);
    } catch (RemoteException e) {
      // This is an error returned by the server.
      // Print out the first line of the error message, ignore the stack trace.
      exitCode = -1;
      debugException = e;
      try {
        String[] content;
        content = e.getLocalizedMessage().split("\n");
        System.err.println(cmd.substring(1) + ": " + content[0]);
        e.printStackTrace();
      } catch (Exception ex) {
        System.err.println(cmd.substring(1) + ": " + ex.getLocalizedMessage());

View on GitHub (pinned to 2add963021)

Solutions

  1. Check the command name against dfsrouteradmin -usage / -help output.
  2. Fix spelling of the subcommand (e.g. -add, -rm, -ls, -setQuota).

When it happens

Trigger: RouterAdmin received a command token it does not recognize.

Common situations: Typo in the dfsrouteradmin subcommand or use of a command from a different tool (e.g. hdfs dfsadmin syntax).


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/f8a9357a101d95da. Report an issue: GitHub.