{"record":{"id":"3899b2e6c39f6816","repo":"apache/hadoop","slug":"doesn-t-support-removeacl","errorCode":null,"errorMessage":"{} doesn't support removeAcl","messagePattern":"(.+?) doesn't support removeAcl","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java","lineNumber":1315,"sourceCode":"   * @throws IOException if an ACL could not be modified\n   */\n  public void removeDefaultAcl(Path path)\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support removeDefaultAcl\");\n  }\n\n  /**\n   * Removes all but the base ACL entries of files and directories.  The entries\n   * for user, group, and others are retained for compatibility with permission\n   * bits.\n   *\n   * @param path Path to modify\n   * @throws IOException if an ACL could not be removed\n   */\n  public void removeAcl(Path path)\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support removeAcl\");\n  }\n\n  /**\n   * Fully replaces ACL of files and directories, discarding all existing\n   * entries.\n   *\n   * @param path Path to modify\n   * @param aclSpec List{@literal <AclEntry>} describing modifications, must\n   * include entries for user, group, and others for compatibility with\n   * permission bits.\n   * @throws IOException if an ACL could not be modified\n   */\n  public void setAcl(Path path, List<AclEntry> aclSpec) throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support setAcl\");\n  }\n","sourceCodeStart":1297,"sourceCodeEnd":1333,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java#L1297-L1333","documentation":"removeAcl (discard all ACL entries except the base owner/group/other bits) has no default implementation in AbstractFileSystem: filesystems without ACL support throw UnsupportedOperationException naming themselves. It works only where ACLs exist (HDFS with dfs.namenode.acls.enabled=true, local filesystems with POSIX ACLs) and is reachable through FileContext and 'hadoop fs -setfacl -b'.","triggerScenarios":"fc.removeAcl(path) on an object store, ftp, or http filesystem; setfacl -b executed against a defaultFS lacking ACLs; bulk permission-normalization jobs that clear ACLs on every path they visit.","commonSituations":"Data-lake migrations to S3-compatible storage keeping HDFS ACL cleanup steps; compliance scripts resetting access masks across heterogeneous stores; local tests on filesystems mounted without ACL support.","solutions":["Check fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS) before calling and skip otherwise","On HDFS, confirm dfs.namenode.acls.enabled=true in namenode config","When unsupported, apply setPermission to reset to plain bits instead of removeAcl"],"exampleFix":"// before\nfc.removeAcl(path); // -> UnsupportedOperationException\n\n// after\nif (fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  fc.removeAcl(path);\n} else {\n  fc.setPermission(path, FsPermission.createImmutable((short) 0644));\n}","handlingStrategy":"validation","validationCode":"if (fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  fc.removeAcl(path);\n} else {\n  fc.setPermission(path, FsPermission.createImmutable((short) 0644));\n}","typeGuard":"boolean aclCapable(Path p) throws IOException {\n  return fc.hasPathCapability(p, CommonPathCapabilities.FS_ACLS);\n}","tryCatchPattern":"try { fc.removeAcl(path); } catch (UnsupportedOperationException e) { /* no ACLs: reset mode bits with setPermission instead */ }","preventionTips":["Normalize permissions store-aware: removeAcl on ACL stores, setPermission elsewhere","Probe capability once and cache per filesystem scheme","Avoid blanket 'hadoop fs -setfacl -b' across mixed-protocol data lakes"],"tags":["acl","unsupported-feature","object-store","permissions","hadoop-fs"],"backgroundTag":"filesystem-capability-unsupported","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}