apache/hadoop · error · IOException
{} does not exist.
Error message
{} does not exist. What it means
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.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:6038
}
if (file.isWithSnapshot() &&
file.getFileWithSnapshotFeature().isCurrentFileDeleted()) {
return true;
}
return false;
}
private INodeFile checkUCBlock(ExtendedBlock block,
String clientName) throws IOException {
assert hasWriteLock(RwLockMode.GLOBAL);
checkNameNodeSafeMode("Cannot get a new generation stamp and an "
+ "access token for block " + block);
// check stored block state
BlockInfo storedBlock = getStoredBlock(ExtendedBlock.getLocalBlock(block));
if (storedBlock == null) {
throw new IOException(block + " does not exist.");
}
if (storedBlock.getBlockUCState() != BlockUCState.UNDER_CONSTRUCTION) {
throw new IOException("Unexpected BlockUCState: " + block
+ " is " + storedBlock.getBlockUCState()
+ " but not " + BlockUCState.UNDER_CONSTRUCTION);
}
// check file inode
final INodeFile file = getBlockCollection(storedBlock);
if (file == null || !file.isUnderConstruction() || isFileDeleted(file)) {
throw new IOException("The file " + storedBlock +
" belonged to does not exist or it is not under construction.");
}
// check lease
if (clientName == null
|| !clientName.equals(file.getFileUnderConstructionFeature()
.getClientName())) {View on GitHub (pinned to 2add963021)
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
Defensive patterns
Strategy: validation
Validate before calling
LocatedBlocks lbs = dfs.getClient().getLocatedBlocks(path, 0);
boolean known = lbs.getLocatedBlocks().stream()
.anyMatch(lb -> lb.getBlock().getBlockId() == block.getBlockId());
if (!known) { /* block unknown: refresh or abandon */ } Try / catch
try {
updateBlock(block, clientName, ...);
} catch (IOException e) {
if (e.getMessage().contains("does not exist.") && !fs.exists(path)) {
return; // file deleted: nothing to recover
}
throw e;
} Prevention
- Re-locate the last block before any recovery retry
- Abandon recovery once the owning file is gone
When it happens
Trigger: 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.
Common situations: A client retrying pipeline recovery after the file was deleted or its lease was taken over; cross-cluster block ids from mixed configurations.
Related errors
- Block (={}) not found
- Unexpected BlockUCState: {} is {} but not UNDER_CONSTRUCTION
- Lease mismatch: {} is accessed by a non lease holder {}
- Update {} but the new block {} does not have a larger genera
- Unknown nameservice: {}
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/6befcfa777ecc5a7.
Report an issue: GitHub.