{"record":{"id":"747cda8c1c1a485f","repo":"apache/hadoop","slug":"is-in-a-read-only-mount-point","errorCode":null,"errorMessage":"{} is in a read only mount point","messagePattern":"(.+?) is in a read only mount point","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java","lineNumber":2195,"sourceCode":"          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();\n            quotaUsage.verifyStoragespaceQuota();\n            quotaUsage.verifyQuotaByStorageType();\n          }\n        }\n      }\n\n      // Filter disabled subclusters\n      Set<String> disabled = namenodeResolver.getDisabledNamespaces();\n      List<RemoteLocation> locs = new ArrayList<>();\n      for (RemoteLocation loc : location.getDestinations()) {","sourceCodeStart":2177,"sourceCodeEnd":2213,"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#L2177-L2213","documentation":"Thrown by RouterRpcServer.getLocationsForPath when the current operation category is WRITE and isPathReadOnly(path) is true, i.e. the most specific mount-table entry covering the path was created with the readonly flag. The Router intentionally blocks all mutating RPCs (create, rename, delete, setOwner, ...) on read-only mounts so the subcluster copy can only serve reads. The failure is also counted in the Router RPC metrics via routerFailureReadOnly.","triggerScenarios":"Any write operation (mkdir, create, append, rename, delete, setPermission, setTimes, setQuota, ...) issued through the Router against a mount added with hdfs dfsrouteradmin -add /path ns -readonly.","commonSituations":"Read-only mounts used for disaster-recovery copies or migration cut-over windows; admins mark a mount -readonly to freeze a namespace during backup and forget to lift it; clients configured with the Router's RPC address keep writing during DR drills.","solutions":["Remove the readonly flag: re-add/update the mount without -readonly (hdfs dfsrouteradmin -add /path ns) and refresh","If the mount must stay read-only, perform writes directly against the underlying NameNode of that nameservice","Audit mount entries with hdfs dfsrouteradmin -ls to see which subtree is marked readonly before retrying"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  dfs.create(path);\n} catch (IOException e) {\n  if (e.getMessage().endsWith(\"is in a read only mount point\")) {\n    // route the write to the subcluster NameNode, or have an admin lift -readonly\n  } else { throw e; }\n}","preventionTips":["Track which mounts are flagged -readonly in runbooks so writers are re-pointed during freezes","Set up alerts on the Router's RouterFailureReadOnly metric before DR drills","Keep read-only DR mounts on a separate Router namespace/view from production write paths"],"tags":["hadoop","hdfs","rbf","federation","read-only","mount-table","access-control"],"backgroundTag":"read-only-mount-point","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}