{"record":{"id":"89b7853a3945ec22","repo":"apache/hadoop","slug":"cannot-find-locations-for-in-89b785","errorCode":null,"errorMessage":"Cannot find locations for {} in {}","messagePattern":"Cannot find locations for (.+?) in (.+?)","errorType":"exception","errorClass":"NoLocationException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java","lineNumber":2185,"sourceCode":"          if (mountPoints.isEmpty()) {\n            sb.append(\"the path: \")\n                .append(path)\n                .append(\" is a mount point\");\n          } else {\n            sb.append(\"there are mount points: \")\n                .append(String.join(\",\", mountPoints))\n                .append(\" under the path: \")\n                .append(path);\n          }\n          throw new AccessControlException(sb.toString());\n        }\n      }\n\n      // Check the location for this path\n      final PathLocation location =\n          this.subclusterResolver.getDestinationForPath(path);\n      if (location == null) {\n        throw new NoLocationException(path, this.subclusterResolver.getClass());\n      }\n\n      // We may block some write operations\n      if (opCategory.get() == OperationCategory.WRITE) {\n        // Check if the path is in a read only mount point\n        if (isPathReadOnly(path)) {\n          if (this.rpcMonitor != null) {\n            this.rpcMonitor.routerFailureReadOnly();\n          }\n          throw new IOException(path + \" is in a read only mount point\");\n        }\n\n        // Check quota\n        if (this.router.isQuotaEnabled() && needQuotaVerify) {\n          RouterQuotaUsage quotaUsage = this.router.getQuotaManager()\n              .getQuotaUsage(path);\n          if (quotaUsage != null) {\n            quotaUsage.verifyNamespaceQuota();","sourceCodeStart":2167,"sourceCodeEnd":2203,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java#L2167-L2203","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  dfs.open(path);\n} catch (NoLocationException e) { // extends IOException\n  // no mount entry covers this path: create one (dfsrouteradmin -add)\n  // or surface 'path not mounted in federation' to the operator\n}","preventionTips":["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"],"tags":["hadoop","hdfs","rbf","federation","mount-table","path-resolution","state-store"],"backgroundTag":"unresolved-mount-path","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}