java.lang.IllegalStateException: Found duplicate memberships for user in directory 2392065, group Test_group, user TestUser

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • h3.Problem The directory synchronization fail showing at the log an error informing duplicated membership, as the following message: {code} 2011-06-07 14:31:13,320 ERROR [QuartzScheduler_Worker-9] [atlassian.crowd.directory.DbCachingDirectoryPoller] pollChanges Error occurred while refreshing the cache for directory [ 2392065 ]. java.lang.IllegalStateException: Found duplicate memberships for user in directory 2392065, group Test_group, user TestUser at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao$1.doInHibernate(HibernateMembershipDao.java:150) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.internalFindUserMembership(HibernateMembershipDao.java:137) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.removeUserFromGroup(HibernateMembershipDao.java:109) at com.atlassian.confluence.user.crowd.CachedCrowdMembershipDao.removeUserFromGroup(CachedCrowdMembershipDao.java:93) at com.atlassian.crowd.directory.AbstractInternalDirectory.removeUserFromGroup(AbstractInternalDirectory.java:718) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.removeUserMembershipsForGroup(DbCachingRemoteChangeOperations.java:684) at sun.reflect.GeneratedMethodAccessor389.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.atlassian.crowd.directory.$Proxy713.removeUserMembershipsForGroup(Unknown Source) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncUserMembershipsForGroup(DirectoryCacheImplUsingChangeOperations.java:117) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMembershipsForGroup(AbstractCacheRefresher.java:126) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:63) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:37) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:645) 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.DirectoryPollerJobBean.executeInternal(DirectoryPollerJobBean.java:29) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:14) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) {code} The duplicated membership can be confirmed running this query: {code:sql} SELECT u.user_name, g.group_name FROM cwd_user u, cwd_group g, cwd_membership m WHERE u.id = m.child_user_id AND g.id = m.parent_id AND u.user_name = '?'; {code} *Note:* Where *?* is the username mentioned at the error message. This query returns a result as following: {code} mysql> SELECT u.user_name, g.group_name FROM cwd_user u, cwd_group g, cwd_membership m WHERE u.id = m.child_user_id AND g.id = m.parent_id AND u.user_name = 'TestUser'; +-----------+------------+ | user_name | group_name | +-----------+------------+ | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | +-----------+------------+ 175 rows in set (0.00 sec) {code} h3.Fix There is none yet. h3.Workaround Disable and remove the Directory on Confluence *User directories* link, restart your Confluence instance, then recreate the Directory again.
    via by Tiago Comasseto [Atlassian],
  • h3.Problem The directory synchronization fail showing at the log an error informing duplicated membership, as the following message: {code} 2011-06-07 14:31:13,320 ERROR [QuartzScheduler_Worker-9] [atlassian.crowd.directory.DbCachingDirectoryPoller] pollChanges Error occurred while refreshing the cache for directory [ 2392065 ]. java.lang.IllegalStateException: Found duplicate memberships for user in directory 2392065, group Test_group, user TestUser at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao$1.doInHibernate(HibernateMembershipDao.java:150) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.internalFindUserMembership(HibernateMembershipDao.java:137) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.removeUserFromGroup(HibernateMembershipDao.java:109) at com.atlassian.confluence.user.crowd.CachedCrowdMembershipDao.removeUserFromGroup(CachedCrowdMembershipDao.java:93) at com.atlassian.crowd.directory.AbstractInternalDirectory.removeUserFromGroup(AbstractInternalDirectory.java:718) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.removeUserMembershipsForGroup(DbCachingRemoteChangeOperations.java:684) at sun.reflect.GeneratedMethodAccessor389.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.atlassian.crowd.directory.$Proxy713.removeUserMembershipsForGroup(Unknown Source) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncUserMembershipsForGroup(DirectoryCacheImplUsingChangeOperations.java:117) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMembershipsForGroup(AbstractCacheRefresher.java:126) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:63) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:37) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:645) 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.DirectoryPollerJobBean.executeInternal(DirectoryPollerJobBean.java:29) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:14) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) {code} The duplicated membership can be confirmed running this query: {code:sql} SELECT u.user_name, g.group_name FROM cwd_user u, cwd_group g, cwd_membership m WHERE u.id = m.child_user_id AND g.id = m.parent_id AND u.user_name = '?'; {code} *Note:* Where *?* is the username mentioned at the error message. This query returns a result as following: {code} mysql> SELECT u.user_name, g.group_name FROM cwd_user u, cwd_group g, cwd_membership m WHERE u.id = m.child_user_id AND g.id = m.parent_id AND u.user_name = 'TestUser'; +-----------+------------+ | user_name | group_name | +-----------+------------+ | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | | TestUser | Test_group | +-----------+------------+ 175 rows in set (0.00 sec) {code} h3.Fix There is none yet. h3.Workaround Disable and remove the Directory on Confluence *User directories* link, restart your Confluence instance, then recreate the Directory again.
    via by Tiago Comasseto [Atlassian],
  • Environment: - JIRA 4.3.x and/or Confluence 3.5.x with Crowd Connector - Crowd with LDAP/AD connectors As per your investigations, it does look like a mixed case username has somehow sneaked in to one of the directories. Sync in JIRA fail with: {code} 2011-06-08 13:10:47,968 QuartzWorker-1 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:Membership][id,11072][membershipType,GROUP_USER][lowerParentName,dcc_users][parentId,10415][childId,10422][childName,MWong][lowerChildName,mwong][directoryId,10000][parentName,dcc_users] (SQL Exception while executing the following:INSERT INTO cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry '10415-10422-GROUP_USER' for key 2)) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167) at com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.createMembership(OfBizInternalMembershipDao.java:112) at com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.addUserToGroup(OfBizInternalMembershipDao.java:105) at com.atlassian.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addUserToGroup(OfBizDelegatingMembershipDao.java:71) at com.atlassian.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addAllUsersToGroup(OfBizDelegatingMembershipDao.java:44) at com.atlassian.crowd.directory.CachingDirectory.addAllUsersToGroup(CachingDirectory.java:125) at com.atlassian.crowd.directory.DbCachingRemoteDirectoryCache.syncUserMembershipsForGroup(DbCachingRemoteDirectoryCache.java:671) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMembershipsForGroup(AbstractCacheRefresher.java:126) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:63) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:37) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:645) at com.atlassian.crowd.manager.directory.DirectorySynchroniserHelperImpl.synchronise(DirectorySynchroniserHelperImpl.java:84) 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,11072][membershipType,GROUP_USER][lowerParentName,dcc_users][parentId,10415][childId,10422][childName,MWong][lowerChildName,mwong][directoryId,10000][parentName,dcc_users] (SQL Exception while executing the following:INSERT INTO cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry '10415-10422-GROUP_USER' for key 2)) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:156) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:121) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:63) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:489) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:469) at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:77) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:162) ... 17 more {code} Sync in Confluence fail with: {code} 2011-06-09 14:53:37,054 ERROR [QuartzScheduler_Worker-2] [atlassian.crowd.directory.DbCachingDirectoryPoller] pollChanges Error occurred while refreshing the cache for directory [ 7405569 ]. java.lang.IllegalStateException: Found duplicate memberships for user in directory 7405569, group dcc_users, user JBaran at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao$1.doInHibernate(HibernateMembershipDao.java:150) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.internalFindUserMembership(HibernateMembershipDao.java:137) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.removeUserFromGroup(HibernateMembershipDao.java:109) at com.atlassian.confluence.user.crowd.CachedCrowdMembershipDao.removeUserFromGroup(CachedCrowdMembershipDao.java:93) at com.atlassian.crowd.directory.AbstractInternalDirectory.removeUserFromGroup(AbstractInternalDirectory.java:718) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.removeUserMembershipsForGroup(DbCachingRemoteChangeOperations.java:684) at sun.reflect.GeneratedMethodAccessor393.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.atlassian.crowd.directory.$Proxy672.removeUserMembershipsForGroup(Unknown Source) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncUserMembershipsForGroup(DirectoryCacheImplUsingChangeOperations.java:117) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMembershipsForGroup(AbstractCacheRefresher.java:126) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:63) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:37) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:645) 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.DirectoryPollerJobBean.executeInternal(DirectoryPollerJobBean.java:29) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:14) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) {code} [Enforcing Lower-Case Usernames, Groups and Roles for an Application| http://confluence.atlassian.com/display/CROWD/Enforcing+Lower-Case+Usernames%2C+Groups+and+Roles+for+an+Application] disabling the existing Crowd directory and recreating it in JIRA/Confuence solves the problem.
    via by Morgana Spindler [Atlassian],
  • Environment: - JIRA 4.3.x and/or Confluence 3.5.x with Crowd Connector - Crowd with LDAP/AD connectors As per your investigations, it does look like a mixed case username has somehow sneaked in to one of the directories. Sync in JIRA fail with: {code} 2011-06-08 13:10:47,968 QuartzWorker-1 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:Membership][id,11072][membershipType,GROUP_USER][lowerParentName,dcc_users][parentId,10415][childId,10422][childName,MWong][lowerChildName,mwong][directoryId,10000][parentName,dcc_users] (SQL Exception while executing the following:INSERT INTO cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry '10415-10422-GROUP_USER' for key 2)) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167) at com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.createMembership(OfBizInternalMembershipDao.java:112) at com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.addUserToGroup(OfBizInternalMembershipDao.java:105) at com.atlassian.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addUserToGroup(OfBizDelegatingMembershipDao.java:71) at com.atlassian.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addAllUsersToGroup(OfBizDelegatingMembershipDao.java:44) at com.atlassian.crowd.directory.CachingDirectory.addAllUsersToGroup(CachingDirectory.java:125) at com.atlassian.crowd.directory.DbCachingRemoteDirectoryCache.syncUserMembershipsForGroup(DbCachingRemoteDirectoryCache.java:671) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMembershipsForGroup(AbstractCacheRefresher.java:126) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:63) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:37) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:645) at com.atlassian.crowd.manager.directory.DirectorySynchroniserHelperImpl.synchronise(DirectorySynchroniserHelperImpl.java:84) 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,11072][membershipType,GROUP_USER][lowerParentName,dcc_users][parentId,10415][childId,10422][childName,MWong][lowerChildName,mwong][directoryId,10000][parentName,dcc_users] (SQL Exception while executing the following:INSERT INTO cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate entry '10415-10422-GROUP_USER' for key 2)) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:156) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:121) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:63) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:489) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:469) at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:77) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:162) ... 17 more {code} Sync in Confluence fail with: {code} 2011-06-09 14:53:37,054 ERROR [QuartzScheduler_Worker-2] [atlassian.crowd.directory.DbCachingDirectoryPoller] pollChanges Error occurred while refreshing the cache for directory [ 7405569 ]. java.lang.IllegalStateException: Found duplicate memberships for user in directory 7405569, group dcc_users, user JBaran at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao$1.doInHibernate(HibernateMembershipDao.java:150) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.internalFindUserMembership(HibernateMembershipDao.java:137) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.removeUserFromGroup(HibernateMembershipDao.java:109) at com.atlassian.confluence.user.crowd.CachedCrowdMembershipDao.removeUserFromGroup(CachedCrowdMembershipDao.java:93) at com.atlassian.crowd.directory.AbstractInternalDirectory.removeUserFromGroup(AbstractInternalDirectory.java:718) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.removeUserMembershipsForGroup(DbCachingRemoteChangeOperations.java:684) at sun.reflect.GeneratedMethodAccessor393.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.atlassian.crowd.directory.$Proxy672.removeUserMembershipsForGroup(Unknown Source) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncUserMembershipsForGroup(DirectoryCacheImplUsingChangeOperations.java:117) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMembershipsForGroup(AbstractCacheRefresher.java:126) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:63) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:37) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:645) 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.DirectoryPollerJobBean.executeInternal(DirectoryPollerJobBean.java:29) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:14) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) {code} [Enforcing Lower-Case Usernames, Groups and Roles for an Application| http://confluence.atlassian.com/display/CROWD/Enforcing+Lower-Case+Usernames%2C+Groups+and+Roles+for+an+Application] disabling the existing Crowd directory and recreating it in JIRA/Confuence solves the problem.
    via by Morgana Spindler [Atlassian],
    • java.lang.IllegalStateException: Found duplicate memberships for user in directory 2392065, group Test_group, user TestUser at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao$1.doInHibernate(HibernateMembershipDao.java:150) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.internalFindUserMembership(HibernateMembershipDao.java:137) at com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.removeUserFromGroup(HibernateMembershipDao.java:109) at com.atlassian.confluence.user.crowd.CachedCrowdMembershipDao.removeUserFromGroup(CachedCrowdMembershipDao.java:93) at com.atlassian.crowd.directory.AbstractInternalDirectory.removeUserFromGroup(AbstractInternalDirectory.java:718) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.removeUserMembershipsForGroup(DbCachingRemoteChangeOperations.java:684) at sun.reflect.GeneratedMethodAccessor389.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.atlassian.crowd.directory.$Proxy713.removeUserMembershipsForGroup(Unknown Source) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncUserMembershipsForGroup(DirectoryCacheImplUsingChangeOperations.java:117) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMembershipsForGroup(AbstractCacheRefresher.java:126) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:63) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:37) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:645) 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.DirectoryPollerJobBean.executeInternal(DirectoryPollerJobBean.java:29) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:14) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
    No Bugmate found.