apache/hadoop · error · UnsupportedOperationException

Cannot call getFileEncryptionInfo on a symlink to a non-Dist

Error message

Cannot call getFileEncryptionInfo on a symlink to a non-DistributedFileSystem: {} -> {}

What it means

Error "Cannot call getFileEncryptionInfo on a symlink to a non-DistributedFileSystem: {} -> {}" thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java:3081

    Path absF = fixRelativePart(path);
    return new FileSystemLinkResolver<FileEncryptionInfo>() {
      @Override
      public FileEncryptionInfo doCall(final Path p) throws IOException {
        final HdfsFileStatus fi = dfs.getFileInfo(getPathName(p));
        if (fi == null) {
          throw new FileNotFoundException("File does not exist: " + p);
        }
        return fi.getFileEncryptionInfo();
      }

      @Override
      public FileEncryptionInfo next(final FileSystem fs, final Path p)
          throws IOException {
        if (fs instanceof DistributedFileSystem) {
          DistributedFileSystem myDfs = (DistributedFileSystem)fs;
          return myDfs.getFileEncryptionInfo(p);
        }
        throw new UnsupportedOperationException(
            "Cannot call getFileEncryptionInfo"
                + " on a symlink to a non-DistributedFileSystem: " + path
                + " -> " + p);
      }
    }.resolve(this, absF);
  }

  /* HDFS only */
  public void provisionEZTrash(final Path path,
      final FsPermission trashPermission) throws IOException {
    Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {
      @Override
      public Void doCall(Path p) throws IOException {
        provisionEZTrash(getPathName(p), trashPermission);
        return null;
      }

View on GitHub (pinned to 2add963021)

Solutions

  1. Query getFileEncryptionInfo on the direct HDFS path instead of via a symlink to a non-DistributedFileSystem.
  2. Resolve the symlink to its target within HDFS first.

When it happens

Trigger: getFileEncryptionInfo is called on a path that is a symlink to a non-DistributedFileSystem, which cannot return HDFS encryption info.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/bb8aac51b4bb1836. Report an issue: GitHub.