apache/hadoop · error · HadoopIllegalArgumentException

Too many arguments.

Error message

Too many arguments.

What it means

Error "Too many arguments." thrown in apache/hadoop.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java:98

        }
        Preconditions.checkArgument(encoding != null,
            "Invalid/unsupported encoding option specified: " + en);
      }

      boolean r = StringUtils.popOption("-R", args);
      setRecursive(r);
      dump = StringUtils.popOption("-d", args);

      if (!dump && name == null) {
        throw new HadoopIllegalArgumentException(
            "Must specify '-n name' or '-d' option.");
      }

      if (args.isEmpty()) {
        throw new HadoopIllegalArgumentException("<path> is missing.");
      }
      if (args.size() > 1) {
        throw new HadoopIllegalArgumentException("Too many arguments.");
      }
    }

    @Override
    protected void processPath(PathData item) throws IOException {
      out.println("# file: " + item);
      if (dump) {
        Map<String, byte[]> xattrs = item.fs.getXAttrs(item.path);
        if (xattrs != null) {
          Iterator<Entry<String, byte[]>> iter = xattrs.entrySet().iterator();
          while(iter.hasNext()) {
            Entry<String, byte[]> entry = iter.next();
            printXAttr(entry.getKey(), entry.getValue());
          }
        }
      } else {
        byte[] value = item.fs.getXAttr(item.path, name);
        printXAttr(name, value);

View on GitHub (pinned to 2add963021)

Solutions

  1. Remove the extra arguments; only one path is accepted after the options.
  2. Quote paths containing spaces so they are parsed as a single argument.

When it happens

Trigger: Thrown by xattr shell commands when more positional arguments than the command accepts are given.

Common situations: See trigger scenarios.


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