{"record":{"id":"6befcfa777ecc5a7","repo":"apache/hadoop","slug":"does-not-exist","errorCode":null,"errorMessage":"{} does not exist.","messagePattern":"(.+?) 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/namenode/FSNamesystem.java","lineNumber":6038,"sourceCode":"    }\n\n    if (file.isWithSnapshot() &&\n        file.getFileWithSnapshotFeature().isCurrentFileDeleted()) {\n      return true;\n    }\n    return false;\n  }\n\n  private INodeFile checkUCBlock(ExtendedBlock block,\n      String clientName) throws IOException {\n    assert hasWriteLock(RwLockMode.GLOBAL);\n    checkNameNodeSafeMode(\"Cannot get a new generation stamp and an \"\n        + \"access token for block \" + block);\n    \n    // check stored block state\n    BlockInfo storedBlock = getStoredBlock(ExtendedBlock.getLocalBlock(block));\n    if (storedBlock == null) {\n      throw new IOException(block + \" does not exist.\");\n    }\n    if (storedBlock.getBlockUCState() != BlockUCState.UNDER_CONSTRUCTION) {\n      throw new IOException(\"Unexpected BlockUCState: \" + block\n          + \" is \" + storedBlock.getBlockUCState()\n          + \" but not \" + BlockUCState.UNDER_CONSTRUCTION);\n    }\n    \n    // check file inode\n    final INodeFile file = getBlockCollection(storedBlock);\n    if (file == null || !file.isUnderConstruction() || isFileDeleted(file)) {\n      throw new IOException(\"The file \" + storedBlock + \n          \" belonged to does not exist or it is not under construction.\");\n    }\n    \n    // check lease\n    if (clientName == null\n        || !clientName.equals(file.getFileUnderConstructionFeature()\n            .getClientName())) {","sourceCodeStart":6020,"sourceCodeEnd":6056,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L6020-L6056","documentation":"checkUCBlock, which validates blocks for generation-stamp updates during pipeline recovery, could not find the block in the NameNode's blocks map and throws IOException stating the block does not exist. There is no block state to update, so recovery is impossible.","triggerScenarios":"updateBlock/nextGenerationStamp referencing a block the NameNode does not know: the owning file was deleted, the block was invalidated by an earlier recovery, or the block pool id is wrong.","commonSituations":"A client retrying pipeline recovery after the file was deleted or its lease was taken over; cross-cluster block ids from mixed configurations.","solutions":["Verify the file still exists and its last block id via getBlockLocations before retrying","If the file was deleted, abandon the recovery","Otherwise restart the write: re-open (append) to obtain a fresh block allocation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"LocatedBlocks lbs = dfs.getClient().getLocatedBlocks(path, 0);\nboolean known = lbs.getLocatedBlocks().stream()\n    .anyMatch(lb -> lb.getBlock().getBlockId() == block.getBlockId());\nif (!known) { /* block unknown: refresh or abandon */ }","typeGuard":null,"tryCatchPattern":"try {\n  updateBlock(block, clientName, ...);\n} catch (IOException e) {\n  if (e.getMessage().contains(\"does not exist.\") && !fs.exists(path)) {\n    return; // file deleted: nothing to recover\n  }\n  throw e;\n}","preventionTips":["Re-locate the last block before any recovery retry","Abandon recovery once the owning file is gone"],"tags":["hdfs","namenode","block-not-found","pipeline-recovery"],"backgroundTag":"block-not-found","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}