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

Atlassian JIRA | Tiago Comasseto [Atlassian] | 6 years ago
  1. 0

    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.

    Atlassian JIRA | 6 years ago | Tiago Comasseto [Atlassian]
    java.lang.IllegalStateException: Found duplicate memberships for user in directory 2392065, group Test_group, user TestUser
  2. 0

    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.

    Atlassian JIRA | 6 years ago | Tiago Comasseto [Atlassian]
    java.lang.IllegalStateException: Found duplicate memberships for user in directory 2392065, group Test_group, user TestUser
  3. 0

    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.

    Atlassian JIRA | 5 years ago | Morgana Spindler [Atlassian]
    java.lang.IllegalStateException: Found duplicate memberships for user in directory 7405569, group dcc_users, user JBaran
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    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.

    Atlassian JIRA | 5 years ago | Morgana Spindler [Atlassian]
    java.lang.IllegalStateException: Found duplicate memberships for user in directory 7405569, group dcc_users, user JBaran
  6. 0

    BASIC Authentication is not working

    Oracle Community | 6 years ago | 447464
    java.lang.IllegalStateException: No remote user found in HTTP request.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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()
    2. com.atlassian.crowd
      HibernateMembershipDao$1.doInHibernate
      1. com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao$1.doInHibernate(HibernateMembershipDao.java:150)
      1 frame
    3. Hibernate
      HibernateTemplate.execute
      1. org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
      2. org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337)
      2 frames
    4. com.atlassian.crowd
      HibernateMembershipDao.removeUserFromGroup
      1. com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.internalFindUserMembership(HibernateMembershipDao.java:137)
      2. com.atlassian.crowd.embedded.hibernate2.HibernateMembershipDao.removeUserFromGroup(HibernateMembershipDao.java:109)
      2 frames
    5. com.atlassian.confluence
      CachedCrowdMembershipDao.removeUserFromGroup
      1. com.atlassian.confluence.user.crowd.CachedCrowdMembershipDao.removeUserFromGroup(CachedCrowdMembershipDao.java:93)
      1 frame
    6. com.atlassian.crowd
      DbCachingRemoteChangeOperations.removeUserMembershipsForGroup
      1. com.atlassian.crowd.directory.AbstractInternalDirectory.removeUserFromGroup(AbstractInternalDirectory.java:718)
      2. com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.removeUserMembershipsForGroup(DbCachingRemoteChangeOperations.java:684)
      2 frames
    7. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor389.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    8. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      3 frames
    9. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      1 frame
    10. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    11. com.atlassian.crowd
      DirectoryPollerJobBean.executeInternal
      1. com.atlassian.crowd.directory.$Proxy713.removeUserMembershipsForGroup(Unknown Source)
      2. com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncUserMembershipsForGroup(DirectoryCacheImplUsingChangeOperations.java:117)
      3. com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMembershipsForGroup(AbstractCacheRefresher.java:126)
      4. com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:63)
      5. com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:37)
      6. com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:645)
      7. com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63)
      8. com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)
      9. com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJobBean.executeInternal(DirectoryPollerJobBean.java:29)
      9 frames
    12. Spring Context Support
      QuartzJobBean.execute
      1. org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
      1 frame
    13. quartz
      JobRunShell.run
      1. org.quartz.core.JobRunShell.run(JobRunShell.java:199)
      1 frame
    14. com.atlassian.confluence
      ConfluenceQuartzThreadPool$1.run
      1. com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:14)
      1 frame
    15. quartz
      SimpleThreadPool$WorkerThread.run
      1. org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
      1 frame