com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [32770] from child entity [user] to parent entity [group]

Atlassian JIRA | Diego Berrueta | 4 years ago
  1. 0

    h1. Symptoms The next incremental sync just after an authentication fails and produces an stacktrace in the logs: {noformat} 2013-04-12 10:21:48,053 scheduler_Worker-1 ERROR [atlassian.crowd.directory.DbCachingRemoteDirectory] Incremental synchronisation was unexpectedly interrupted, falling back to a full synchronisation com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [32770] from child entity [user] to parent entity [group] at com.atlassian.crowd.dao.membership.MembershipDAOHibernate.addUserToGroup(MembershipDAOHibernate.java:102) at com.atlassian.crowd.directory.AbstractInternalDirectory.addUserToGroup(AbstractInternalDirectory.java:712) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUserToGroup(DbCachingRemoteChangeOperations.java:1151) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.atlassian.crowd.directory.$Proxy159.addUserToGroup(Unknown Source) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addUserToGroup(DirectoryCacheImplUsingChangeOperations.java:189) at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:119) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:629) at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63) at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50) {noformat} h1. Steps to reproduce # Set up a Remote Crowd directory, configure it to automatically add users to a group on login. # Sync the directory. # In the remote Crowd server, create a user. Do not add him to the group. # Authenticate as the new user in the client application. This causes the user and his memberships to be copied from the server. It also causes the user to be added to the default group in both the client application and the remote server. # Sync the directory. h1. Expected result Client and server are already in sync, the incremental sync should succeed without making any update. h1. Actual outcome Incremental sync attempts to create the membership to the default group again. Since this membership already exists in the client, an exception is thrown and incremental sync fails.

    Atlassian JIRA | 4 years ago | Diego Berrueta Munoz
    com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [32770] from child entity [user] to parent entity [group]
  2. 0

    h1. Symptoms The next incremental sync just after an authentication fails and produces an stacktrace in the logs: {noformat} 2013-04-12 10:21:48,053 scheduler_Worker-1 ERROR [atlassian.crowd.directory.DbCachingRemoteDirectory] Incremental synchronisation was unexpectedly interrupted, falling back to a full synchronisation com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [32770] from child entity [user] to parent entity [group] at com.atlassian.crowd.dao.membership.MembershipDAOHibernate.addUserToGroup(MembershipDAOHibernate.java:102) at com.atlassian.crowd.directory.AbstractInternalDirectory.addUserToGroup(AbstractInternalDirectory.java:712) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUserToGroup(DbCachingRemoteChangeOperations.java:1151) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.atlassian.crowd.directory.$Proxy159.addUserToGroup(Unknown Source) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addUserToGroup(DirectoryCacheImplUsingChangeOperations.java:189) at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:119) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:629) at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63) at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50) {noformat} h1. Steps to reproduce # Set up a Remote Crowd directory/Jira Directory, configure it to automatically add users to a group on login. # Sync the directory. # In the remote Crowd server, create a user. Do not add him to the group. # Authenticate as the new user in the client application. This causes the user and his memberships to be copied from the server. It also causes the user to be added to the default group in both the client application and the remote server. # Sync the directory. h1. Expected result Client and server are already in sync, the incremental sync should succeed without making any update. h1. Actual outcome Incremental sync attempts to create the membership to the default group again. Since this membership already exists in the client, an exception is thrown and incremental sync fails.

    Atlassian JIRA | 1 year ago | Wayne Wong [Atlassian]
    com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [32770] from child entity [user] to parent entity [group]
  3. 0

    h1. Symptoms The next incremental sync just after an authentication fails and produces an stacktrace in the logs: {noformat} 2013-04-12 10:21:48,053 scheduler_Worker-1 ERROR [atlassian.crowd.directory.DbCachingRemoteDirectory] Incremental synchronisation was unexpectedly interrupted, falling back to a full synchronisation com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [32770] from child entity [user] to parent entity [group] at com.atlassian.crowd.dao.membership.MembershipDAOHibernate.addUserToGroup(MembershipDAOHibernate.java:102) at com.atlassian.crowd.directory.AbstractInternalDirectory.addUserToGroup(AbstractInternalDirectory.java:712) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUserToGroup(DbCachingRemoteChangeOperations.java:1151) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.atlassian.crowd.directory.$Proxy159.addUserToGroup(Unknown Source) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addUserToGroup(DirectoryCacheImplUsingChangeOperations.java:189) at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:119) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:629) at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63) at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50) {noformat} h1. Steps to reproduce # Set up a Remote Crowd directory, configure it to automatically add users to a group on login. # Sync the directory. # In the remote Crowd server, create a user. Do not add him to the group. # Authenticate as the new user in the client application. This causes the user and his memberships to be copied from the server. It also causes the user to be added to the default group in both the client application and the remote server. # Sync the directory. h1. Expected result Client and server are already in sync, the incremental sync should succeed without making any update. h1. Actual outcome Incremental sync attempts to create the membership to the default group again. Since this membership already exists in the client, an exception is thrown and incremental sync fails.

    Atlassian JIRA | 4 years ago | Diego Berrueta
    com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [32770] from child entity [user] to parent entity [group]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    h1. Symptoms The next incremental sync just after an authentication fails and produces an stacktrace in the logs: {noformat} 2013-04-12 10:21:48,053 scheduler_Worker-1 ERROR [atlassian.crowd.directory.DbCachingRemoteDirectory] Incremental synchronisation was unexpectedly interrupted, falling back to a full synchronisation com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [32770] from child entity [user] to parent entity [group] at com.atlassian.crowd.dao.membership.MembershipDAOHibernate.addUserToGroup(MembershipDAOHibernate.java:102) at com.atlassian.crowd.directory.AbstractInternalDirectory.addUserToGroup(AbstractInternalDirectory.java:712) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUserToGroup(DbCachingRemoteChangeOperations.java:1151) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.atlassian.crowd.directory.$Proxy159.addUserToGroup(Unknown Source) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addUserToGroup(DirectoryCacheImplUsingChangeOperations.java:189) at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:119) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:629) at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63) at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50) {noformat} h1. Steps to reproduce # Set up a Remote Crowd directory/Jira Directory, configure it to automatically add users to a group on login. # Sync the directory. # In the remote Crowd server, create a user. Do not add him to the group. # Authenticate as the new user in the client application. This causes the user and his memberships to be copied from the server. It also causes the user to be added to the default group in both the client application and the remote server. # Sync the directory. h1. Expected result Client and server are already in sync, the incremental sync should succeed without making any update. h1. Actual outcome Incremental sync attempts to create the membership to the default group again. Since this membership already exists in the client, an exception is thrown and incremental sync fails.

    Atlassian JIRA | 1 year ago | Wayne Wong [Atlassian]
    com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [32770] from child entity [user] to parent entity [group]
  6. 0

    h3. Summary The incremental Synchronization with Crowd fails under the following conditions: * Crowd is connected to an External Directory (Connector). * The user has logged into JIRA at least once and synchronized default group memberships. * The user is renamed in the external directory. h3. Environment * JIRA 6.4.11 * Crowd 2.8.3 * Win2k8 R2 Active Directory h3. Steps to Reproduce # Create the user {{jsmith}} on AD. # Connect Crowd 2.8.3 to AD (connector). # Configure {{Default group memberships}} on Crowd to a group with access to JIRA (e.g. {{jira-users}} or {{jira-core-users}}). # Connect JIRA to Crowd with incremental synchronization enabled. # Perform a full synchronization on Crowd and then JIRA - The user {{jsmith}} will be visible on JIRA. # Login to JIRA as {{jsmith}} - The group memberships will be synchronized and {{jsmith}} will be added to the group configured on Crowd's {{Default group memberships}}. # Rename the user on AD (e.g. to {{john.smith}}). # Synchronize the directory on Crowd - The username will change to {{john.smith}}. # Synchronize the Crowd directory on JIRA. h3. Expected Results The username should be updated to {{john.smith}} during the incremental synchronization. h3. Actual Results The incremental synchronization fails and the following exception is thrown: {noformat} 2015-09-28 15:08:28,139 atlassian-scheduler-quartz1.clustered_Worker-2 ERROR anonymous 681x28x1 1mlipxo 192.168.10.174 /secure/SetupLicense.jspa [com.atlassian.scheduler.JobRunnerResponse] Unable to synchronise directory com.atlassian.crowd.exception.OperationFailedException: com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [10002] from child entity [jsmith] to parent entity [jira-users] at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUserToGroup(DbCachingRemoteChangeOperations.java:1336) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addUserToGroup(DirectoryCacheImplUsingChangeOperations.java:189) at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:168) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:1097) at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:76) at com.atlassian.jira.crowd.embedded.JiraDirectorySynchroniser.synchronizeDirectory(JiraDirectorySynchroniser.java:96) at com.atlassian.jira.crowd.embedded.JiraDirectorySynchroniser.runJob(JiraDirectorySynchroniser.java:60) at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:136) at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:101) at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:80) at com.atlassian.scheduler.quartz1.Quartz1Job.execute(Quartz1Job.java:32) at org.quartz.core.JobRunShell.run(JobRunShell.java:223) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) Caused by: com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [10002] from child entity [jsmith] to parent entity [jira-users] at com.atlassian.jira.crowd.embedded.ofbiz.OfBizInternalMembershipDao.addUserToGroup(OfBizInternalMembershipDao.java:101) at com.atlassian.jira.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addUserToGroup(OfBizDelegatingMembershipDao.java:109) at com.atlassian.crowd.directory.AbstractInternalDirectory.addUserToGroup(AbstractInternalDirectory.java:911) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUserToGroup(DbCachingRemoteChangeOperations.java:1314) ... 12 more {noformat} h3.Workaround Once the incremental synchronization fails, JIRA will fallback to the full synchronization, which will rename the user successfully.

    Atlassian JIRA | 1 year ago | Danilo Conrad
    com.atlassian.crowd.exception.OperationFailedException: com.atlassian.crowd.exception.MembershipAlreadyExistsException: Membership already exists in directory [10002] from child entity [jsmith] to parent entity [jira-users]

    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. com.atlassian.crowd.exception.MembershipAlreadyExistsException

      Membership already exists in directory [32770] from child entity [user] to parent entity [group]

      at com.atlassian.crowd.dao.membership.MembershipDAOHibernate.addUserToGroup()
    2. com.atlassian.crowd
      DbCachingRemoteChangeOperations.addUserToGroup
      1. com.atlassian.crowd.dao.membership.MembershipDAOHibernate.addUserToGroup(MembershipDAOHibernate.java:102)
      2. com.atlassian.crowd.directory.AbstractInternalDirectory.addUserToGroup(AbstractInternalDirectory.java:712)
      3. com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addUserToGroup(DbCachingRemoteChangeOperations.java:1151)
      3 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:601)
      4 frames
    4. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      3 frames
    5. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      1 frame
    6. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      2 frames
    7. com.atlassian.crowd
      DbCachingDirectoryPoller.pollChanges
      1. com.atlassian.crowd.directory.$Proxy159.addUserToGroup(Unknown Source)
      2. com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addUserToGroup(DirectoryCacheImplUsingChangeOperations.java:189)
      3. com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:119)
      4. com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:629)
      5. com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63)
      6. com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)
      6 frames