apache/hadoop · error · UnsupportedOperationException

Cannot satisfyStoragePolicy through a symlink to a…

Error message

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

What it means

satisfyStoragePolicy resolved a symlink to a filesystem that is not a DistributedFileSystem; the storage-policy-satisfy action cannot be delegated.

Solutions

  1. Run satisfyStoragePolicy on the real path in the DistributedFileSystem.
  2. Avoid symlinks to other filesystems for storage policy operations.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: satisfyStoragePolicy is invoked through a symlink whose target is not a DistributedFileSystem, which does not support storage policies.

Common situations: See trigger scenarios.


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

Appendix: source

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

    storageStatistics.incrementOpCounter(OpType.SATISFY_STORAGE_POLICY);
    Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {

      @Override
      public Void doCall(Path p) throws IOException {
        dfs.satisfyStoragePolicy(getPathName(p));
        return null;
      }

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

  /**
   * Get erasure coding policy information for the specified path.
   *
   * @param path The path of the file or directory
   * @return Returns the policy information if file or directory on the path
   * is erasure coded, null otherwise. Null will be returned if directory or
   * file has REPLICATION policy.
   * @throws IOException
   */
  public ErasureCodingPolicy getErasureCodingPolicy(final Path path)
      throws IOException {
    statistics.incrementReadOps(1);

View on GitHub (pinned to 2add963021)