-
Bug
-
Resolution: Fixed
-
High
-
2.9.4, 2.10.1
Crowd can generate duplicate rows Crowd for memberships. This causes exceptions when Stash tries to sync with crowd.
Stash has constraints in cwd_membership.
org.hibernate.NonUniqueResultException: query did not return a unique result: 2
at org.hibernate.internal.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:914) ~[hibernate-core-4.2.5.Final.jar:4.2.5.Final]
at org.hibernate.internal.CriteriaImpl.uniqueResult(CriteriaImpl.java:396) ~[hibernate-core-4.2.5.Final.jar:4.2.5.Final]
at com.atlassian.crowd.dao.membership.MembershipDAOHibernate.findInternalMembership(MembershipDAOHibernate.java:356) ~[crowd-persistence-hibernate4-2.7.1-rc.jar:na]
at com.atlassian.crowd.dao.membership.MembershipDAOHibernate.isUserDirectMember(MembershipDAOHibernate.java:211) ~[crowd-persistence-hibernate4-2.7.1-rc.jar:na]
...
Workaround
Remove and reconnect the affected Crowd directory. More details:
https://confluence.atlassian.com/display/STASHKB/Unable+to+sync+crowd+user+directory+-+query+did+not+return+a+unique+result
The fix for this issue inserted the uk_mem_dir_parent_child into a table on our database. After upgrading to versions above that fix, you should get the duplicate records removed from the database and all fixed.
If your database was in bad shape you could still have a few duplicate records that hadn't been deleted during the upgrade task. This will get your synchronisation failing with the following error:
2016-08-25 18:07:57,939 ERROR [Caesium-1-4] o.h.e.jdbc.spi.SqlExceptionHelper ERROR: duplicate key value violates unique constraint "uk_mem_dir_parent_child" 2016-08-25 18:07:57,963 ERROR [Caesium-1-4] c.a.c.d.DbCachingDirectoryPoller Error occurred while refreshing the cache for directory [ 2457601 ]. org.hibernate.exception.ConstraintViolationException: could not execute statement
If you're hitting that, please proceed with the following steps:
- Create a copy of your External Directory connection (i.e. LDAP, JIRA, etc) in Administration >> User Directories
- Delete the old one
- The issue won't return as the constraint will never allow Crowd's bug manifest again.
- is related to
-
BSERV-5244 Unique key constraints not working for Embedded Crowd table cwd_user
- Closed
- relates to
-
CONFSERVER-35047 Confluence user synchronisation create duplicated user account after user rename in the remote repository
- Closed
- is caused by
-
EMBCWD-994 Loading...
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...