apache/hadoop · error · UnsupportedOperationException
Cannot getErasureCodingPolicy through a symlink to a non-Dis
Error message
Cannot getErasureCodingPolicy through a symlink to a non-DistributedFileSystem: {} -> {} What it means
Error "Cannot getErasureCodingPolicy through a symlink to a non-DistributedFileSystem: {} -> {}" thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java:3481
public ErasureCodingPolicy getErasureCodingPolicy(final Path path)
throws IOException {
statistics.incrementReadOps(1);
storageStatistics.incrementOpCounter(OpType.GET_EC_POLICY);
Path absF = fixRelativePart(path);
return new FileSystemLinkResolver<ErasureCodingPolicy>() {
@Override
public ErasureCodingPolicy doCall(final Path p) throws IOException {
return dfs.getErasureCodingPolicy(getPathName(p));
}
@Override
public ErasureCodingPolicy next(final FileSystem fs, final Path p)
throws IOException {
if (fs instanceof DistributedFileSystem) {
DistributedFileSystem myDfs = (DistributedFileSystem) fs;
return myDfs.getErasureCodingPolicy(p);
}
throw new UnsupportedOperationException(
"Cannot getErasureCodingPolicy through a symlink to a "
+ "non-DistributedFileSystem: " + path + " -> " + p);
}
}.resolve(this, absF);
}
/**
* Retrieve all the erasure coding policies supported by this file system,
* including enabled, disabled and removed policies, but excluding
* REPLICATION policy.
*
* @return all erasure coding policies supported by this file system.
* @throws IOException
*/
public Collection<ErasureCodingPolicyInfo> getAllErasureCodingPolicies()
throws IOException {
statistics.incrementReadOps(1);
storageStatistics.incrementOpCounter(OpType.GET_EC_POLICIES);View on GitHub (pinned to 2add963021)
Solutions
- Query the erasure coding policy on the direct HDFS path.
- Resolve symlinks before calling getErasureCodingPolicy.
When it happens
Trigger: getErasureCodingPolicy is invoked through a symlink whose target is not a DistributedFileSystem, so no erasure coding policy is available.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/1f115de4296681bb.
Report an issue: GitHub.