{"record":{"id":"1f115de4296681bb","repo":"apache/hadoop","slug":"cannot-geterasurecodingpolicy-through-a-symlink-to","errorCode":null,"errorMessage":"Cannot getErasureCodingPolicy through a symlink to a non-DistributedFileSystem: {} -> {}","messagePattern":"Cannot getErasureCodingPolicy 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":3481,"sourceCode":"  public ErasureCodingPolicy getErasureCodingPolicy(final Path path)\n      throws IOException {\n    statistics.incrementReadOps(1);\n    storageStatistics.incrementOpCounter(OpType.GET_EC_POLICY);\n    Path absF = fixRelativePart(path);\n    return new FileSystemLinkResolver<ErasureCodingPolicy>() {\n      @Override\n      public ErasureCodingPolicy doCall(final Path p) throws IOException {\n        return dfs.getErasureCodingPolicy(getPathName(p));\n      }\n\n      @Override\n      public ErasureCodingPolicy next(final FileSystem fs, final Path p)\n          throws IOException {\n        if (fs instanceof DistributedFileSystem) {\n          DistributedFileSystem myDfs = (DistributedFileSystem) fs;\n          return myDfs.getErasureCodingPolicy(p);\n        }\n        throw new UnsupportedOperationException(\n            \"Cannot getErasureCodingPolicy through a symlink to a \"\n                + \"non-DistributedFileSystem: \" + path + \" -> \" + p);\n      }\n    }.resolve(this, absF);\n  }\n\n  /**\n   * Retrieve all the erasure coding policies supported by this file system,\n   * including enabled, disabled and removed policies, but excluding\n   * REPLICATION policy.\n   *\n   * @return all erasure coding policies supported by this file system.\n   * @throws IOException\n   */\n  public Collection<ErasureCodingPolicyInfo> getAllErasureCodingPolicies()\n      throws IOException {\n    statistics.incrementReadOps(1);\n    storageStatistics.incrementOpCounter(OpType.GET_EC_POLICIES);","sourceCodeStart":3463,"sourceCodeEnd":3499,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L3463-L3499","documentation":"Error \"Cannot getErasureCodingPolicy through a symlink to a non-DistributedFileSystem: {} -> {}\" thrown in apache/hadoop.","triggerScenarios":"getErasureCodingPolicy is invoked through a symlink whose target is not a DistributedFileSystem, so no erasure coding policy is available.","commonSituations":"See trigger scenarios.","solutions":["Query the erasure coding policy on the direct HDFS path.","Resolve symlinks before calling getErasureCodingPolicy."],"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-23T01:17:44.959Z"}