apache/hadoop · error · UnsupportedOperationException
{} doesn't support removeAclEntries
Error message
{} doesn't support removeAclEntries What it means
FileSystem.removeAclEntries(Path, List<AclEntry>) is optional; the base class throws UnsupportedOperationException with getClass().getSimpleName() + " doesn't support removeAclEntries". Only HDFS-family clients (DistributedFileSystem, WebHdfsFileSystem, HttpFSFileSystem), ABFS and pass-through wrappers implement ACL mutation; local and typical object-store connectors throw.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java:3166
public void modifyAclEntries(Path path, List<AclEntry> aclSpec)
throws IOException {
throw new UnsupportedOperationException(getClass().getSimpleName()
+ " doesn't support modifyAclEntries");
}
/**
* Removes ACL entries from files and directories. Other ACL entries are
* retained.
*
* @param path Path to modify
* @param aclSpec List describing entries to remove
* @throws IOException if an ACL could not be modified
* @throws UnsupportedOperationException if the operation is unsupported
* (default outcome).
*/
public void removeAclEntries(Path path, List<AclEntry> aclSpec)
throws IOException {
throw new UnsupportedOperationException(getClass().getSimpleName()
+ " doesn't support removeAclEntries");
}
/**
* Removes all default ACL entries from files and directories.
*
* @param path Path to modify
* @throws IOException if an ACL could not be modified
* @throws UnsupportedOperationException if the operation is unsupported
* (default outcome).
*/
public void removeDefaultAcl(Path path)
throws IOException {
throw new UnsupportedOperationException(getClass().getSimpleName()
+ " doesn't support removeDefaultAcl");
}
/**View on GitHub (pinned to 2add963021)
Solutions
- Probe fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS) before revoking
- Target the HDFS path explicitly (hdfs://nameservice/...) instead of relying on fs.defaultFS
- Fall back to rewriting plain permission bits with setPermission on ACL-less stores
- Catch UnsupportedOperationException and log the store as bits-only so revocation drift is visible
Example fix
// before
fs.removeAclEntries(path, entriesToRemove); // throws on non-ACL stores
// after
if (fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {
fs.removeAclEntries(path, entriesToRemove);
} else {
fs.setPermission(path, FsPermission.createImmutable((short) 0750));
} Defensive patterns
Strategy: try-catch
Validate before calling
if (fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {
fs.removeAclEntries(path, entriesToRemove);
} Type guard
static boolean supportsAclRemoval(FileSystem fs) {
return fs instanceof DistributedFileSystem
|| fs instanceof WebHdfsFileSystem;
} Try / catch
try {
fs.removeAclEntries(path, entries);
} catch (UnsupportedOperationException e) {
LOG.warn("{} is ACL-less; revoke via permission bits instead", fs.getUri());
} Prevention
- Design revocation flows with a permission-bits fallback path
- Scope ACL tooling to hdfs:// URIs in configuration, not hardcoded defaults
- Log capability gaps during provisioning so permission drift is auditable
When it happens
Trigger: Calling fs.removeAclEntries(path, aclSpec) during permission revocation on a store that never overrode it: file://, s3a://, gs://, har://, or an unmodified custom FileSystem; cleanup code that strips specific user entries after offboarding.
Common situations: Offboarding/revocation automation run in the wrong environment (local tests instead of the HDFS cluster); datasets moved to object stores where the ACL playbook no longer applies.
Related errors
- {} doesn't support modifyAclEntries
- {} doesn't support removeAcl
- {} doesn't support setAcl
- {} doesn't support removeDefaultAcl
- {} doesn't support getAclStatus
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/028df28ac70d1c82.
Report an issue: GitHub.