apache/hadoop · error · IOException

Failed to get file status

Error message

Failed to get file status

What it means

Sentinel wrapper from SFTPFileSystem.exists: getFileStatus on the channel raised an IOException other than FileNotFoundException (channel failure, SSH error). The original error is wrapped under the constant 'Failed to get file status'.

Solutions

  1. Verify the remote path exists and the SFTP session is connected before calling getFileStatus.
  2. Check permissions on the remote path; inspect the nested exception for the SFTP error code.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown by SFTPFileSystem when the underlying ChannelSftp.stat/lstat call fails while retrieving file status, e.g. session dropped or server error.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/e3ac2d284dc3a6de. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java:196

      return path;
    }
    return new Path(workDir, path);
  }

  /**
   * Convenience method, so that we don't open a new connection when using this
   * method from within another method. Otherwise every API invocation incurs
   * the overhead of opening/closing a TCP connection.
   * @throws IOException
   */
  private boolean exists(ChannelSftp channel, Path file) throws IOException {
    try {
      getFileStatus(channel, file);
      return true;
    } catch (FileNotFoundException fnfe) {
      return false;
    } catch (IOException ioe) {
      throw new IOException(E_FILE_STATUS, ioe);
    }
  }

  /**
   * Convenience method, so that we don't open a new connection when using this
   * method from within another method. Otherwise every API invocation incurs
   * the overhead of opening/closing a TCP connection.
   */
  @SuppressWarnings("unchecked")
  private FileStatus getFileStatus(ChannelSftp client, Path file)
      throws IOException {
    FileStatus fileStat = null;
    Path workDir;
    try {
      workDir = new Path(client.pwd());
    } catch (SftpException e) {
      throw new IOException(e);
    }

View on GitHub (pinned to 2add963021)