apache/hadoop · error · NotInMountpointException
getQuotaUsage on path `{}' is not within a mount point
Error message
getQuotaUsage on path `{}' is not within a mount point What it means
ViewFileSystem.getQuotaUsage throws NotInMountpointException from InternalDirOfViewFs when the path resolves to an internal mount-table directory instead of a mounted FileSystem. Quota information lives on the target (per-cluster) FileSystem, so a virtual node cannot answer the query. The exception is unchecked (a UnsupportedOperationException subtype).
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java:1888
}
@Override
public void renameSnapshot(Path path, String snapshotOldName,
String snapshotNewName) throws IOException {
checkPathIsSlash(path);
throw readOnlyMountTable("renameSnapshot", path);
}
@Override
public void deleteSnapshot(Path path, String snapshotName)
throws IOException {
checkPathIsSlash(path);
throw readOnlyMountTable("deleteSnapshot", path);
}
@Override
public QuotaUsage getQuotaUsage(Path f) throws IOException {
throw new NotInMountpointException(f, "getQuotaUsage");
}
@Override
public void satisfyStoragePolicy(Path src) throws IOException {
checkPathIsSlash(src);
throw readOnlyMountTable("satisfyStoragePolicy", src);
}
@Override
public void setStoragePolicy(Path src, String policyName)
throws IOException {
checkPathIsSlash(src);
throw readOnlyMountTable("setStoragePolicy", src);
}
@Override
public void unsetStoragePolicy(Path src) throws IOException {
checkPathIsSlash(src);View on GitHub (pinned to 2add963021)
Solutions
- Query quota per mount point: iterate getMountPoints() and call getQuotaUsage on each mounted path
- Add a link for the queried prefix, or set linkMergeSlash/linkFallback so / resolves to a cluster
- Catch NotInMountpointException and report quota as unavailable for that subtree
Example fix
// before
QuotaUsage q = vfs.getQuotaUsage(new Path("/")); // throws
// after
for (MountPoint mp : vfs.getMountPoints()) {
QuotaUsage q = vfs.getQuotaUsage(mp.getMountedOnPath());
// aggregate per-cluster quota here
} Defensive patterns
Strategy: try-catch
Validate before calling
// Validate coverage before asking for quota
static boolean quotaQueryable(ViewFileSystem vfs, Path p) {
return vfs.getMountPoints().stream()
.anyMatch(mp -> p.equals(mp.getMountedOnPath())
|| p.toString().startsWith(mp.getMountedOnPath() + "/"));
} Try / catch
try {
QuotaUsage q = vfs.getQuotaUsage(p);
} catch (NotInMountpointException e) {
// aggregate per mount point instead
} Prevention
- Report quota per mount point, never for the federated root
- Capacity dashboards should iterate getMountPoints() as their unit of aggregation
When it happens
Trigger: fs.getQuotaUsage(new Path("/")) or getQuotaUsage on a virtual ancestor dir (e.g. /data with only /data/ds1 mounted) via a viewfs:// URI; capacity dashboards polling the federated root.
Common situations: Federation capacity-reporting tools, `hdfs dfsadmin`-style monitoring, or Hive/Spark code calling getQuotaUsage with the cluster defaultFS = viewfs://; the mount table lacking a root-level link.
Related errors
- getXAttrs on path `{}' is not within a mount point
- listXAttrs 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/cacedaad6151f4e4.
Report an issue: GitHub.