apache/hadoop · error · InvalidAclOperationException

Duplicate acl entries are not allowed.

Error message

Duplicate acl entries are not allowed.

What it means

Error "Duplicate acl entries are not allowed." thrown in apache/hadoop.

Source

Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsAclHelper.java:55

 * from setAcl and getAcl.
 */
@InterfaceAudience.Private
@InterfaceStability.Evolving
public final class AbfsAclHelper {

  private AbfsAclHelper() {
    // not called
  }

  public static Map<String, String> deserializeAclSpec(final String aclSpecString) throws AzureBlobFileSystemException {
    final Map<String, String> aclEntries  = new HashMap<>();
    final String[] aceArray = aclSpecString.split(AbfsHttpConstants.COMMA);
    for (String ace : aceArray) {
      int idx = ace.lastIndexOf(AbfsHttpConstants.COLON);
      final String key = ace.substring(0, idx);
      final String val = ace.substring(idx + 1);
      if (aclEntries.containsKey(key)) {
        throw new InvalidAclOperationException("Duplicate acl entries are not allowed.");
      }
      aclEntries.put(key, val);
    }
    return aclEntries;
  }

  public static String serializeAclSpec(final Map<String, String> aclEntries) {
    final StringBuilder sb = new StringBuilder();
    for (Map.Entry<String, String> aclEntry : aclEntries.entrySet()) {
      sb.append(aclEntry.getKey() + AbfsHttpConstants.COLON + aclEntry.getValue() + AbfsHttpConstants.COMMA);
    }
    if (sb.length() > 0) {
      sb.setLength(sb.length() - 1);
    }
    return sb.toString();
  }

  public static String processAclString(final String aclSpecString) {

View on GitHub (pinned to 2add963021)

Solutions

  1. Remove duplicate entries from the ACL spec before calling setAcl/modifyAclEntries.
  2. Ensure each user/group appears only once in the access or default ACL.

When it happens

Trigger: An ACL specification passed to ABFS contains the same entry twice.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/811fbcd1514dc9c3. Report an issue: GitHub.