apache/hadoop · error · UnsupportedOperationException

Cannot provisionEZTrash through a symlink to a non-Distribut

Error message

Cannot provisionEZTrash through a symlink to a non-DistributedFileSystem: {} -> {}

What it means

Error "Cannot provisionEZTrash through 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:3107

  /* 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;
      }

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

  private void provisionEZTrash(String path, FsPermission trashPermission)
      throws IOException {
    // make sure the path is an EZ
    EncryptionZone ez = dfs.getEZForPath(path);
    if (ez == null) {
      throw new IllegalArgumentException(path + " is not an encryption zone.");
    }

    String ezPath = ez.getPath();
    if (!path.toString().equals(ezPath)) {
      throw new IllegalArgumentException(path + " is not the root of an " +
          "encryption zone. Do you mean " + ez.getPath() + "?");

View on GitHub (pinned to 2add963021)

Solutions

  1. Provision EZ trash on the actual encryption zone root path in HDFS.
  2. Do not invoke provisionEZTrash through symlinks to other filesystems.

When it happens

Trigger: provisionEZTrash is invoked through a symlink whose target is not a DistributedFileSystem, so an encryption-zone trash directory cannot be provisioned.

Common situations: See trigger scenarios.


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