{"record":{"id":"3d281cfc32334225","repo":"apache/hadoop","slug":"getstatus-on-path-is-not-within-a-mount-point","errorCode":null,"errorMessage":"getStatus on path `{}' is not within a mount point","messagePattern":"getStatus 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/ViewFileSystemUtil.java","lineNumber":156,"sourceCode":"        updateMountPointFsStatus(viewFileSystem, mountPointMap, mountPoint,\n            new Path(viewFsUriPath));\n        break;\n      } else {\n        if (pathCompIndex > 1) {\n          // Path is in the mount tree\n          isPathLeadingToMountPoint = true;\n        } else if (incomingPathComponents.length <= 1) {\n          // Special case of \"/\" path\n          isPathIncludesAllMountPoint = true;\n        }\n        updateMountPointFsStatus(viewFileSystem, mountPointMap, mountPoint,\n            mountPoint.getMountedOnPath());\n      }\n    }\n\n    if (!isPathOverMountPoint && !isPathLeadingToMountPoint &&\n        !isPathIncludesAllMountPoint) {\n      throw new NotInMountpointException(path, \"getStatus\");\n    }\n    return mountPointMap;\n  }\n\n  /**\n   * Update FsStatus for the given the mount point.\n   *\n   * @param viewFileSystem\n   * @param mountPointMap\n   * @param mountPoint\n   * @param path\n   */\n  private static void updateMountPointFsStatus(\n      final ViewFileSystem viewFileSystem,\n      final Map<MountPoint, FsStatus> mountPointMap,\n      final MountPoint mountPoint, final Path path) throws IOException {\n    FsStatus fsStatus = viewFileSystem.getStatus(path);\n    mountPointMap.put(mountPoint, fsStatus);","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystemUtil.java#L138-L174","documentation":"Inside ViewFileSystemUtil.getStatus, after scanning all mount points the method requires the incoming path to be over a mount point, on a path leading to one, or the special case \"/\" (path with <=1 component). If none hold — the path neither contains nor is contained by any mount point — it throws NotInMountpointException(path, \"getStatus\"). This is the util-level twin of the FS-level internal-dir errors (980-984).","triggerScenarios":"ViewFileSystemUtil.getStatus(vfs, new Path(\"/tmp\")) when no mount point equals /tmp or lives under it and the path is not \"/\"; querying an arbitrary directory on a mount table that mounts only /user and /data.","commonSituations":"Capacity widgets fed a user-supplied path argument; scripts reused from plain-HDFS deployments passing scratch dirs (/tmp, /var) that the federation mount table intentionally does not cover.","solutions":["Query \"/\" (or any mount point root) to get status for all mount points at once","Pass a path that is or contains at least one mount point","Add a mount-table link for the queried prefix if it should be backed by a cluster","Catch NotInMountpointException and report the valid mount points to the caller"],"exampleFix":"// before\nMap<MountPoint, FsStatus> m = ViewFileSystemUtil.getStatus(vfs, new Path(\"/tmp\"));\n\n// after\nPath q = new Path(\"/\"); // aggregate over every mount point\nMap<MountPoint, FsStatus> m = ViewFileSystemUtil.getStatus(vfs, q);","handlingStrategy":"validation","validationCode":"static boolean statusQueryPathOk(ViewFileSystem vfs, Path p) {\n  if (p.toUri().getPath().equals(\"/\")) return true; // includes all mount points\n  String s = p.toUri().getPath();\n  for (MountPoint mp : vfs.getMountPoints()) {\n    String m = mp.getMountedOnPath().toUri().getPath();\n    boolean over = s.equals(m) || s.startsWith(m + \"/\");\n    boolean leading = m.equals(s) || m.startsWith(s.endsWith(\"/\") ? s : s + \"/\");\n    if (over || leading) return true;\n  }\n  return false;\n}","typeGuard":null,"tryCatchPattern":"try {\n  map = ViewFileSystemUtil.getStatus(vfs, p);\n} catch (NotInMountpointException e) {\n  map = ViewFileSystemUtil.getStatus(vfs, new Path(\"/\")); // widen to all mount points\n}","preventionTips":["Default capacity queries to \"/\" which always spans every mount point","Validate user-supplied query paths against getMountPoints() before calling getStatus"],"tags":["viewfs","mount-table","fs-status","hadoop-common","java"],"backgroundTag":"viewfs-not-in-mountpoint","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}