apache/hadoop · error · IOException
Inconsistent Datanode IDs. Name-node returned {}. Expecting
Error message
Inconsistent Datanode IDs. Name-node returned {}. Expecting {} What it means
Error "Inconsistent Datanode IDs. Name-node returned {}. Expecting {}" thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java:2102
streamingAddr.getAddress().getHostAddress(), hostName,
storage.getDatanodeUuid(), getXferPort(), getInfoPort(),
infoSecurePort, getIpcPort());
return new DatanodeRegistration(dnId, storageInfo,
new ExportedBlockKeys(), VersionInfo.getVersion());
}
/**
* Check that the registration returned from a NameNode is consistent
* with the information in the storage. If the storage is fresh/unformatted,
* sets the storage ID based on this registration.
* Also updates the block pool's state in the secret manager.
*/
synchronized void bpRegistrationSucceeded(DatanodeRegistration bpRegistration,
String blockPoolId) throws IOException {
id = bpRegistration;
if(!storage.getDatanodeUuid().equals(bpRegistration.getDatanodeUuid())) {
throw new IOException("Inconsistent Datanode IDs. Name-node returned "
+ bpRegistration.getDatanodeUuid()
+ ". Expecting " + storage.getDatanodeUuid());
}
registerBlockPoolWithSecretManager(bpRegistration, blockPoolId);
}
/**
* After the block pool has contacted the NN, registers that block pool
* with the secret manager, updating it with the secrets provided by the NN.
* @throws IOException on error
*/
private synchronized void registerBlockPoolWithSecretManager(
DatanodeRegistration bpRegistration, String blockPoolId) throws IOException {
ExportedBlockKeys keys = bpRegistration.getExportedKeys();
if (!hasAnyBlockPoolRegistered) {
hasAnyBlockPoolRegistered = true;
isBlockTokenEnabled = keys.isBlockTokenEnabled();View on GitHub (pinned to 2add963021)
Solutions
- Ensure the DataNode registers with the same NameNode/cluster it was formatted for; clear stale storage (datanodeUuid in VERSION files) if the node was reimaged.
- Verify dfs.namenode addresses in hdfs-site.xml point to the intended NameNode and that no other cluster shares these storage directories.
When it happens
Trigger: During registration, the NameNode returns a DataNode ID that differs from the ID this DataNode has stored, indicating storage from a different cluster or node.
Common situations: The NameNode returned a DataNode ID inconsistent with local storage, usually from reusing a data directory on a different node. Clear or correct the storage directories.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/48dc5a9b627cc5dd.
Report an issue: GitHub.