apache/hadoop · error · InconsistentFSStateException
has incompatible storage Id.
Error message
has incompatible storage Id.
What it means
After reading storageID from a pre-federation VERSION file, DataStorage compares it with the StorageDirectory's already-known UUID. If both are non-empty and differ, the directory was previously bound to a different storage identity, and InconsistentFSStateException ('has incompatible storage Id.') rejects it.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java:653
setClusterId(props, layoutVersion, sd);
// Read NamespaceID in version before federation
if (!DataNodeLayoutVersion.supports(
LayoutVersion.Feature.FEDERATION, layoutVersion)) {
setNamespaceID(props, sd);
}
// valid storage id, storage id may be empty
String ssid = props.getProperty("storageID");
if (ssid == null) {
throw new InconsistentFSStateException(sd.getRoot(), "file "
+ STORAGE_FILE_VERSION + " is invalid.");
}
String sid = sd.getStorageUuid();
if (!(sid == null || sid.equals("") ||
ssid.equals("") || sid.equals(ssid))) {
throw new InconsistentFSStateException(sd.getRoot(),
"has incompatible storage Id.");
}
if (sid == null) { // update id only if it was null
sd.setStorageUuid(ssid);
}
// Update the datanode UUID if present.
if (props.getProperty("datanodeUuid") != null) {
String dnUuid = props.getProperty("datanodeUuid");
if (getDatanodeUuid() == null) {
setDatanodeUuid(dnUuid);
} else if (getDatanodeUuid().compareTo(dnUuid) != 0) {
throw new InconsistentFSStateException(sd.getRoot(),
"Root " + sd.getRoot() + ": DatanodeUuid=" + dnUuid +
", does not match " + getDatanodeUuid() + " from other" +
" StorageDirectory.");View on GitHub (pinned to 2add963021)
Solutions
- Return the directory to its original datanode/storage identity, or
- Reformat/wipe the mismatched directory so it is recreated with this DN's storage ID (data on it is lost)
- Audit for accidental copies - one physical dir must only ever be used by one DN identity
Defensive patterns
Strategy: try-catch
Try / catch
catch (InconsistentFSStateException e) {
if (String.valueOf(e.getMessage()).contains("incompatible storage Id")) {
// dir belongs to another storage identity: remove it from data.dir or wipe it
} else { throw e; }
} Prevention
- Never clone or copy DN storage dirs between datanodes
- When reassembling hosts from backups, verify each dir's storageID matches the DN it came from
- Track dir-to-node ownership in inventory so foreign dirs are caught before startup
When it happens
Trigger: Mixing storage: copying or moving a data directory from another datanode (or from another storage dir with a different ID) into this location; partial re-format leaving mismatched IDs between the SD and its VERSION.
Common situations: Disk cloning/restores onto a different DN; reassembling dirs from backups; incorrectly shuffling data dirs between mounts or nodes.
Related errors
- Root {}: DatanodeUuid={}, does not match {} from other Stora
- Incompatible namespaceIDs in {}: namenode namespaceID = {};
- Incompatible clusterIDs in {}: namenode clusterID = {}; data
- Storage directory with location {} does not exist
- Storage directory is in use.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/4f5cce6a7c1ace25.
Report an issue: GitHub.