apache/hadoop · error · SnapshotException
The path {} is neither snapshottable nor under a snapshot ro
Error message
The path {} is neither snapshottable nor under a snapshot root! What it means
Error "The path {} is neither snapshottable nor under a snapshot root!" thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/SnapshotManager.java:394
return captureOpenFiles;
}
@VisibleForTesting
int getMaxSnapshotLimit() {
return maxSnapshotLimit;
}
/**
* Get the snapshot root directory for the given directory. The given
* directory must either be a snapshot root or a descendant of any
* snapshot root directories.
* @param iip INodesInPath for the directory to get snapshot root.
* @return the snapshot root INodeDirectory
*/
public INodeDirectory checkAndGetSnapshottableAncestorDir(
final INodesInPath iip) throws IOException {
final INodeDirectory dir = getSnapshottableAncestorDir(iip);
if (dir == null) {
throw new SnapshotException("The path " + iip.getPath()
+ " is neither snapshottable nor under a snapshot root!");
}
return dir;
}
public INodeDirectory getSnapshottableAncestorDir(final INodesInPath iip)
throws IOException {
final String path = iip.getPath();
final INode inode = iip.getLastINode();
final INodeDirectory dir;
if (inode != null && inode.isDirectory()) {
dir = INodeDirectory.valueOf(inode, path);
} else {
dir = INodeDirectory.valueOf(iip.getINode(-2), iip.getParentPath());
}
if (dir.isSnapshottable()) {
return dir;
}View on GitHub (pinned to 2add963021)
Solutions
- Use a snapshottable directory (or a path beneath one) for the snapshot operation; enable snapshots with allowSnapshot if appropriate.
When it happens
Trigger: A snapshot diff/operation path is neither snapshottable nor under any snapshottable root.
Common situations: Running snapshotDiff between arbitrary non-snapshottable directories.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/cd4a8daa7999828e.
Report an issue: GitHub.