{"record":{"id":"c9ff79c19990a07e","repo":"apache/hadoop","slug":"cannot-seterasurecodingpolicy-through-a-symlink-to","errorCode":null,"errorMessage":"Cannot setErasureCodingPolicy through a symlink to a non-DistributedFileSystem: {} -> {}","messagePattern":"Cannot setErasureCodingPolicy 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":3415,"sourceCode":"      final String ecPolicyName) throws IOException {\n    statistics.incrementWriteOps(1);\n    storageStatistics.incrementOpCounter(OpType.SET_EC_POLICY);\n    Path absF = fixRelativePart(path);\n    new FileSystemLinkResolver<Void>() {\n      @Override\n      public Void doCall(final Path p) throws IOException {\n        dfs.setErasureCodingPolicy(getPathName(p), ecPolicyName);\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.setErasureCodingPolicy(p, ecPolicyName);\n          return null;\n        }\n        throw new UnsupportedOperationException(\n            \"Cannot setErasureCodingPolicy through a symlink to a \"\n                + \"non-DistributedFileSystem: \" + path + \" -> \" + p);\n      }\n    }.resolve(this, absF);\n  }\n\n  /**\n   * Set the source path to satisfy storage policy.\n   * @param path The source path referring to either a directory or a file.\n   * @throws IOException\n   */\n  public void satisfyStoragePolicy(final Path path) throws IOException {\n    statistics.incrementWriteOps(1);\n    storageStatistics.incrementOpCounter(OpType.SATISFY_STORAGE_POLICY);\n    Path absF = fixRelativePart(path);\n    new FileSystemLinkResolver<Void>() {\n\n      @Override","sourceCodeStart":3397,"sourceCodeEnd":3433,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L3397-L3433","documentation":"Error \"Cannot setErasureCodingPolicy through a symlink to a non-DistributedFileSystem: {} -> {}\" thrown in apache/hadoop.","triggerScenarios":"setErasureCodingPolicy is invoked through a symlink whose target is not a DistributedFileSystem, which does not support erasure coding policies.","commonSituations":"See trigger scenarios.","solutions":["Set the erasure coding policy on the resolved HDFS path, not through a symlink to a non-DistributedFileSystem.","Resolve the symlink target within HDFS first."],"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"}