{"record":{"id":"ca9aefc32118f70b","repo":"apache/hadoop","slug":"file-does-not-exist-ca9aef","errorCode":null,"errorMessage":"File does not exist.","messagePattern":"File does not exist\\.","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java","lineNumber":1216,"sourceCode":"      @Override\n      public Void next(final FileSystem fs, final Path p)\n          throws IOException {\n        // setQuotaByStorageType is not defined in FileSystem, so we only can\n        // resolve within this DFS\n        return doCall(p);\n      }\n    }.resolve(this, absF);\n  }\n\n  private FileStatus[] listStatusInternal(Path p) throws IOException {\n    String src = getPathName(p);\n\n    // fetch the first batch of entries in the directory\n    DirectoryListing thisListing = dfs.listPaths(\n        src, HdfsFileStatus.EMPTY_NAME);\n\n    if (thisListing == null) { // the directory does not exist\n      throw new FileNotFoundException(\"File \" + p + \" does not exist.\");\n    }\n\n    HdfsFileStatus[] partialListing = thisListing.getPartialListing();\n    if (!thisListing.hasMore()) { // got all entries of the directory\n      FileStatus[] stats = new FileStatus[partialListing.length];\n      for (int i = 0; i < partialListing.length; i++) {\n        stats[i] = partialListing[i].makeQualified(getUri(), p);\n      }\n      statistics.incrementReadOps(1);\n      storageStatistics.incrementOpCounter(OpType.LIST_STATUS);\n      return stats;\n    }\n\n    // The directory size is too big that it needs to fetch more\n    // estimate the total number of entries in the directory\n    int totalNumEntries =\n        partialListing.length + thisListing.getRemainingEntries();\n    ArrayList<FileStatus> listing =","sourceCodeStart":1198,"sourceCodeEnd":1234,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L1198-L1234","documentation":"Error \"File does not exist.\" thrown in apache/hadoop.","triggerScenarios":"An operation requires an existing file (for example opening a path handle or reading), but the named file does not exist on the NameNode.","commonSituations":"See trigger scenarios.","solutions":["Verify the file exists with fs.exists(path) before the operation.","Check the path for typos and confirm it was not deleted by another process."],"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"}