{"record":{"id":"163b012dcf629acf","repo":"apache/hadoop","slug":"cannot-call-createencryptionzone-on-a-symlink-to-a","errorCode":null,"errorMessage":"Cannot call createEncryptionZone on a symlink to a non-DistributedFileSystem: {} -> {}","messagePattern":"Cannot call createEncryptionZone on 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":2982,"sourceCode":"      throws IOException {\n    statistics.incrementWriteOps(1);\n    storageStatistics.incrementOpCounter(OpType.CREATE_ENCRYPTION_ZONE);\n    Path absF = fixRelativePart(path);\n    new FileSystemLinkResolver<Void>() {\n      @Override\n      public Void doCall(final Path p) throws IOException {\n        dfs.createEncryptionZone(getPathName(p), keyName);\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.createEncryptionZone(p, keyName);\n          return null;\n        } else {\n          throw new UnsupportedOperationException(\n              \"Cannot call createEncryptionZone\"\n                  + \" on a symlink to a non-DistributedFileSystem: \" + path\n                  + \" -> \" + p);\n        }\n      }\n    }.resolve(this, absF);\n  }\n\n  /* HDFS only */\n  public EncryptionZone getEZForPath(final Path path)\n      throws IOException {\n    statistics.incrementReadOps(1);\n    storageStatistics.incrementOpCounter(OpType.GET_ENCRYPTION_ZONE);\n    Preconditions.checkNotNull(path);\n    Path absF = fixRelativePart(path);\n    return new FileSystemLinkResolver<EncryptionZone>() {\n      @Override\n      public EncryptionZone doCall(final Path p) throws IOException {","sourceCodeStart":2964,"sourceCodeEnd":3000,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L2964-L3000","documentation":"Error \"Cannot call createEncryptionZone on a symlink to a non-DistributedFileSystem: {} -> {}\" thrown in apache/hadoop.","triggerScenarios":"createEncryptionZone is invoked through a symlink whose target is not a DistributedFileSystem; encryption zones are an HDFS-only feature.","commonSituations":"See trigger scenarios.","solutions":["Run createEncryptionZone on a direct path of the DistributedFileSystem.","Do not create encryption zones through symlinks that point outside HDFS."],"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"}