{"record":{"id":"72db5bd8282f5596","repo":"apache/hadoop","slug":"invalid-acl-multiple-entries-with-same-scope-typ","errorCode":null,"errorMessage":"Invalid ACL: multiple entries with same scope, type and name.","messagePattern":"Invalid ACL: multiple entries with same scope, type and name\\.","errorType":"exception","errorClass":"AclException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/AclTransformation.java","lineNumber":280,"sourceCode":"\n  /**\n   * Builds the final list of ACL entries to return by trimming, sorting and\n   * validating the ACL entries that have been added.\n   *\n   * @param aclBuilder ArrayList<AclEntry> containing entries to build\n   * @return List<AclEntry> unmodifiable, sorted list of ACL entries\n   * @throws AclException if validation fails\n   */\n  private static List<AclEntry> buildAndValidateAcl(\n      ArrayList<AclEntry> aclBuilder) throws AclException {\n    aclBuilder.trimToSize();\n    Collections.sort(aclBuilder, ACL_ENTRY_COMPARATOR);\n    // Full iteration to check for duplicates and invalid named entries.\n    AclEntry prevEntry = null;\n    for (AclEntry entry: aclBuilder) {\n      if (prevEntry != null &&\n          ACL_ENTRY_COMPARATOR.compare(prevEntry, entry) == 0) {\n        throw new AclException(\n          \"Invalid ACL: multiple entries with same scope, type and name.\");\n      }\n      if (entry.getName() != null && (entry.getType() == MASK ||\n          entry.getType() == OTHER)) {\n        throw new AclException(\n          \"Invalid ACL: this entry type must not have a name: \" + entry + \".\");\n      }\n      prevEntry = entry;\n    }\n\n    ScopedAclEntries scopedEntries = new ScopedAclEntries(aclBuilder);\n    checkMaxEntries(scopedEntries);\n\n    // Search for the required base access entries.  If there is a default ACL,\n    // then do the same check on the default entries.\n    for (AclEntryType type: EnumSet.of(USER, GROUP, OTHER)) {\n      AclEntry accessEntryKey = new AclEntry.Builder().setScope(ACCESS)\n        .setType(type).build();","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/AclTransformation.java#L262-L298","documentation":"Error \"Invalid ACL: multiple entries with same scope, type and name.\" thrown in apache/hadoop.","triggerScenarios":"setAcl with an ACL spec containing duplicate entries of the same scope, type and name.","commonSituations":"See trigger scenarios.","solutions":["Remove duplicate ACL entries that share the same scope, type and name from the ACL spec.","Merge the permissions of duplicated entries into a single entry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}