apache/hadoop · error · UnsupportedOperationException

Cannot call createEncryptionZone on a symlink to a non-Distr

Error message

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

What it means

Error "Cannot call createEncryptionZone 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:2982

      throws IOException {
    statistics.incrementWriteOps(1);
    storageStatistics.incrementOpCounter(OpType.CREATE_ENCRYPTION_ZONE);
    Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {
      @Override
      public Void doCall(final Path p) throws IOException {
        dfs.createEncryptionZone(getPathName(p), keyName);
        return null;
      }

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

  /* HDFS only */
  public EncryptionZone getEZForPath(final Path path)
      throws IOException {
    statistics.incrementReadOps(1);
    storageStatistics.incrementOpCounter(OpType.GET_ENCRYPTION_ZONE);
    Preconditions.checkNotNull(path);
    Path absF = fixRelativePart(path);
    return new FileSystemLinkResolver<EncryptionZone>() {
      @Override
      public EncryptionZone doCall(final Path p) throws IOException {

View on GitHub (pinned to 2add963021)

Solutions

  1. Run createEncryptionZone on a direct path of the DistributedFileSystem.
  2. Do not create encryption zones through symlinks that point outside HDFS.

When it happens

Trigger: createEncryptionZone is invoked through a symlink whose target is not a DistributedFileSystem; encryption zones are an HDFS-only feature.

Common situations: See trigger scenarios.


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