apache/hadoop · error · IOException

No namenode URI found for user:{} namenodeId:{}

Error message

No namenode URI found for user:{} namenodeId:{}

What it means

DFSClientCache's Guava CacheLoader creates a DFSClient per (user, namenodeId). If namenodeUriMap contains no URI registered under that namenodeId, it throws this IOException (surfaced to callers as an ExecutionException wrapping it) instead of returning null, because Guava loaders must never return null.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/DFSClientCache.java:249

    if (!exceptions.isEmpty()) {
      throw MultipleIOException.createIOException(exceptions);
    }
  }

  private CacheLoader<DfsClientKey, DFSClient> clientLoader() {
    return new CacheLoader<DfsClientKey, DFSClient>() {
      @Override
      public DFSClient load(final DfsClientKey key) throws Exception {
        UserGroupInformation ugi = getUserGroupInformation(
            key.userName, UserGroupInformation.getCurrentUser());

        // Guava requires CacheLoader never returns null.
        return ugi.doAs(new PrivilegedExceptionAction<DFSClient>() {
          @Override
          public DFSClient run() throws IOException {
            URI namenodeURI = namenodeUriMap.get(key.namenodeId);
            if (namenodeURI == null) {
              throw new IOException("No namenode URI found for user:" +
                  key.userName + " namenodeId:" + key.namenodeId);
            }
            return new DFSClient(namenodeURI, config);
          }
        });
      }
    };
  }

  /**
   * This method uses the currentUser, and real user to create a proxy.
   * @param effectiveUser The user who is being proxied by the real user
   * @param realUser The actual user who does the command
   * @return Proxy UserGroupInformation
   * @throws IOException If proxying fails
   */
  UserGroupInformation getUserGroupInformation(
          String effectiveUser,

View on GitHub (pinned to 2add963021)

Solutions

  1. Add the exported directory to nfs.exports in 'path rw' form so its namenodeId is registered at startup.
  2. Restart the NFS gateway after any nfs.exports change — the namenodeUriMap is populated during Nfs3 initialization, not dynamically.
  3. Verify the client mounts exactly the path (or a descendant) that nfs.exports lists.

Example fix

# before (nfs.exports)
/export/data rw
# client mounts /export/other -> 'No namenode URI found'
# after
/export rw
# (any subpath of /export now resolves) + restart the NFS gateway
Defensive patterns

Strategy: validation

Validate before calling

/* before mounting, confirm the path is covered by nfs.exports */
boolean covered = false;
for (String export : conf.getTrimmedStrings("nfs.exports")) {
    String exportPath = export.split("\\s+")[0];
    if (mountPath.equals(exportPath) || mountPath.startsWith(exportPath + "/")) {
        covered = true; break;
    }
}
if (!covered) throw new IOException(mountPath + " is not in nfs.exports");

Try / catch

try {
    DFSClient c = dfsClientCache.get(new DfsClientKey(user, namenodeId));
} catch (ExecutionException e) {
    Throwable cause = e.getCause();
    if (cause instanceof IOException &&
            cause.getMessage().contains("No namenode URI found")) {
        // deterministic registration gap: surface 'export not configured' to the
        // mount caller instead of a generic IO error; fix nfs.exports + restart.
    } else {
        throw cause;
    }
}

Prevention

When it happens

Trigger: An NFS mount request reaches a path whose export was never registered at gateway startup: the mount point is missing from nfs.exports, exports were edited after the gateway started (the map is built once at Nfs3 init), or the client mounted a subpath that resolves to an unregistered namenodeId.

Common situations: Adding a new export path to nfs.exports but forgetting to restart the NFS gateway; mounting a path that is not listed or not prefixed correctly in nfs.exports; typos in export path patterns.

Related errors


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