apache/hadoop · error · UnsupportedOperationException
Unsupported path {} please check mount table
Error message
Unsupported path {} please check mount table What it means
PathLocation.getDefaultLocation() returns the first remote destination of a resolved path; it throws UnsupportedOperationException when the destination list is empty or the first RemoteLocation's dest is null — i.e., the mount table record backing this path is malformed and carries no usable destination, so there is no default location to forward requests to.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/PathLocation.java:224
}
/**
* Get the order for the destinations.
*
* @return Order for the destinations.
*/
public DestinationOrder getDestinationOrder() {
return this.destOrder;
}
/**
* Get the default or highest priority location.
*
* @return The default location.
*/
public RemoteLocation getDefaultLocation() {
if (destinations.isEmpty() || destinations.get(0).getDest() == null) {
throw new UnsupportedOperationException(
"Unsupported path " + sourcePath + " please check mount table");
}
return destinations.get(0);
}
}View on GitHub (pinned to 2add963021)
Solutions
- Find the malformed entry: hdfs dfsrouteradmin -list and look for the mount with missing/empty destinations
- Replace it: hdfs dfsrouteradmin -rm <path> followed by a clean hdfs dfsrouteradmin -add <path> -ns <ns> -dst <dst>
- Refresh all routers' mount caches (hdfs dfsrouteradmin -refresh) after the fix
- If records were hand-edited in the state store, restore from a known-good snapshot/backup
Example fix
# remove the malformed entry and re-add it correctly hdfs dfsrouteradmin -rm /badmount hdfs dfsrouteradmin -add /badmount -ns ns0 -dst /badmount hdfs dfsrouteradmin -refresh
Defensive patterns
Strategy: validation
Validate before calling
// Guard before using getDefaultLocation()
PathLocation loc = resolver.lookupLocation(path);
if (loc == null || loc.getDestinations().isEmpty()
|| loc.getDestinations().get(0).getDest() == null) {
throw new IOException("No usable destination for " + path
+ "; fix the mount table entry");
}
RemoteLocation dst = loc.getDefaultLocation(); Try / catch
try {
RemoteLocation dst = loc.getDefaultLocation();
} catch (UnsupportedOperationException e) {
LOG.error("Malformed mount for {}: no default destination", path);
// alert operators and skip this location rather than NPE later
} Prevention
- Never hand-edit state store mount records; use dfsrouteradmin
- Validate admin payloads (non-empty nameservice and dest) before submitting updates
- Periodically audit mount entries for empty destination lists
When it happens
Trigger: A MountTable entry with zero destinations, or whose first RemoteLocation was built with a null dest (bad record inserted directly into the state store or by a buggy admin client), gets resolved into a PathLocation and getDefaultLocation() is called during request routing.
Common situations: Hand-edited or corrupted ZooKeeper/DB state store records; scripts calling the admin protobuf/JSON API with missing fields; partially written mount entries after a crashed admin operation.
Related errors
- Cannot find locations for {}, because the default nameservic
- Cannot find locations for {} in {}
- No mount point for %s
- Mount table " + mount + " doesn't exist
- Failed update mount table " + mount
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/fa0056615052b3ad.
Report an issue: GitHub.