{"record":{"id":"1c326393f469b71d","repo":"apache/hadoop","slug":"file-s-does-not-exist","errorCode":null,"errorMessage":"File %s does not exist.","messagePattern":"File (.+?) does not exist\\.","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java","lineNumber":233,"sourceCode":"    Path absolute = makeAbsolute(workDir, file);\n    Path parentPath = absolute.getParent();\n    if (parentPath == null) { // root directory\n      long length = -1; // Length of root directory on server not known\n      boolean isDir = true;\n      int blockReplication = 1;\n      long blockSize = DEFAULT_BLOCK_SIZE; // Block Size not known.\n      long modTime = -1; // Modification time of root directory not known.\n      Path root = new Path(\"/\");\n      return new FileStatus(length, isDir, blockReplication, blockSize,\n          modTime,\n          root.makeQualified(this.getUri(), this.getWorkingDirectory(client)));\n    }\n    String pathName = parentPath.toUri().getPath();\n    Vector<LsEntry> sftpFiles;\n    try {\n      sftpFiles = (Vector<LsEntry>) client.ls(pathName);\n    } catch (SftpException e) {\n      throw new FileNotFoundException(String.format(E_FILE_NOTFOUND, file));\n    }\n    if (sftpFiles != null) {\n      for (LsEntry sftpFile : sftpFiles) {\n        if (sftpFile.getFilename().equals(file.getName())) {\n          // file found in directory\n          fileStat = getFileStatus(client, sftpFile, parentPath);\n          break;\n        }\n      }\n      if (fileStat == null) {\n        throw new FileNotFoundException(String.format(E_FILE_NOTFOUND, file));\n      }\n    } else {\n      throw new FileNotFoundException(String.format(E_FILE_NOTFOUND, file));\n    }\n    return fileStat;\n  }\n","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java#L215-L251","documentation":"Error \"File %s does not exist.\" thrown in apache/hadoop.","triggerScenarios":"Thrown by SFTPFileSystem.open when the requested file path does not exist on the SFTP server.","commonSituations":"See trigger scenarios.","solutions":["Verify the file path exists on the SFTP server before the operation.","Create the file first or correct the path being opened."],"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"}