{"record":{"id":"e264b0c262e2b0fe","repo":"apache/hadoop","slug":"doesn-t-support-setacl","errorCode":null,"errorMessage":"{} doesn't support setAcl","messagePattern":"(.+?) doesn't support setAcl","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java","lineNumber":1330,"sourceCode":"   */\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\n  /**\n   * Gets the ACLs of files and directories.\n   *\n   * @param path Path to get\n   * @return RemoteIterator{@literal <AclStatus>} which returns each AclStatus\n   * @throws IOException if an ACL could not be read\n   */\n  public AclStatus getAclStatus(Path path) throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support getAclStatus\");\n  }\n\n  /**\n   * Set an xattr of a file or directory.\n   * The name must be prefixed with the namespace followed by \".\". For example,","sourceCodeStart":1312,"sourceCodeEnd":1348,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java#L1312-L1348","documentation":"setAcl (fully replace a file's ACL, discarding existing entries) is one of the ACL operations AbstractFileSystem deliberately leaves unimplemented: the default throws UnsupportedOperationException with the filesystem's simple class name. Only ACL-capable filesystems (HDFS with ACLs enabled, RawLocalFileSystem on POSIX-ACL kernels, wrapper filesystems) override it; FileContext.setAcl and 'hadoop fs -setfacl --set' hit the same default elsewhere.","triggerScenarios":"fc.setAcl(path, aclSpec) on S3A/ABFS/GCS, ftp, or http; 'hadoop fs -setfacl --set' against a defaultFS without ACL support; provisioning code that installs full ACLs on every output path regardless of store.","commonSituations":"Uniform access-control provisioning across mixed HDFS/object-store data lakes; tools ported from HDFS clusters to S3 endpoints; integration tests on LocalFs where the backing filesystem lacks ACL support.","solutions":["Gate with fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS) and choose the permission path accordingly","On HDFS ensure dfs.namenode.acls.enabled=true; note the ACL spec must include user/group/other entries (the base permission bits)","Degrade to setPermission with equivalent mode bits when the store has no ACLs"],"exampleFix":"// before\nfc.setAcl(path, fullAclSpec); // -> UnsupportedOperationException\n\n// after\nif (fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  fc.setAcl(path, fullAclSpec);\n} else {\n  fc.setPermission(path, permsFromAcl(fullAclSpec));\n}","handlingStrategy":"validation","validationCode":"if (fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  fc.setAcl(path, fullAclSpec);\n} else {\n  fc.setPermission(path, permsFromAcl(fullAclSpec));\n}","typeGuard":"boolean aclCapable(Path p) throws IOException {\n  return fc.hasPathCapability(p, CommonPathCapabilities.FS_ACLS);\n}","tryCatchPattern":"try { fc.setAcl(path, aclSpec); } catch (UnsupportedOperationException e) { /* fall back to setPermission with equivalent mode bits */ }","preventionTips":["Include mandatory user/group/other entries in full-ACL specs for bit compatibility","Branch provisioning on fs.capability.paths.acls instead of assuming HDFS semantics","Keep a mapping from ACL specs to plain mode bits for degraded stores"],"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"}