{"record":{"id":"ebbb5a9b28547223","repo":"apache/hadoop","slug":"getserverdefaults-on-path-f-is-not-within-a-mo","errorCode":null,"errorMessage":"getServerDefaults on path `<f>' is not within a mount point","messagePattern":"getServerDefaults on path `<f>' 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":1001,"sourceCode":"      InodeTree.ResolveResult<FileSystem> res =\n        fsState.resolve(getUriPath(f), true);\n      return res.targetFileSystem.getDefaultReplication(res.remainingPath);\n    } catch (FileNotFoundException e) {\n      throw new NotInMountpointException(f, \"getDefaultReplication\");\n    } catch (IOException e) {\n      throw new RuntimeException(\"Not able to initialize fs in \"\n          + \" getDefaultReplication for path \" + f + \" with exception\", e);\n    }\n  }\n\n  @Override\n  public FsServerDefaults getServerDefaults(Path f) throws IOException {\n    try {\n      InodeTree.ResolveResult<FileSystem> res =\n          fsState.resolve(getUriPath(f), true);\n      return res.targetFileSystem.getServerDefaults(res.remainingPath);\n    } catch (FileNotFoundException e) {\n      throw new NotInMountpointException(f, \"getServerDefaults\");\n    }\n  }\n\n  @Override\n  public ContentSummary getContentSummary(Path f) throws IOException {\n    InodeTree.ResolveResult<FileSystem> res =\n      fsState.resolve(getUriPath(f), true);\n    return res.targetFileSystem.getContentSummary(res.remainingPath);\n  }\n\n  @Override\n  public QuotaUsage getQuotaUsage(Path f) throws IOException {\n    InodeTree.ResolveResult<FileSystem> res =\n        fsState.resolve(getUriPath(f), true);\n    return res.targetFileSystem.getQuotaUsage(res.remainingPath);\n  }\n\n  @Override","sourceCodeStart":983,"sourceCodeEnd":1019,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java#L983-L1019","documentation":"ViewFileSystem.getServerDefaults(Path) resolves the path through the mount table and forwards to the target file system's getServerDefaults(). If resolve() throws FileNotFoundException - no mount point covers the path - it is rethrown as NotInMountpointException('getServerDefaults on path ... is not within a mount point'). Server defaults are per-cluster values, so an unmounted path has none.","triggerScenarios":"Calling getServerDefaults(new Path(\"/\")) or getServerDefaults on a mount-table internal directory when no linkMergeSlash is configured; calling it on a path whose prefix matches no fs.viewfs.mounttable.default.link.* entry (e.g. writers querying defaults for a staging dir that was never mounted).","commonSituations":"Output committers (e.g. FileOutputCommitter, distcp -pb) that fetch server defaults for the output directory; viewfs cutovers where the output/staging directories were left out of the mount table; tools hard-coding '/' as the probe path.","solutions":["Call getServerDefaults on a concrete mounted path (e.g. the job output directory once it is mounted)","Mount the missing directory: fs.viewfs.mounttable.default.link.<name>=<target>","Configure fs.viewfs.mounttable.default.linkMergeSlash=... so the root itself resolves and getServerDefaults('/') works","Catch NotInMountpointException and fall back to defaults obtained from the target HDFS handle"],"exampleFix":"// before\nFsServerDefaults d = fs.getServerDefaults(new Path(\"/\")); // throws without linkMergeSlash\n\n// after\nFsServerDefaults d;\ntry {\n  d = fs.getServerDefaults(outPath);\n} catch (NotInMountpointException e) {\n  d = fs.getServerDefaults(new Path(\"viewfs://cluster/data\")); // known mount\n}","handlingStrategy":"try-catch","validationCode":"// Use a mounted probe path for server defaults\nPath probe = new Path(\"viewfs://cluster/data\"); // a known mount\nif (!fs.exists(probe)) throw new IllegalStateException(\"probe mount missing\");\nFsServerDefaults d = fs.getServerDefaults(probe);","typeGuard":null,"tryCatchPattern":"try {\n  FsServerDefaults d = fs.getServerDefaults(p);\n} catch (NotInMountpointException e) {\n  FsServerDefaults d = FileSystem.get(targetUri, conf).getServerDefaults(); // ask target HDFS\n}","preventionTips":["Configure output/staging dirs as explicit mounts before running committers that fetch server defaults","Prefer linkMergeSlash when tooling insists on probing '/'","Wrap server-default fetches in a helper that accepts a fallback target URI"],"tags":["viewfs","hadoop","mount-table","server-defaults","configuration"],"backgroundTag":"viewfs-not-in-mountpoint","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}