{"record":{"id":"bb8aac51b4bb1836","repo":"apache/hadoop","slug":"cannot-call-getfileencryptioninfo-on-a-symlink-to","errorCode":null,"errorMessage":"Cannot call getFileEncryptionInfo on a symlink to a non-DistributedFileSystem: {} -> {}","messagePattern":"Cannot call getFileEncryptionInfo 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":3081,"sourceCode":"    Path absF = fixRelativePart(path);\n    return new FileSystemLinkResolver<FileEncryptionInfo>() {\n      @Override\n      public FileEncryptionInfo doCall(final Path p) throws IOException {\n        final HdfsFileStatus fi = dfs.getFileInfo(getPathName(p));\n        if (fi == null) {\n          throw new FileNotFoundException(\"File does not exist: \" + p);\n        }\n        return fi.getFileEncryptionInfo();\n      }\n\n      @Override\n      public FileEncryptionInfo next(final FileSystem fs, final Path p)\n          throws IOException {\n        if (fs instanceof DistributedFileSystem) {\n          DistributedFileSystem myDfs = (DistributedFileSystem)fs;\n          return myDfs.getFileEncryptionInfo(p);\n        }\n        throw new UnsupportedOperationException(\n            \"Cannot call getFileEncryptionInfo\"\n                + \" on a symlink to a non-DistributedFileSystem: \" + path\n                + \" -> \" + p);\n      }\n    }.resolve(this, absF);\n  }\n\n  /* HDFS only */\n  public void provisionEZTrash(final Path path,\n      final FsPermission trashPermission) throws IOException {\n    Path absF = fixRelativePart(path);\n    new FileSystemLinkResolver<Void>() {\n      @Override\n      public Void doCall(Path p) throws IOException {\n        provisionEZTrash(getPathName(p), trashPermission);\n        return null;\n      }\n","sourceCodeStart":3063,"sourceCodeEnd":3099,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L3063-L3099","documentation":"Error \"Cannot call getFileEncryptionInfo on a symlink to a non-DistributedFileSystem: {} -> {}\" thrown in apache/hadoop.","triggerScenarios":"getFileEncryptionInfo is called on a path that is a symlink to a non-DistributedFileSystem, which cannot return HDFS encryption info.","commonSituations":"See trigger scenarios.","solutions":["Query getFileEncryptionInfo on the direct HDFS path instead of via a symlink to a non-DistributedFileSystem.","Resolve the symlink to its 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"}