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
- 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
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
- 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
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
- The operation is not allowed because there are mount points:
- Cannot find locations for {} in {}
- Permission denied while accessing mount table {}: user {} do
- Rename of {} to {} is not allowed. The number of remote loca
- Rename of {src} to {dst} is not allowed. The number of remot
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/747cda8c1c1a485f.
Report an issue: GitHub.