crowd synchronisation fails: duplicate key value violates unique constraint "uk_mem_parent_child_type"

{code}

2013-02-27 12:44:33,837 QuartzWorker-0 INFO ServiceRunner atlassian.crowd.directory.DbCachingRemoteDirectory synchronisation for directory 10400 starting

2013-02-27 12:44:33,837 QuartzWorker-0 INFO ServiceRunner atlassian.crowd.directory.DbCachingRemoteDirectory synchronisation for directory 10400 starting

2013-02-27 12:44:34,760 QuartzWorker-0 INFO ServiceRunner atlassian.crowd.directory.DbCachingRemoteDirectory failed synchronisation complete in 923ms

2013-02-27 12:44:34,760 QuartzWorker-0 INFO ServiceRunner atlassian.crowd.directory.DbCachingRemoteDirectory failed synchronisation complete in 923ms

2013-02-27 12:44:34,776 QuartzWorker-0 ERROR ServiceRunner atlassian.crowd.directory.DbCachingDirectoryPoller Error occurred while refreshing the cache for directory 10400 .

com.atlassian.jira.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: GenericEntity:Membership id,45575 membershipType,GROUP_USER lowerParentName,confluence-users parentId,25442 childId,68468 childName,alvinc lowerChildName,alvinc directoryId,10400 parentName,confluence-users (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint uk_mem_parent_child_type))

at com.atlassian.jira.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167)

at com.atlassian.jira.crowd.embedded.ofbiz.OfBizInternalMembershipDao.createMembership(OfBizInternalMembershipDao.java:101)

at com.atlassian.jira.crowd.embedded.ofbiz.OfBizInternalMembershipDao.addUserToGroup(OfBizInternalMembershipDao.java:94)

at com.atlassian.jira.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addUserToGroup(OfBizDelegatingMembershipDao.java:78)

at com.atlassian.crowd.directory.AbstractInternalDirectory.addUserToGroup(AbstractInternalDirectory.java:695)

at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUserToGroup(DbCachingRemoteChangeOperations.java:1151)

at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addUserToGroup(DirectoryCacheImplUsingChangeOperations.java:187)

at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:115)

at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:609)

at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63)

at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)

at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJob.execute(DirectoryPollerJob.java:34)

at org.quartz.core.JobRunShell.run(JobRunShell.java:195)

at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72)

at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

Caused by: org.ofbiz.core.entity.GenericEntityException: while inserting: GenericEntity:Membership id,45575 membershipType,GROUP_USER lowerParentName,confluence-users parentId,25442 childId,68468 childName,alvinc lowerChildName,alvinc directoryId,10400 parentName,confluence-users (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint uk_mem_parent_child_type))

at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:136)

at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:101)

at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:64)

at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:487)

at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:467)

at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:98)

at com.atlassian.jira.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:162)

... 14 more

2013-02-27 12:44:34,776 QuartzWorker-0 ERROR ServiceRunner atlassian.crowd.directory.DbCachingDirectoryPoller Error occurred while refreshing the cache for directory 10400 .

com.atlassian.jira.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: GenericEntity:Membership id,45575 membershipType,GROUP_USER lowerParentName,confluence-users parentId,25442 childId,68468 childName,alvinc lowerChildName,alvinc directoryId,10400 parentName,confluence-users (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint uk_mem_parent_child_type))

at com.atlassian.jira.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167)

at com.atlassian.jira.crowd.embedded.ofbiz.OfBizInternalMembershipDao.createMembership(OfBizInternalMembershipDao.java:101)

at com.atlassian.jira.crowd.embedded.ofbiz.OfBizInternalMembershipDao.addUserToGroup(OfBizInternalMembershipDao.java:94)

at com.atlassian.jira.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addUserToGroup(OfBizDelegatingMembershipDao.java:78)

at com.atlassian.crowd.directory.AbstractInternalDirectory.addUserToGroup(AbstractInternalDirectory.java:695)

at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUserToGroup(DbCachingRemoteChangeOperations.java:1151)

at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addUserToGroup(DirectoryCacheImplUsingChangeOperations.java:187)

at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:115)

at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:609)

at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63)

at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)

at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJob.execute(DirectoryPollerJob.java:34)

at org.quartz.core.JobRunShell.run(JobRunShell.java:195)

at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72)

at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

Caused by: org.ofbiz.core.entity.GenericEntityException: while inserting: GenericEntity:Membership id,45575 membershipType,GROUP_USER lowerParentName,confluence-users parentId,25442 childId,68468 childName,alvinc lowerChildName,alvinc directoryId,10400 parentName,confluence-users (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint uk_mem_parent_child_type))

at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:136)

at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:101)

at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:64)

at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:487)

at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:467)

at com.atlassian.jira.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:162)

... 14 more

{code}

2 answers

Hi Sorin,

It seems to related to this bug ticket: https://jira.atlassian.com/browse/JRA-27353

Did you have mix-case group name presented in JIRA instance or crowd or LDAP side(from crowd directory)?

Until you get a chance to upgrade to 5.2.7 (which is reported to fix the bug that tecken linked to), there is a work-around at https://confluence.atlassian.com/pages/viewpage.action?pageId=321257915

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,304 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot