apache/hadoop · error · IOException

ViewFs: Non absolute mount name in config:{src}

Error message

ViewFs: Non absolute mount name in config:{src}

What it means

InodeTree.createLink validates each mount-table source path with Path.isAbsoluteAndSchemeAuthorityNull(): it must start at '/' and carry no scheme or authority. Violations throw IOException('ViewFs: Non absolute mount name in config:<src>') while the mount table is parsed during ViewFileSystem initialization.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java:432

      return targetFileSystem;
    }

    T getTargetFileSystemForClose() throws IOException {
      return targetFileSystem;
    }

  }

  private void createLink(final String src, final String target,
      final LinkType linkType, final String settings,
      final UserGroupInformation aUgi,
      final Configuration config)
      throws URISyntaxException, IOException,
      FileAlreadyExistsException, UnsupportedFileSystemException {
    // Validate that src is valid absolute path
    final Path srcPath = new Path(src);
    if (!srcPath.isAbsoluteAndSchemeAuthorityNull()) {
      throw new IOException("ViewFs: Non absolute mount name in config:" + src);
    }

    final String[] srcPaths = breakIntoPathComponents(src);
    // Make sure root is of INodeDir type before
    // adding any regular links to it.
    Preconditions.checkState(root.isInternalDir());
    INodeDir<T> curInode = getRootDir();
    int i;
    // Ignore first initial slash, process all except last component
    for (i = 1; i < srcPaths.length - 1; i++) {
      final String iPath = srcPaths[i];
      INode<T> nextInode = curInode.resolveInternal(iPath);
      if (nextInode == null) {
        INodeDir<T> newDir = curInode.addDir(iPath, aUgi);
        newDir.setInternalDirFs(getTargetFileSystem(newDir));
        nextInode = newDir;
      }
      if (!nextInode.isInternalDir()) {

View on GitHub (pinned to 2add963021)

Solutions

  1. Write the source as an absolute scheme-less path: fs.viewfs.mounttable.X.link./user
  2. Keep scheme and authority only on the target (value) side
  3. When generating keys, build prefix + '/' + relativePath and assert the source starts with '/'

Example fix

<!-- before -->
<property><name>fs.viewfs.mounttable.cluster.link.user</name>
  <value>hdfs://nnA/user</value></property>

<!-- after -->
<property><name>fs.viewfs.mounttable.cluster.link./user</name>
  <value>hdfs://nnA/user</value></property>
Defensive patterns

Strategy: validation

Validate before calling

static boolean isValidMountSrc(String src) {
  return new Path(src).isAbsoluteAndSchemeAuthorityNull();
}

Try / catch

Catch IOException during ViewFileSystem initialization; 'ViewFs: Non absolute mount name in config:<src>' names the bad source — grep the config for that suffix and fix the key.

Prevention

When it happens

Trigger: A mount key missing the leading slash, e.g. fs.viewfs.mounttable.X.link.user (src='user'); or a source key containing a scheme/authority, e.g. ...link.hdfs://nn/user.

Common situations: Hand-written core-site.xml viewfs sections; scripts generating mount keys by concatenation; copying the target URI into the key side instead of the value side.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/730ce26f8fa8afa8. Report an issue: GitHub.