{"record":{"id":"d0399c65ffc29080","repo":"apache/hadoop","slug":"expected-block-file-at-f-does-not-exist","errorCode":null,"errorMessage":"Expected block file at ${f} does not exist.","messagePattern":"Expected block file at (.+?) does not exist\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplica.java","lineNumber":440,"sourceCode":"  /**\n   * Get input stream for a local file and optionally seek to the offset.\n   * @param f path to the file\n   * @param seekOffset offset to seek\n   * @return input stream for read\n   * @throws IOException\n   */\n  private FileInputStream getDataInputStream(File f, long seekOffset)\n      throws IOException {\n    FileInputStream fis;\n    final FileIoProvider fileIoProvider = getFileIoProvider();\n    if (NativeIO.isAvailable()) {\n      fis = fileIoProvider.getShareDeleteFileInputStream(\n          getVolume(), f, seekOffset);\n    } else {\n      try {\n        fis = fileIoProvider.openAndSeek(getVolume(), f, seekOffset);\n      } catch (FileNotFoundException fnfe) {\n        throw new IOException(\"Expected block file at \" + f +\n            \" does not exist.\");\n      }\n    }\n    return fis;\n  }\n\n  /**\n   *  Get pin status of a file by checking the sticky bit.\n   * @param localFS local file system\n   * @param path path to be checked\n   * @return true if the file is pinned with sticky bit\n   * @throws IOException\n   */\n  public boolean getPinning(LocalFileSystem localFS, Path path) throws\n      IOException {\n    boolean stickyBit =\n        localFS.getFileStatus(path).getPermission().getStickyBit();\n    return stickyBit;","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplica.java#L422-L458","documentation":"Error \"Expected block file at ${f} does not exist.\" thrown in apache/hadoop.","triggerScenarios":"A block file expected at a given path is missing on disk, e.g., after manual deletion, volume failure, or filesystem corruption.","commonSituations":"The expected block data file is missing from disk, pointing to deletion outside HDFS or disk failure. Run fsck and check the volume for errors.","solutions":["Check whether the block file was deleted out-of-band or the volume failed; run a volume check (the DataNode's DatasetVolumeChecker should mark the volume failed).","If the replica is gone, report the block as missing so the NameNode re-replicates it; restore from another replica if needed."],"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"}