{"record":{"id":"af08f66ed7f071f7","repo":"apache/hadoop","slug":"invalid-parameter-range-name-value-max-af08f6","errorCode":null,"errorMessage":"Invalid parameter range: {name} = {value} > {max}","messagePattern":"Invalid parameter range: (.+?) = (.+?) > (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/resources/LongParam.java","lineNumber":37,"sourceCode":"\n/** Long parameter. */\nabstract class LongParam extends Param<Long, LongParam.Domain> {\n  LongParam(final Domain domain, final Long value, final Long min,\n            final Long max) {\n    super(domain, value);\n    checkRange(min, max);\n  }\n\n  private void checkRange(final Long min, final Long max) {\n    if (value == null) {\n      return;\n    }\n    if (min != null && value < min) {\n      throw new IllegalArgumentException(\"Invalid parameter range: \" + getName()\n          + \" = \" + domain.toString(value) + \" < \" + domain.toString(min));\n    }\n    if (max != null && value > max) {\n      throw new IllegalArgumentException(\"Invalid parameter range: \" + getName()\n          + \" = \" + domain.toString(value) + \" > \" + domain.toString(max));\n    }\n  }\n\n  @Override\n  public String toString() {\n    return getName() + \"=\" + domain.toString(getValue());\n  }\n\n  /** @return the parameter value as a string */\n  @Override\n  public String getValueString() {\n    return domain.toString(getValue());\n  }\n\n  /** The domain of the parameter. */\n  static final class Domain extends Param.Domain<Long> {\n    /** The radix of the number. */","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/resources/LongParam.java#L19-L55","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Read the message — it prints the parameter name, your value, and the enforced max; lower the value accordingly.","Omit the parameter to use the server-side default instead of pushing a boundary value.","If this is your subclass, validate/clamp before calling super(domain, value, min, max)."],"exampleFix":"// before\nnew MaxStreamParam(totalBytes);        // totalBytes > custom max\n// after\nnew MaxStreamParam(Math.min(totalBytes, MaxStreamParam.MAX_VALUE));","handlingStrategy":"validation","validationCode":"// for custom LongParam subclasses with a max\nlong checked = userValue > MAX ? MAX : userValue;\nnew MyLongParam(checked);","typeGuard":"static boolean withinMax(Long value, Long max) { return value == null || max == null || value <= max; }","tryCatchPattern":null,"preventionTips":["Share the max constant between client validation and the server-side param class.","Log and clamp boundary attempts instead of silently sending oversized values."],"tags":["webhdfs","query-param","range-validation","long","hdfs"],"backgroundTag":"query-parameter-out-of-range","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}