{"record":{"id":"e3ac2d284dc3a6de","repo":"apache/hadoop","slug":"failed-to-get-file-status","errorCode":null,"errorMessage":"Failed to get file status","messagePattern":"Failed to get file status","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java","lineNumber":196,"sourceCode":"      return path;\n    }\n    return new Path(workDir, path);\n  }\n\n  /**\n   * Convenience method, so that we don't open a new connection when using this\n   * method from within another method. Otherwise every API invocation incurs\n   * the overhead of opening/closing a TCP connection.\n   * @throws IOException\n   */\n  private boolean exists(ChannelSftp channel, Path file) throws IOException {\n    try {\n      getFileStatus(channel, file);\n      return true;\n    } catch (FileNotFoundException fnfe) {\n      return false;\n    } catch (IOException ioe) {\n      throw new IOException(E_FILE_STATUS, ioe);\n    }\n  }\n\n  /**\n   * Convenience method, so that we don't open a new connection when using this\n   * method from within another method. Otherwise every API invocation incurs\n   * the overhead of opening/closing a TCP connection.\n   */\n  @SuppressWarnings(\"unchecked\")\n  private FileStatus getFileStatus(ChannelSftp client, Path file)\n      throws IOException {\n    FileStatus fileStat = null;\n    Path workDir;\n    try {\n      workDir = new Path(client.pwd());\n    } catch (SftpException e) {\n      throw new IOException(e);\n    }","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java#L178-L214","documentation":"Error \"Failed to get file status\" thrown in apache/hadoop.","triggerScenarios":"Thrown by SFTPFileSystem when the underlying ChannelSftp.stat/lstat call fails while retrieving file status, e.g. session dropped or server error.","commonSituations":"See trigger scenarios.","solutions":["Verify the remote path exists and the SFTP session is connected before calling getFileStatus.","Check permissions on the remote path; inspect the nested exception for the SFTP error code."],"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"}