com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Membership][id,2537859][membershipType,GROUP_GROUP][lowerParentName,development-group][parentId,96939][childId,89522][childName,johndoe][lowerChildName,johndoe][directoryId,10301][parentName,Development-Group] (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "uk_mem_parent_child_type"))

Atlassian JIRA | David Chan [Atlassian] | 5 years ago
  1. 0

    h3. Symptom When synchronising JIRA with LDAP, the synchronisation will fail when JIRA runs into a duplicate membership with the following in {{atlassian-jira.log}}: {code} 2012-02-29 06:24:30,407 QuartzWorker-0 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10301 ]. com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Membership][id,2537859][membershipType,GROUP_GROUP][lowerParentName,development-group][parentId,96939][childId,89522][childName,johndoe][lowerChildName,johndoe][directoryId,10301][parentName,Development-Group] (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "uk_mem_parent_child_type")) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167) at com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.createMembership(OfBizInternalMembershipDao.java:113) at com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.addGroupToGroup(OfBizInternalMembershipDao.java:120) at com.atlassian.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addGroupToGroup(OfBizDelegatingMembershipDao.java:87) at com.atlassian.crowd.directory.AbstractInternalDirectory.addGroupToGroup(AbstractInternalDirectory.java:689) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addGroupMembershipsForGroup(DbCachingRemoteChangeOperations.java:829) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncGroupMembersForGroup(DirectoryCacheImplUsingChangeOperations.java:142) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:159) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:44) at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAll(UsnChangedCacheRefresher.java:223) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:619) 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,2537859][membershipType,GROUP_GROUP][lowerParentName,development-group][parentId,96939][childId,89522][childName,johndoe][lowerChildName,johndoe][directoryId,10301][parentName,Development-Group] (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "uk_mem_parent_child_type")) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:133) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:98) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:64) 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:80) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:162) ... 16 more {code} h3. Cause This could be caused by casing changes in groups within the LDAP Directory - for example changing a group from {{space-marines}} to {{Space-Marines}}. This may be similar to CONF-22631. In that case, it was setup so that the synchronisation will complete even if Confluence ran into a duplicate membership. Instead of failing the sync, JIRA should log the duplicate and continue finishing the sync. h3. Workaround # Schedule a downtime window, as users will be unable to login during these changes. # Log in as an administrator within the JIRA Internal Directory. If one does not exist, create it. # Disable the problematic User Directory. # Create a new [User Directory|http://confluence.atlassian.com/display/JIRA/Configuring+User+Directories] within JIRA, using the same settings as the old one. # Test the synchronisation and ensure that synchronisation completes successfully. If so, use this new directory. (!) If you have a User Directory set up with the Read Only, with Local Groups [permission settings|https://confluence.atlassian.com/display/JIRA/Connecting+to+an+LDAP+Directory#ConnectingtoanLDAPDirectory-PermissionSettings] you will no longer have the local groups set up in the database when the user directory is disabled. The project roles will not be affected. If you are using Microsoft AD, you can try to use the [adsiedit.msc|http://technet.microsoft.com/en-us/library/cc773354(v=ws.10).aspx] to change the SAMAccountName attribute for the users to lowercase in the LDAP.

    Atlassian JIRA | 5 years ago | David Chan [Atlassian]
    com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Membership][id,2537859][membershipType,GROUP_GROUP][lowerParentName,development-group][parentId,96939][childId,89522][childName,johndoe][lowerChildName,johndoe][directoryId,10301][parentName,Development-Group] (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "uk_mem_parent_child_type"))
  2. 0

    h3. Symptom When synchronising JIRA with LDAP, the synchronisation will fail when JIRA runs into a duplicate membership with the following in {{atlassian-jira.log}}: {code} 2012-02-29 06:24:30,407 QuartzWorker-0 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10301 ]. com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Membership][id,2537859][membershipType,GROUP_GROUP][lowerParentName,development-group][parentId,96939][childId,89522][childName,johndoe][lowerChildName,johndoe][directoryId,10301][parentName,Development-Group] (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "uk_mem_parent_child_type")) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167) at com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.createMembership(OfBizInternalMembershipDao.java:113) at com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.addGroupToGroup(OfBizInternalMembershipDao.java:120) at com.atlassian.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addGroupToGroup(OfBizDelegatingMembershipDao.java:87) at com.atlassian.crowd.directory.AbstractInternalDirectory.addGroupToGroup(AbstractInternalDirectory.java:689) at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addGroupMembershipsForGroup(DbCachingRemoteChangeOperations.java:829) at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncGroupMembersForGroup(DirectoryCacheImplUsingChangeOperations.java:142) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:159) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:44) at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAll(UsnChangedCacheRefresher.java:223) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:619) 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,2537859][membershipType,GROUP_GROUP][lowerParentName,development-group][parentId,96939][childId,89522][childName,johndoe][lowerChildName,johndoe][directoryId,10301][parentName,Development-Group] (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "uk_mem_parent_child_type")) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:133) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:98) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:64) 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:80) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:162) ... 16 more {code} h3. Cause This could be caused by casing changes in groups within the LDAP Directory - for example changing a group from {{space-marines}} to {{Space-Marines}}. This may be similar to CONF-22631. In that case, it was setup so that the synchronisation will complete even if Confluence ran into a duplicate membership. Instead of failing the sync, JIRA should log the duplicate and continue finishing the sync. h3. Workaround # Schedule a downtime window, as users will be unable to login during these changes. # Log in as an administrator within the JIRA Internal Directory. If one does not exist, create it. # Disable the problematic User Directory. # Create a new [User Directory|http://confluence.atlassian.com/display/JIRA/Configuring+User+Directories] within JIRA, using the same settings as the old one. # Test the synchronisation and ensure that synchronisation completes successfully. If so, use this new directory. (!) If you have a User Directory set up with the Read Only, with Local Groups [permission settings|https://confluence.atlassian.com/display/JIRA/Connecting+to+an+LDAP+Directory#ConnectingtoanLDAPDirectory-PermissionSettings] you will no longer have the local groups set up in the database when the user directory is disabled. The project roles will not be affected. If you are using Microsoft AD, you can try to use the [adsiedit.msc|http://technet.microsoft.com/en-us/library/cc773354(v=ws.10).aspx] to change the SAMAccountName attribute for the users to lowercase in the LDAP.

    Atlassian JIRA | 5 years ago | David Chan [Atlassian]
    com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Membership][id,2537859][membershipType,GROUP_GROUP][lowerParentName,development-group][parentId,96939][childId,89522][childName,johndoe][lowerChildName,johndoe][directoryId,10301][parentName,Development-Group] (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "uk_mem_parent_child_type"))
  3. 0

    Steps to recreate: * In Active Directory, create a group with a description > 255 characters * Set a user directory in JIRA against said Active Directory * Synchronise For any group with a large description, something like the following will be spit out in the log: {code} com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Group][id,13837][groupName,GroupWithLongDescription][updatedDate,2011-07-08 17:23:33.25][description,PSLSF11\DEPTS\TRNG\2 OPERATIONS TRAINING\APPROVED MATERIAL [R]; \\PSLSF11\DEPTS\TRNG\3 MAINT TRAINING\APPROVED MATERIAL [R]; PSLSF11\DEPTS\TRNG\4 TECH TRAINING\APPROVED MATERIAL [R]; PSLSF11\DEPTS\TRNG\5 CONFIG_ASSESSMENT\APPROVED MATERIALS [R]; PSLSF11\DEPTS\TRNG\7 GENERAL EMPLOYEE TRAINING\APPROVED MATERIAL [R]; PSLSF11\DEPTS\TRNG\11 NUC DIV TRNG [R]; PSLSF11\DEPTS\TRNG\12 LMS\APPROVED MATERIAL [R]][directoryId,10000][lowerDescription,pslsf11\depts\trng\2 operations training\approved material [r]; \\pslsf11\depts\trng\3 maint training\approved material [r]; pslsf11\depts\trng\4 tech training\approved material [r]; pslsf11\depts\trng\5 config_assessment\approved materials [r]; pslsf11\depts\trng\7 general employee training\approved material [r]; pslsf11\depts\trng\11 nuc div trng [r]; pslsf11\depts\trng\12 lms\approved material [r]][active,1][local,0][type,GROUP][lowerGroupName,GroupWithLongDescription][createdDate,2011-07-08 17:23:33.25] (SQL Exception while executing the following:INSERT INTO jiraschema.cwd_group (ID, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Data truncation)) at com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:167) at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.add(OfBizGroupDao.java:158) at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.add(OfBizGroupDao.java:144) at com.atlassian.crowd.embedded.ofbiz.OfBizGroupDao.addAll(OfBizGroupDao.java:136) at com.atlassian.crowd.directory.CachingDirectory.addAllGroups(CachingDirectory.java:109) at com.atlassian.crowd.directory.DbCachingRemoteDirectoryCache.addOrUpdateCachedGroups(DbCachingRemoteDirectoryCache.java:445) at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAllGroups(UsnChangedCacheRefresher.java:273) at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:35) at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAll(UsnChangedCacheRefresher.java:209) 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:Group][id,13837][groupName,GroupWithLongDescription][updatedDate,2011-07-08 17:23:33.25][description,PSLSF11\DEPTS\TRNG\2 OPERATIONS TRAINING\APPROVED MATERIAL [R]; \\PSLSF11\DEPTS\TRNG\3 MAINT TRAINING\APPROVED MATERIAL [R]; PSLSF11\DEPTS\TRNG\4 TECH TRAINING\APPROVED MATERIAL [R]; PSLSF11\DEPTS\TRNG\5 CONFIG_ASSESSMENT\APPROVED MATERIALS [R]; PSLSF11\DEPTS\TRNG\7 GENERAL EMPLOYEE TRAINING\APPROVED MATERIAL [R]; PSLSF11\DEPTS\TRNG\11 NUC DIV TRNG [R]; PSLSF11\DEPTS\TRNG\12 LMS\APPROVED MATERIAL [R]][directoryId,10000][lowerDescription,pslsf11\depts\trng\2 operations training\approved material [r]; \\pslsf11\depts\trng\3 maint training\approved material [r]; pslsf11\depts\trng\4 tech training\approved material [r]; pslsf11\depts\trng\5 config_assessment\approved materials [r]; pslsf11\depts\trng\7 general employee training\approved material [r]; pslsf11\depts\trng\11 nuc div trng [r]; pslsf11\depts\trng\12 lms\approved material [r]][active,1][local,0][type,GROUP][lowerGroupName,GroupWithLongDescription][createdDate,2011-07-08 17:23:33.25] (SQL Exception while executing the following:INSERT INTO jiraschema.cwd_group (ID, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Data truncation)) 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) ... 16 more {code} Can I recommend one of the following? * Change DDL to make fields {{cwd_group.description}} and {{cwd_group.lower_description}} of type {{varchar(MAX)}}? * Change DB access code to auto-snip any descriptions > 255 characters? My workaround was modifying the DB schema like the first option. Of course, this is going to cause an issue on the next upgrade if I have to start with another empty JIRA database.

    Atlassian JIRA | 5 years ago | Chris Simmons
    com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Group][id,13837][groupName,GroupWithLongDescription][updatedDate,2011-07-08 17:23:33.25][description,PSLSF11\DEPTS\TRNG\2 OPERATIONS TRAINING\APPROVED MATERIAL [R]; \\PSLSF11\DEPTS\TRNG\3 MAINT TRAINING\APPROVED MATERIAL [R]; PSLSF11\DEPTS\TRNG\4 TECH TRAINING\APPROVED MATERIAL [R]; PSLSF11\DEPTS\TRNG\5 CONFIG_ASSESSMENT\APPROVED MATERIALS [R]; PSLSF11\DEPTS\TRNG\7 GENERAL EMPLOYEE TRAINING\APPROVED MATERIAL [R]; PSLSF11\DEPTS\TRNG\11 NUC DIV TRNG [R]; PSLSF11\DEPTS\TRNG\12 LMS\APPROVED MATERIAL [R]][directoryId,10000][lowerDescription,pslsf11\depts\trng\2 operations training\approved material [r]; \\pslsf11\depts\trng\3 maint training\approved material [r]; pslsf11\depts\trng\4 tech training\approved material [r]; pslsf11\depts\trng\5 config_assessment\approved materials [r]; pslsf11\depts\trng\7 general employee training\approved material [r]; pslsf11\depts\trng\11 nuc div trng [r]; pslsf11\depts\trng\12 lms\approved material [r]][active,1][local,0][type,GROUP][lowerGroupName,GroupWithLongDescription][createdDate,2011-07-08 17:23:33.25] (SQL Exception while executing the following:INSERT INTO jiraschema.cwd_group (ID, group_name, lower_group_name, active, local, created_date, updated_date, description, lower_description, group_type, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Data truncation))
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    We are running Crowd for user management, and before we integrated with our organizations larger Active Directories it was working fine. As soon as we integrated with a single large directory the following error began faulting and it is rendering Crowd useless. No user group updates are being recognized, new users have to be created in each application in order to be granted access, etc. The error below is thrown and causes the entire synchronize to be aborted. I am experiencing the exact behavior when doing a synchronize in Confluence as well (see my comments at https://jira.atlassian.com/browse/CONF-22631?focusedCommentId=264657#comment-264657): 2011-08-22 08:06:18,646 QuartzWorker-0 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10300 ]. com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Membership][id,223267][membershipType,GROUP_USER][lowerParentName,#abc dl-video ad escalation][parentId,50839][childId,36518][childName,karreece][lowerChildName,karreece][directoryId,10300][parentName,#ABC DL-Video Ad Escalation] (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 '50839-36518-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,223267][membershipType,GROUP_USER][lowerParentName,#abc dl-video ad escalation][parentId,50839][childId,36518][childName,karreece][lowerChildName,karreece][directoryId,10300][parentName,#ABC DL-Video Ad Escalation] (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 '50839-36518-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

    Atlassian JIRA | 5 years ago | Sheppe Pharis
    com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Membership][id,223267][membershipType,GROUP_USER][lowerParentName,#abc dl-video ad escalation][parentId,50839][childId,36518][childName,karreece][lowerChildName,karreece][directoryId,10300][parentName,#ABC DL-Video Ad Escalation] (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 '50839-36518-GROUP_USER' for key 2))
  6. 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]
    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))

    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. org.ofbiz.core.entity.GenericEntityException

      while inserting: [GenericEntity:Membership][id,2537859][membershipType,GROUP_GROUP][lowerParentName,development-group][parentId,96939][childId,89522][childName,johndoe][lowerChildName,johndoe][directoryId,10301][parentName,Development-Group] (SQL Exception while executing the following:INSERT INTO public.cwd_membership (ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "uk_mem_parent_child_type"))

      at org.ofbiz.core.entity.GenericDAO.singleInsert()
    2. org.ofbiz.core
      GenericValue.create
      1. org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:133)
      2. org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:98)
      3. org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:64)
      4. org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:489)
      5. org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:469)
      6. org.ofbiz.core.entity.GenericValue.create(GenericValue.java:80)
      6 frames
    3. com.atlassian.crowd
      DirectoryPollerJob.execute
      1. com.atlassian.crowd.embedded.ofbiz.db.OfBizHelper.createValue(OfBizHelper.java:162)
      2. com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.createMembership(OfBizInternalMembershipDao.java:113)
      3. com.atlassian.crowd.embedded.ofbiz.OfBizInternalMembershipDao.addGroupToGroup(OfBizInternalMembershipDao.java:120)
      4. com.atlassian.crowd.embedded.ofbiz.OfBizDelegatingMembershipDao.addGroupToGroup(OfBizDelegatingMembershipDao.java:87)
      5. com.atlassian.crowd.directory.AbstractInternalDirectory.addGroupToGroup(AbstractInternalDirectory.java:689)
      6. com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.addGroupMembershipsForGroup(DbCachingRemoteChangeOperations.java:829)
      7. com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.syncGroupMembersForGroup(DirectoryCacheImplUsingChangeOperations.java:142)
      8. com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseMemberships(AbstractCacheRefresher.java:159)
      9. com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:44)
      10. com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAll(UsnChangedCacheRefresher.java:223)
      11. com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:619)
      12. com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63)
      13. com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)
      14. com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJob.execute(DirectoryPollerJob.java:34)
      14 frames
    4. quartz
      JobRunShell.run
      1. org.quartz.core.JobRunShell.run(JobRunShell.java:195)
      1 frame
    5. com.atlassian.multitenant
      MultiTenantThreadPool$MultiTenantRunnable.run
      1. com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72)
      1 frame
    6. quartz
      SimpleThreadPool$WorkerThread.run
      1. org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
      1 frame