{"record":{"id":"8193844bcc5dd045","repo":"apache/hadoop","slug":"no-more-results-in-listing-of-listpath","errorCode":null,"errorMessage":"No more results in listing of <listPath>","messagePattern":"No more results in listing of <listPath>","errorType":"exception","errorClass":"NoSuchElementException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Listing.java","lineNumber":660,"sourceCode":"     * remote IO. For later requests, S3 will be queried, hence the calls\n     * may block or fail.\n     * @return the next object listing.\n     * @throws IOException if a query made of S3 fails.\n     * @throws NoSuchElementException if there is no more data to list.\n     */\n    @Override\n    @Retries.RetryTranslated\n    public S3ListResult next() throws IOException {\n      if (firstListing) {\n        // clear the firstListing flag for future calls.\n        firstListing = false;\n        // Calculating the result of last async list call.\n        objects = onceInTheFuture(\"listObjects()\", listPath.toString(), s3ListResultFuture);\n        fetchNextBatchAsyncIfPresent();\n      } else {\n        if (objectsPrev!= null && !objectsPrev.isTruncated()) {\n          // nothing more to request: fail.\n          throw new NoSuchElementException(\"No more results in listing of \"\n              + listPath);\n        }\n        // Calculating the result of last async list call.\n        objects = onceInTheFuture(\"listObjects()\", listPath.toString(), s3ListResultFuture);\n        // Requesting next batch of results.\n        fetchNextBatchAsyncIfPresent();\n        listingCount++;\n        LOG.debug(\"New listing status: {}\", this);\n      }\n      // Storing the current result to be used by hasNext() call.\n      objectsPrev = objects;\n      return objectsPrev;\n    }\n\n    /**\n     * If there are more listings present, call for next batch async.\n     */\n    private void fetchNextBatchAsyncIfPresent() {","sourceCodeStart":642,"sourceCodeEnd":678,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Listing.java#L642-L678","documentation":"Error \"No more results in listing of <listPath>\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Listing.java:660 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an internal listing-exhaustion signal; do not call next on an exhausted listing iterator."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}