{"record":{"id":"cbf33f44a8171871","repo":"apache/hadoop","slug":"getclass-getsimplename-doesn-t-support-modif","errorCode":null,"errorMessage":"{getClass().getSimpleName()} doesn't support modifyAclEntries","messagePattern":"(.+?) doesn't support modifyAclEntries","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java","lineNumber":1275,"sourceCode":"   */\n  @InterfaceAudience.LimitedPrivate( { \"HDFS\", \"MapReduce\" })\n  public List<Token<?>> getDelegationTokens(String renewer) throws IOException {\n    return Collections.emptyList();\n  }\n\n  /**\n   * Modifies ACL entries of files and directories.  This method can add new ACL\n   * entries or modify the permissions on existing ACL entries.  All existing\n   * ACL entries that are not specified in this call are retained without\n   * changes.  (Modifications are merged into the current ACL.)\n   *\n   * @param path Path to modify\n   * @param aclSpec List{@literal <AclEntry>} describing modifications\n   * @throws IOException if an ACL could not be modified\n   */\n  public void modifyAclEntries(Path path, List<AclEntry> aclSpec)\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support modifyAclEntries\");\n  }\n\n  /**\n   * Removes ACL entries from files and directories.  Other ACL entries are\n   * retained.\n   *\n   * @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  /**","sourceCodeStart":1257,"sourceCodeEnd":1293,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java#L1257-L1293","documentation":"The ACL API has no base implementation: AbstractFileSystem.modifyAclEntries throws UnsupportedOperationException naming the filesystem class unless the concrete AFS overrides it. Only HDFS (with dfs.namenode.acls.enabled=true) and RawLocalFileSystem (where the OS provides POSIX ACLs), plus pass-through wrappers, implement it; FileContext.modifyAclEntries (FileContext.java:2456) delegates here, so fc and 'hadoop fs -setfacl -m' fail identically on other stores.","triggerScenarios":"fc.modifyAclEntries(path, aclSpec) on an object store (S3A, ABFS, GCS), ftp, or http filesystem; setfacl commands routed to a defaultFS that lacks ACL support; HDFS with dfs.namenode.acls.enabled=false failing the same call server-side.","commonSituations":"Security tooling that provisions ACLs uniformly across all configured filesystems; jobs moved from HDFS to S3-compatible storage; test environments on LocalFs running on filesystems (tmpfs, some containers) without POSIX ACL kernel support.","solutions":["Probe first: fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS) and skip or degrade when false","On HDFS, ensure dfs.namenode.acls.enabled=true (ACLs need the NameNode flag and cannot be enabled client-side)","Degrade to classic permission bits with setPermission when the store has no ACLs"],"exampleFix":"// before\nfc.modifyAclEntries(path, aclSpec); // on s3a:// -> UnsupportedOperationException\n\n// after\nif (fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  fc.modifyAclEntries(path, aclSpec);\n} else {\n  fc.setPermission(path, FsPermission.createImmutable((short) 0750));\n}","handlingStrategy":"validation","validationCode":"if (fc.hasPathCapability(path, CommonPathCapabilities.FS_ACLS)) {\n  fc.modifyAclEntries(path, aclSpec);\n} else {\n  fc.setPermission(path, fallbackPerms);\n}","typeGuard":"boolean aclCapable(Path p) throws IOException {\n  return fc.hasPathCapability(p, CommonPathCapabilities.FS_ACLS);\n}","tryCatchPattern":"try { fc.modifyAclEntries(path, aclSpec); } catch (UnsupportedOperationException e) { /* store has no ACLs: fall back to setPermission */ }","preventionTips":["Probe fs.capability.paths.acls once per filesystem and branch provisioning logic on it","Keep an HDFS test cluster (or miniDFS) for ACL code paths; LocalFs ACLs depend on the OS","On HDFS confirm dfs.namenode.acls.enabled=true before shipping ACL tooling"],"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"}