{"record":{"id":"5e795cb312943bfd","repo":"apache/hadoop","slug":"doesn-t-support-removedefaultacl","errorCode":null,"errorMessage":"{} 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/FileSystem.java","lineNumber":3180,"sourceCode":"   *         (default outcome).\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   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\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   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\n   */\n  public void removeAcl(Path path)\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support removeAcl\");\n  }","sourceCodeStart":3162,"sourceCodeEnd":3198,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L3162-L3198","documentation":"FileSystem.removeDefaultAcl(Path) is optional; the base class throws UnsupportedOperationException with getClass().getSimpleName() + \" doesn't support removeDefaultAcl\". Default ACLs (inherited by children) are an HDFS concept; only the HDFS-family clients, ABFS, and pass-through wrappers implement the operation. Local filesystem and most object-store connectors throw.","triggerScenarios":"Calling fs.removeDefaultAcl(path) on file://, s3a://, gs://, har:// or a custom FileSystem without the override; scripts that strip inheritance ('stop inheriting these defaults') before restructuring a directory tree.","commonSituations":"Directory-inheritance management run against the wrong scheme; the same admin script applied uniformly across a mixed HDFS + object-store data lake.","solutions":["Probe fs.hasPathCapability(path, CommonPathCapabilities.FS_ACLS) first","Scope inheritance-management scripts to hdfs:// paths only","Catch UnsupportedOperationException and continue — no default ACLs can exist on such stores","For object stores, manage 'inheritance' via your own manifest of per-prefix permissions"],"exampleFix":"// before\nfs.removeDefaultAcl(dir); // throws on LocalFileSystem\n\n// after\ntry {\n  fs.removeDefaultAcl(dir);\n} catch (UnsupportedOperationException e) {\n  LOG.info(\"No default-ACL support on {}: nothing to remove\", fs.getUri());\n}","handlingStrategy":"try-catch","validationCode":"if (fs.hasPathCapability(dir, CommonPathCapabilities.FS_ACLS)) {\n  fs.removeDefaultAcl(dir);\n}","typeGuard":"static boolean supportsDefaultAcls(FileSystem fs) {\n  return fs instanceof DistributedFileSystem\n      || fs instanceof WebHdfsFileSystem;\n}","tryCatchPattern":"try {\n  fs.removeDefaultAcl(dir);\n} catch (UnsupportedOperationException e) {\n  // store cannot have default ACLs: nothing to do\n}","preventionTips":["Treat default-ACL stripping as a no-op on ACL-less stores","Keep inheritance playbooks HDFS-specific and store other schemes' rules separately","Capability-probe before the operation instead of parsing exception messages"],"tags":["hadoop","filesystem","hdfs","acl","default-acl","unsupportedoperationexception"],"backgroundTag":"filesystem-acl-unsupported","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}