apache/hadoop · error · IOException

{} is in a read only mount point

Error message

{} is in a read only mount point

What it means

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.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java:2195

          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();
            quotaUsage.verifyStoragespaceQuota();
            quotaUsage.verifyQuotaByStorageType();
          }
        }
      }

      // Filter disabled subclusters
      Set<String> disabled = namenodeResolver.getDisabledNamespaces();
      List<RemoteLocation> locs = new ArrayList<>();
      for (RemoteLocation loc : location.getDestinations()) {

View on GitHub (pinned to 2add963021)

Solutions

  1. Remove the readonly flag: re-add/update the mount without -readonly (hdfs dfsrouteradmin -add /path ns) and refresh
  2. If the mount must stay read-only, perform writes directly against the underlying NameNode of that nameservice
  3. Audit mount entries with hdfs dfsrouteradmin -ls to see which subtree is marked readonly before retrying
Defensive patterns

Strategy: try-catch

Try / catch

try {
  dfs.create(path);
} catch (IOException e) {
  if (e.getMessage().endsWith("is in a read only mount point")) {
    // route the write to the subcluster NameNode, or have an admin lift -readonly
  } else { throw e; }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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