{"record":{"id":"fb230f94749a68ba","repo":"apache/druid","slug":"valid-values-for-maxlistinglength-are-between-d","errorCode":null,"errorMessage":"valid values for maxListingLength are between [%d, %d]","messagePattern":"valid values for maxListingLength are between \\[(.+?), (.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException (IAE)","httpStatus":null,"severity":"error","filePath":"extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3InputDataConfig.java","lineNumber":58,"sourceCode":"   * https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html#API_DeleteObjects_RequestSyntax\n   */\n  @VisibleForTesting\n  static final int MAX_LISTING_LENGTH_MAX = 1000;\n\n  /**\n   * The maximum number of input files matching a given prefix to retrieve\n   * or delete from Amazon S3 at a time.\n   */\n  @JsonProperty\n  @Min(MAX_LISTING_LENGTH_MIN)\n  @Max(MAX_LISTING_LENGTH_MAX)\n  private int maxListingLength = MAX_LISTING_LENGTH_MAX;\n\n  @VisibleForTesting\n  public void setMaxListingLength(int maxListingLength)\n  {\n    if (maxListingLength < MAX_LISTING_LENGTH_MIN || maxListingLength > MAX_LISTING_LENGTH_MAX) {\n      throw new IAE(\"valid values for maxListingLength are between [%d, %d]\", MAX_LISTING_LENGTH_MIN,\n                    MAX_LISTING_LENGTH_MAX\n      );\n    }\n    this.maxListingLength = maxListingLength;\n  }\n\n  public int getMaxListingLength()\n  {\n    return maxListingLength;\n  }\n}\n","sourceCodeStart":40,"sourceCodeEnd":70,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3InputDataConfig.java#L40-L70","documentation":"S3InputDataConfig.setMaxListingLength validates that maxListingLength lies within [MAX_LISTING_LENGTH_MIN, MAX_LISTING_LENGTH_MAX] and throws IAE otherwise. This property caps the page size of S3 list operations (e.g. task log listing).","triggerScenarios":"Setting druid.storage.s3.maxListingLength (or calling the setter, e.g. from S3TaskLogs.getS3TaskLogs configuration) to a value below the minimum or above the maximum.","commonSituations":"Copy-pasted config with 0 or negative value; attempts to set an arbitrarily large page size to reduce list calls; typos like 1000000 exceeding the allowed max.","solutions":["Set maxListingLength within the documented min/max range (e.g. 100..1000).","Remove the property to use the default (MAX_LISTING_LENGTH_MAX).","Check for unit mistakes (e.g. using byte values instead of page size)."],"exampleFix":"// before\ndruid.storage.s3.maxListingLength=0\n// after\ndruid.storage.s3.maxListingLength=500","handlingStrategy":"validation","validationCode":"int v = Integer.parseInt(props.getProperty(\"druid.storage.s3.maxListingLength\"));\nif (v < 1 || v > 1000) throw new IllegalArgumentException(\"maxListingLength out of range: \" + v);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep maxListingLength within documented bounds","Omit the property to use the safe default","Validate configs in CI before deployment"],"tags":["config","validation","s3","argument"],"backgroundTag":"value-out-of-range","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}