apache/hadoop · error · UnsupportedOperationException

{} doesn't support getAclStatus

Error message

{} doesn't support getAclStatus

What it means

FileSystem.getAclStatus(Path) is optional; the base class throws UnsupportedOperationException with getClass().getSimpleName() + " doesn't support getAclStatus". It reads a file's ACL; implemented by DistributedFileSystem, WebHdfsFileSystem, HttpFSFileSystem, ABFS and pass-through wrappers. Local filesystem, S3A and GCS keep the throwing default.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java:3226

   * @throws UnsupportedOperationException if the operation is unsupported
   *         (default outcome).
   */
  public void setAcl(Path path, List<AclEntry> aclSpec) throws IOException {
    throw new UnsupportedOperationException(getClass().getSimpleName()
        + " doesn't support setAcl");
  }

  /**
   * Gets the ACL of a file or directory.
   *
   * @param path Path to get
   * @return AclStatus describing the ACL of the file or directory
   * @throws IOException if an ACL could not be read
   * @throws UnsupportedOperationException if the operation is unsupported
   *         (default outcome).
   */
  public AclStatus getAclStatus(Path path) throws IOException {
    throw new UnsupportedOperationException(getClass().getSimpleName()
        + " doesn't support getAclStatus");
  }

  /**
   * Set an xattr of a file or directory.
   * The name must be prefixed with the namespace followed by ".". For example,
   * "user.attr".
   * <p>
   * Refer to the HDFS extended attributes user documentation for details.
   *
   * @param path Path to modify
   * @param name xattr name.
   * @param value xattr value.
   * @throws IOException IO failure
   * @throws UnsupportedOperationException if the operation is unsupported
   *         (default outcome).
   */
  public void setXAttr(Path path, String name, byte[] value)

View on GitHub (pinned to 2add963021)

Solutions

  1. Probe fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS) before reading
  2. Fall back to FileStatus.getPermission()/getOwner()/getGroup() — always available — and report 'POSIX bits only'
  3. Restrict ACL reporting to hdfs:// paths in the audit configuration
  4. Catch UnsupportedOperationException and emit a bits-only record instead of failing the audit run

Example fix

// before
AclStatus acls = fs.getAclStatus(path); // throws on non-ACL stores

// after
if (fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {
  AclStatus acls = fs.getAclStatus(path);
} else {
  FileStatus st = fs.getFileStatus(path);
  reportBitsOnly(st.getOwner(), st.getGroup(), st.getPermission());
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {
  AclStatus acls = fs.getAclStatus(path);
} else {
  FileStatus st = fs.getFileStatus(path); // always available
  reportBitsOnly(st);
}

Type guard

static boolean supportsAclRead(FileSystem fs) {
  return fs instanceof DistributedFileSystem
      || fs instanceof WebHdfsFileSystem;
}

Try / catch

try {
  return fs.getAclStatus(path);
} catch (UnsupportedOperationException e) {
  return AclStatus.fromFileStatus(fs.getFileStatus(path)); // bits-only view
}

Prevention

When it happens

Trigger: Calling fs.getAclStatus(path) to audit or display permissions on file://, s3a://, gs:// or har:// paths; permission-reporting tools that walk every path uniformly across a mixed-scheme lake.

Common situations: Compliance/audit jobs reading ACLs of datasets including non-HDFS ones; 'hdfs dfs -getfacl' style operations invoked through code on object stores.

Related errors


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