{"record":{"id":"1001d2591daba83d","repo":"apache/hadoop","slug":"can-t-find-startafter","errorCode":null,"errorMessage":"Can't find startAfter {}","messagePattern":"Can't find startAfter (.+?)","errorType":"exception","errorClass":"DirectoryListingStartAfterNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirStatAndListingOp.java","lineNumber":71,"sourceCode":"\nclass FSDirStatAndListingOp {\n  static DirectoryListing getListingInt(FSDirectory fsd, FSPermissionChecker pc,\n      final String srcArg, byte[] startAfter, boolean needLocation)\n      throws IOException {\n    final INodesInPath iip = fsd.resolvePath(pc, srcArg, DirOp.READ);\n\n    // Get file name when startAfter is an INodePath.  This is not the\n    // common case so avoid any unnecessary processing unless required.\n    if (startAfter.length > 0 && startAfter[0] == Path.SEPARATOR_CHAR) {\n      final String startAfterString = DFSUtil.bytes2String(startAfter);\n      if (FSDirectory.isReservedName(startAfterString)) {\n        try {\n          byte[][] components = INode.getPathComponents(startAfterString);\n          components = FSDirectory.resolveComponents(components, fsd);\n          startAfter = components[components.length - 1];\n        } catch (IOException e) {\n          // Possibly the inode is deleted\n          throw new DirectoryListingStartAfterNotFoundException(\n              \"Can't find startAfter \" + startAfterString);\n        }\n      }\n    }\n\n    if (fsd.isPermissionEnabled()) {\n      if (iip.getLastINode() != null && iip.getLastINode().isDirectory()) {\n        fsd.checkPathAccess(pc, iip, FsAction.READ_EXECUTE);\n      }\n    }\n    return getListing(fsd, iip, startAfter, needLocation);\n  }\n\n  /**\n   * Get the file info for a specific file.\n   * @param fsd The FS directory\n   * @param pc The permission checker\n   * @param srcArg The string representation of the path to the file","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirStatAndListingOp.java#L53-L89","documentation":"Error \"Can't find startAfter {}\" thrown in apache/hadoop.","triggerScenarios":"Listing a directory with a startAfter entry name that cannot be found in that directory.","commonSituations":"See trigger scenarios.","solutions":["Ensure the startAfter entry exists in the directory listing; list the directory without startAfter first to find a valid entry name."],"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-23T01:17:44.959Z"}