{"record":{"id":"25ffaf8a3e8b3124","repo":"apache/hadoop","slug":"getclass-getsimplename-doesn-t-support-remov-25ffaf","errorCode":null,"errorMessage":"{getClass().getSimpleName()} doesn't support removeDefaultAcl","messagePattern":"(.+?) doesn't support removeDefaultAcl","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java","lineNumber":1301,"sourceCode":"   * @param path Path to modify\n   * @param aclSpec List{@literal <AclEntry>} describing entries to remove\n   * @throws IOException if an ACL could not be modified\n   */\n  public void removeAclEntries(Path path, List<AclEntry> aclSpec)\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support removeAclEntries\");\n  }\n\n  /**\n   * Removes all default ACL entries from files and directories.\n   *\n   * @param path Path to modify\n   * @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  /**","sourceCodeStart":1283,"sourceCodeEnd":1319,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java#L1283-L1319","documentation":"removeDefaultAcl (strip the inherited 'default' ACL entries from a directory) is an opt-in ACL method: the base AbstractFileSystem throws UnsupportedOperationException with the filesystem's simple class name because default ACLs only exist where ACLs are implemented. HDFS with ACLs enabled and POSIX-ACL-capable local filesystems support it; object stores and most others never override the method.","triggerScenarios":"fc.removeDefaultAcl(path) on a non-ACL filesystem (S3A, ABFS, http, ftp); 'hadoop fs -setfacl -k' routed to a defaultFS without ACL support; recursive permission-reset utilities that clear default ACLs on every directory.","commonSituations":"Hardening scripts that remove inheritance defaults across all data stores; pipelines moved from HDFS to object storage; test runs on LocalFs where the underlying kernel filesystem has no ACL support.","solutions":["Probe fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS) first and skip default-ACL cleanup when false","On HDFS verify dfs.namenode.acls.enabled=true before issuing ACL commands","Where unsupported, recreate the directory without defaults or fall back to plain setPermission"],"exampleFix":"// before\nfc.removeDefaultAcl(path); // -> UnsupportedOperationException\n\n// after\nif (fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  fc.removeDefaultAcl(path);\n}","handlingStrategy":"validation","validationCode":"if (fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  fc.removeDefaultAcl(path);\n}","typeGuard":"boolean aclCapable(Path p) throws IOException {\n  return fc.hasPathCapability(p, CommonPathCapabilities.FS_ACLS);\n}","tryCatchPattern":"try { fc.removeDefaultAcl(path); } catch (UnsupportedOperationException e) { /* default ACLs do not exist on this store: skip */ }","preventionTips":["Check the ACL capability before clearing default/inherited ACLs","Make hardening scripts store-aware: HDFS gets ACL cleanup, object stores get permission bits","On LocalFs verify the underlying filesystem is mounted with POSIX ACL support"],"tags":["acl","default-acl","unsupported-feature","object-store","hadoop-fs"],"backgroundTag":"filesystem-capability-unsupported","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}