{"record":{"id":"2c16276efd6b18c2","repo":"apache/hadoop","slug":"not-found-in-datanode","errorCode":null,"errorMessage":"{} not found in datanode.","messagePattern":"(.+?) not found in datanode\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java","lineNumber":3639,"sourceCode":"   *          the stored GS and the visible length. \n   * @param targets targets to transfer the block to\n   * @param client client name\n   */\n  void transferReplicaForPipelineRecovery(final ExtendedBlock b,\n      final DatanodeInfo[] targets, final StorageType[] targetStorageTypes,\n      final String[] targetStorageIds, final String client)\n      throws IOException {\n    final long storedGS;\n    final long visible;\n    final BlockConstructionStage stage;\n\n    //get replica information\n    try (AutoCloseableLock lock = dataSetLockManager.readLock(\n        LockLevel.BLOCK_POOl, b.getBlockPoolId())) {\n      Block storedBlock = data.getStoredBlock(b.getBlockPoolId(),\n          b.getBlockId());\n      if (null == storedBlock) {\n        throw new IOException(b + \" not found in datanode.\");\n      }\n      storedGS = storedBlock.getGenerationStamp();\n      if (storedGS < b.getGenerationStamp()) {\n        throw new IOException(storedGS\n            + \" = storedGS < b.getGenerationStamp(), b=\" + b);\n      }\n      // Update the genstamp with storedGS\n      b.setGenerationStamp(storedGS);\n      if (data.isValidRbw(b)) {\n        stage = BlockConstructionStage.TRANSFER_RBW;\n        LOG.debug(\"Replica is being written!\");\n      } else if (data.isValidBlock(b)) {\n        stage = BlockConstructionStage.TRANSFER_FINALIZED;\n        LOG.debug(\"Replica is finalized!\");\n      } else {\n        final String r = data.getReplicaString(b.getBlockPoolId(), b.getBlockId());\n        throw new IOException(b + \" is neither a RBW nor a Finalized, r=\" + r);\n      }","sourceCodeStart":3621,"sourceCodeEnd":3657,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java#L3621-L3657","documentation":"Lookup failure during block transfer for pipeline recovery on the DataNode: the block (or block pool) being transferred could not be located in this datanode's dataset, so its stored generation stamp and visible length cannot be determined and the recovery transfer fails.","triggerScenarios":"An operation (e.g., recovery or replica lookup) references a block that does not exist in this DataNode's dataset.","commonSituations":"The requested block does not exist on this DataNode, often because it was deleted or balanced away. Harmless if the client retries against fresh locations.","solutions":["Confirm the block id and block pool id are correct and that the replica still exists; it may have been deleted by the balancer or replication change.","Retry the operation; if the block was legitimately removed, the error is benign."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}