apache/hadoop · error · NoLocationException
Cannot find locations for {} in {}
Error message
Cannot find locations for {} in {} What it means
Thrown by RouterRpcServer.getLocationsForPath when the subcluster resolver (normally MountTableResolver) returns null from getDestinationForPath(path), meaning no mount-table entry covers the path. NoLocationException extends IOException and reports the path plus the resolver class name. The Router cannot forward any request for the path, so every RPC (open, mkdir, ls, ...) on it fails.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java:2185
if (mountPoints.isEmpty()) {
sb.append("the path: ")
.append(path)
.append(" is a mount point");
} else {
sb.append("there are mount points: ")
.append(String.join(",", mountPoints))
.append(" under the path: ")
.append(path);
}
throw new AccessControlException(sb.toString());
}
}
// Check the location for this path
final PathLocation location =
this.subclusterResolver.getDestinationForPath(path);
if (location == null) {
throw new NoLocationException(path, this.subclusterResolver.getClass());
}
// We may block some write operations
if (opCategory.get() == OperationCategory.WRITE) {
// Check if the path is in a read only mount point
if (isPathReadOnly(path)) {
if (this.rpcMonitor != null) {
this.rpcMonitor.routerFailureReadOnly();
}
throw new IOException(path + " is in a read only mount point");
}
// Check quota
if (this.router.isQuotaEnabled() && needQuotaVerify) {
RouterQuotaUsage quotaUsage = this.router.getQuotaManager()
.getQuotaUsage(path);
if (quotaUsage != null) {
quotaUsage.verifyNamespaceQuota();View on GitHub (pinned to 2add963021)
Solutions
- Add a mount entry covering the path: hdfs dfsrouteradmin -add /path ns1[,ns2] then hdfs dfsrouteradmin -refresh
- Check Router state: hdfs dfsrouteradmin -safemode get (exit it with -safemode exit) and confirm the State Store connection settings match the cluster's
- Wait for or force the mount-table cache refresh (dfs.federation.router.store.cache.ttl / cache expire) or restart the Router
- Verify with hdfs dfsrouteradmin -ls that the intended entry exists and its source path actually prefixes the failing path
Defensive patterns
Strategy: try-catch
Try / catch
try {
dfs.open(path);
} catch (NoLocationException e) { // extends IOException
// no mount entry covers this path: create one (dfsrouteradmin -add)
// or surface 'path not mounted in federation' to the operator
} Prevention
- Add mount entries for every top-level namespace before opening the Router to clients
- Monitor the Router for safe mode and State Store outages, which can empty the mount cache
- Prefer explicit mounts over relying on a catch-all '/' default so unmapped paths fail loudly
When it happens
Trigger: Any Router filesystem or admin RPC for a path with no matching mount-table entry; mount table empty because the State Store (ZooKeeper/HDFS/JDBC) is unreachable or not yet loaded; Router still in safe mode with a stale/empty cached mount table; path typo pointing outside all mounted subtrees.
Common situations: Fresh RBF deployment where no mounts were added with hdfs dfsrouteradmin -add; mount records created in one State Store while the Router points at another; checking router state immediately after startup before the mount-table cache refreshes; subcluster resolver misconfigured (e.g. ConstantFetcher/SingleResolver instead of MountTableResolver).
Related errors
- The operation is not allowed because there are mount points:
- {} is in a read only mount point
- No mount point for %s
- Failed update mount table " + mount
- Failed update mount table " + mount + " with readonly=" + re
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/89b7853a3945ec22.
Report an issue: GitHub.