{"record":{"id":"008a6f490610bb44","repo":"apache/hadoop","slug":"invalid-filestatus","errorCode":null,"errorMessage":"Invalid FileStatus ","messagePattern":"Invalid FileStatus ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java","lineNumber":492,"sourceCode":"      return null;\n    }\n    return ((HdfsFileStatus) fileStatus).getErasureCodingPolicy().getName();\n  }\n\n  /**\n   * Create a handle to an HDFS file.\n   * @param st HdfsFileStatus instance from NameNode\n   * @param opts Standard handle arguments\n   * @throws IllegalArgumentException If the FileStatus instance refers to a\n   * directory, symlink, or another namesystem.\n   * @throws UnsupportedOperationException If opts are not specified or both\n   * data and location are not allowed to change.\n   * @return A handle to the file.\n   */\n  @Override\n  protected HdfsPathHandle createPathHandle(FileStatus st, HandleOpt... opts) {\n    if (!(st instanceof HdfsFileStatus)) {\n      throw new IllegalArgumentException(\"Invalid FileStatus \"\n          + st.getClass().getSimpleName());\n    }\n    if (st.isDirectory() || st.isSymlink()) {\n      throw new IllegalArgumentException(\"PathHandle only available for files\");\n    }\n    if (!getUri().getAuthority().equals(st.getPath().toUri().getAuthority())) {\n      throw new IllegalArgumentException(\"Wrong FileSystem: \" + st.getPath());\n    }\n    HandleOpt.Data data = HandleOpt.getOpt(HandleOpt.Data.class, opts)\n        .orElse(HandleOpt.changed(false));\n    HandleOpt.Location loc = HandleOpt.getOpt(HandleOpt.Location.class, opts)\n        .orElse(HandleOpt.moved(false));\n\n    HdfsFileStatus hst = (HdfsFileStatus) st;\n    final Path p;\n    final Optional<Long> inodeId;\n    if (loc.allowChange()) {\n      p = DFSUtilClient.makePathFromFileId(hst.getFileId());","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L474-L510","documentation":"Error \"Invalid FileStatus \" thrown in apache/hadoop.","triggerScenarios":"open(PathHandle) is given a FileStatus whose path handle is missing or malformed, so the handle-based open cannot proceed.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null FileStatus obtained from the same DistributedFileSystem.","Refresh the FileStatus via getFileStatus if it may be stale or invalid."],"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"}