apache/hadoop · error · IllegalArgumentException

Invalid parameter range: {name} = {value} > {max}

Error message

Invalid parameter range: {name} = {value} > {max}

What it means

The upper-bound half of LongParam.checkRange (LongParam.java:33-39): a non-null long parameter value above the subclass maximum throws this IllegalArgumentException (HTTP 400). No built-in WebHDFS LongParam subclass in this repository declares a max (offset, length, newlength, blocksize, times, quotas all pass null for max), so in a stock cluster this message indicates a custom LongParam subclass or a vendor fork that added an upper limit.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/resources/LongParam.java:37

/** Long parameter. */
abstract class LongParam extends Param<Long, LongParam.Domain> {
  LongParam(final Domain domain, final Long value, final Long min,
            final Long max) {
    super(domain, value);
    checkRange(min, max);
  }

  private void checkRange(final Long min, final Long max) {
    if (value == null) {
      return;
    }
    if (min != null && value < min) {
      throw new IllegalArgumentException("Invalid parameter range: " + getName()
          + " = " + domain.toString(value) + " < " + domain.toString(min));
    }
    if (max != null && value > max) {
      throw new IllegalArgumentException("Invalid parameter range: " + getName()
          + " = " + domain.toString(value) + " > " + domain.toString(max));
    }
  }

  @Override
  public String toString() {
    return getName() + "=" + domain.toString(getValue());
  }

  /** @return the parameter value as a string */
  @Override
  public String getValueString() {
    return domain.toString(getValue());
  }

  /** The domain of the parameter. */
  static final class Domain extends Param.Domain<Long> {
    /** The radix of the number. */

View on GitHub (pinned to 2add963021)

Solutions

  1. Read the message — it prints the parameter name, your value, and the enforced max; lower the value accordingly.
  2. Omit the parameter to use the server-side default instead of pushing a boundary value.
  3. If this is your subclass, validate/clamp before calling super(domain, value, min, max).

Example fix

// before
new MaxStreamParam(totalBytes);        // totalBytes > custom max
// after
new MaxStreamParam(Math.min(totalBytes, MaxStreamParam.MAX_VALUE));
Defensive patterns

Strategy: validation

Validate before calling

// for custom LongParam subclasses with a max
long checked = userValue > MAX ? MAX : userValue;
new MyLongParam(checked);

Type guard

static boolean withinMax(Long value, Long max) { return value == null || max == null || value <= max; }

Prevention

When it happens

Trigger: Constructing a custom LongParam with a max (e.g. a throttled max-bytes parameter) and exceeding it; running against a repackaged hadoop-hdfs-client that caps length or blocksize.

Common situations: In-house extensions of the parameter framework with upper bounds; vendor distributions with stricter validation; unit tests instantiating LongParam subclasses directly with (domain, value, min, max).

Related errors


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