{"record":{"id":"819a3ddd80e97a4e","repo":"apache/hadoop","slug":"cannot-unseterasurecodingpolicy-through-a-symlink","errorCode":null,"errorMessage":"Cannot unsetErasureCodingPolicy through a symlink to a non-DistributedFileSystem: {} -> {}","messagePattern":"Cannot unsetErasureCodingPolicy through a symlink to a non-DistributedFileSystem: (.+?) -> (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java","lineNumber":3598,"sourceCode":"  public void unsetErasureCodingPolicy(final Path path) throws IOException {\n    statistics.incrementWriteOps(1);\n    storageStatistics.incrementOpCounter(OpType.UNSET_EC_POLICY);\n    Path absF = fixRelativePart(path);\n    new FileSystemLinkResolver<Void>() {\n      @Override\n      public Void doCall(final Path p) throws IOException {\n        dfs.unsetErasureCodingPolicy(getPathName(p));\n        return null;\n      }\n\n      @Override\n      public Void next(final FileSystem fs, final Path p) throws IOException {\n        if (fs instanceof DistributedFileSystem) {\n          DistributedFileSystem myDfs = (DistributedFileSystem) fs;\n          myDfs.unsetErasureCodingPolicy(p);\n          return null;\n        }\n        throw new UnsupportedOperationException(\n            \"Cannot unsetErasureCodingPolicy through a symlink to a \"\n                + \"non-DistributedFileSystem: \" + path + \" -> \" + p);\n      }\n    }.resolve(this, absF);\n  }\n\n  /**\n   * Verifies if the given policies are supported in the given cluster setup.\n   * If not policy is specified checks for all enabled policies.\n   * @param policyNames name of policies.\n   * @return the result if the given policies are supported in the cluster setup\n   * @throws IOException\n   */\n  public ECTopologyVerifierResult getECTopologyResultForPolicies(\n      final String... policyNames) throws IOException {\n    return dfs.getECTopologyResultForPolicies(policyNames);\n  }\n","sourceCodeStart":3580,"sourceCodeEnd":3616,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L3580-L3616","documentation":"Error \"Cannot unsetErasureCodingPolicy through a symlink to a non-DistributedFileSystem: {} -> {}\" thrown in apache/hadoop.","triggerScenarios":"unsetErasureCodingPolicy is invoked through a symlink whose target is not a DistributedFileSystem, which does not support erasure coding policies.","commonSituations":"See trigger scenarios.","solutions":["Unset the erasure coding policy on the actual HDFS path.","Resolve symlinks; the operation requires a DistributedFileSystem target."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}