'Unable to synchronise directory' Due to Duplicate Groups in an External Directory

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Symptoms

Synchronization of directories fails. The following appears in the atlassian-jira.log:

1 2 3 2012-06-04 12:18:44,664 QuartzWorker-1 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10200 ]. com.atlassian.crowd.exception.OperationFailedException: Unable to synchronise directory: duplicate groups with name 'IT' at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:131)
1 2 3 4 5 2011-11-02 09:18:19,790 QuartzWorker-0 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10000 ]. com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting:[GenericEntity:Group][id,12711][groupName,IT][updatedDate,2011-11-02 09:18:19.732][description,Testing][directoryId,10000][lowerDescription,testing][active,1][local,0][type,GROUP][lowerGroupName,it][createdDate,2011-11-02 09:18:19.732] (SQL Exception while executing the following:INSERT INTO cwd_group (ID, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry 'it-10000' for key 2)) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167) at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.add(OfBizGroupDao.java:154) at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.add(OfBizGroupDao.java:140)

Diagnosis

Occurs when using *Read Only, with Local Groups* or *Read/Write* LDAP Permissions in your directory connector.

Cause

This issue is caused by there being multiple groups in your external directory with the same name (could be different cases name).

Solution

Resolution

  1. If you want to use some of your groups then you must configure your Group Object Filter in the Group Schema Settings of your connector to not include the groups causing issues. Example:

    1 (objectCategory=Group)&(!(cn=Users))
  2. If you want to use groups only in JIRA, and exclude all of the groups in your directory then you can specify a bogus objectCategory. Example:

    1 (objectCategory=FKSLDJFHNSDUIEWIYFHBYCNWNCEWNFIYWFBLYCINEW)

    ℹ️ There is an open bug to improve the handling of this. All users hitting this issue are encouraged to vote and comment on it. JRASERVER-28484 - Improve handling of duplicate group

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.