apache/hadoop · error · NotInMountpointException
listXAttrs on path `{}' is not within a mount point
Error message
listXAttrs on path `{}' is not within a mount point What it means
listXAttrs on ViewFileSystem's InternalDirOfViewFs throws NotInMountpointException when invoked on an internal mount-table directory — a virtual node (like "/" or an intermediate container dir) that has no child FileSystem behind it. The exception is unchecked (extends UnsupportedOperationException), so it escapes typical IOException-only handling.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java:1856
@Override
public byte[] getXAttr(Path path, String name) throws IOException {
throw new NotInMountpointException(path, "getXAttr");
}
@Override
public Map<String, byte[]> getXAttrs(Path path) throws IOException {
throw new NotInMountpointException(path, "getXAttrs");
}
@Override
public Map<String, byte[]> getXAttrs(Path path, List<String> names)
throws IOException {
throw new NotInMountpointException(path, "getXAttrs");
}
@Override
public List<String> listXAttrs(Path path) throws IOException {
throw new NotInMountpointException(path, "listXAttrs");
}
@Override
public void removeXAttr(Path path, String name) throws IOException {
checkPathIsSlash(path);
throw readOnlyMountTable("removeXAttr", path);
}
@Override
public Path createSnapshot(Path path, String snapshotName)
throws IOException {
checkPathIsSlash(path);
throw readOnlyMountTable("createSnapshot", path);
}
@Override
public void renameSnapshot(Path path, String snapshotOldName,
String snapshotNewName) throws IOException {View on GitHub (pinned to 2add963021)
Solutions
- Only call listXAttrs on paths inside a mount point
- Mount the queried prefix explicitly (fs.viewfs.mounttable.<cluster>.link.<path>)
- Configure linkFallback or linkMergeSlash so the root is backed by a real FileSystem
- Guard the tree walk with try/catch on NotInMountpointException and skip virtual dirs
Example fix
// before
List<String> names = fs.listXAttrs(dir);
// after
List<String> names;
try {
names = fs.listXAttrs(dir);
} catch (NotInMountpointException e) {
names = Collections.emptyList(); // virtual mount-table dir
} Defensive patterns
Strategy: try-catch
Validate before calling
static boolean listXAttrsSafe(FileSystem fs, Path p, List<String> out) {
try { out.addAll(fs.listXAttrs(p)); return true; }
catch (NotInMountpointException e) { return false; } // virtual dir
} Try / catch
try {
names = fs.listXAttrs(dir);
} catch (NotInMountpointException e) {
names = Collections.emptyList();
} Prevention
- Audit tools should whitelist mount-point subtrees instead of scanning from root
- Treat UnsupportedOperationException from viewfs paths as a mount-coverage signal in monitoring
When it happens
Trigger: fs.listXAttrs(new Path("/")) on viewfs://; listXAttrs on /project when the mount table only defines links under /project/a and /project/b; audit tools enumerating xattrs from the top of a viewfs namespace.
Common situations: Security/audit tooling (Ranger tag policies, Atlas) scanning federated namespaces through viewfs; scripts that walk from the root and list xattrs on every directory they traverse.
Related errors
- getXAttrs on path `{}' is not within a mount point
- getQuotaUsage on path `{}' is not within a mount point
- getStoragePolicy on path `{}' is not within a mount point
- No link found for the given path. on path `{}' is not within
- getStatus on path `{}' is not within a mount point
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/8c29b796fcbb633e.
Report an issue: GitHub.