apache/hadoop · error · IllegalArgumentException

Invalid empty argument

Error message

Invalid empty argument

What it means

Error "Invalid empty argument" thrown in apache/hadoop.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/find/NumberExpression.java:86

    this.mode = mode;
  }

  @Override
  public void prepare() throws IOException {
    parseArgument(getArgument(1));
  }

  /**
   * Parse the argument string to extract the numeric argument.
   *
   * @param arg String to be parsed
   * @throws IllegalArgumentException if there is a problem parsing the argument
   */
  protected void parseArgument(String arg) throws IllegalArgumentException {
    if (arg == null) {
      throw new IllegalArgumentException("Invalid null argument");
    } else if (arg.isEmpty()) {
      throw new IllegalArgumentException("Invalid empty argument");
    }
    switch (mode) {
    case ROUND_UP:
      if (arg.startsWith("+")) {
        min = (Long.parseLong(arg.substring(1)) * units) + 1L;
      } else if (arg.startsWith("-")) {
        max = (Long.parseLong(arg.substring(1)) * units) - units;
      } else {
        max = Long.parseLong(arg) * units;
        min = max - units + 1L;
      }
      break;
    case ROUND_DOWN:
      if (arg.startsWith("+")) {
        min = (Long.parseLong(arg.substring(1)) * units) + units;
      } else if (arg.startsWith("-")) {
        max = (Long.parseLong(arg.substring(1)) * units) - 1L;
      } else {

View on GitHub (pinned to 2add963021)

Solutions

  1. Provide a non-empty numeric argument for the find expression.
  2. Check the command line for an empty value after the operator.

When it happens

Trigger: Thrown by find numeric expressions (e.g. -size, -mtime) when an empty string is passed where a number is required.

Common situations: See trigger scenarios.


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