{"record":{"id":"cacedaad6151f4e4","repo":"apache/hadoop","slug":"getquotausage-on-path-is-not-within-a-mount-p","errorCode":null,"errorMessage":"getQuotaUsage on path `{}' is not within a mount point","messagePattern":"getQuotaUsage on path `(.+?)' is not within a mount point","errorType":"exception","errorClass":"NotInMountpointException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java","lineNumber":1888,"sourceCode":"    }\n\n    @Override\n    public void renameSnapshot(Path path, String snapshotOldName,\n        String snapshotNewName) throws IOException {\n      checkPathIsSlash(path);\n      throw readOnlyMountTable(\"renameSnapshot\", path);\n    }\n\n    @Override\n    public void deleteSnapshot(Path path, String snapshotName)\n        throws IOException {\n      checkPathIsSlash(path);\n      throw readOnlyMountTable(\"deleteSnapshot\", path);\n    }\n\n    @Override\n    public QuotaUsage getQuotaUsage(Path f) throws IOException {\n      throw new NotInMountpointException(f, \"getQuotaUsage\");\n    }\n\n    @Override\n    public void satisfyStoragePolicy(Path src) throws IOException {\n      checkPathIsSlash(src);\n      throw readOnlyMountTable(\"satisfyStoragePolicy\", src);\n    }\n\n    @Override\n    public void setStoragePolicy(Path src, String policyName)\n        throws IOException {\n      checkPathIsSlash(src);\n      throw readOnlyMountTable(\"setStoragePolicy\", src);\n    }\n\n    @Override\n    public void unsetStoragePolicy(Path src) throws IOException {\n      checkPathIsSlash(src);","sourceCodeStart":1870,"sourceCodeEnd":1906,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java#L1870-L1906","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nQuotaUsage q = vfs.getQuotaUsage(new Path(\"/\")); // throws\n\n// after\nfor (MountPoint mp : vfs.getMountPoints()) {\n  QuotaUsage q = vfs.getQuotaUsage(mp.getMountedOnPath());\n  // aggregate per-cluster quota here\n}","handlingStrategy":"try-catch","validationCode":"// Validate coverage before asking for quota\nstatic boolean quotaQueryable(ViewFileSystem vfs, Path p) {\n  return vfs.getMountPoints().stream()\n      .anyMatch(mp -> p.equals(mp.getMountedOnPath())\n          || p.toString().startsWith(mp.getMountedOnPath() + \"/\"));\n}","typeGuard":null,"tryCatchPattern":"try {\n  QuotaUsage q = vfs.getQuotaUsage(p);\n} catch (NotInMountpointException e) {\n  // aggregate per mount point instead\n}","preventionTips":["Report quota per mount point, never for the federated root","Capacity dashboards should iterate getMountPoints() as their unit of aggregation"],"tags":["viewfs","mount-table","quota","hadoop-common","java"],"backgroundTag":"viewfs-not-in-mountpoint","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}