Violation of UNIQUE KEY constraint 'cwd_unique_membership'

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Some LDAP users can't access Confluence. The errors on the logs indicate a Constrain Violation and a duplicate value. Checking the cwd_membership shows that the values are not duplicated.

 

The following appears in the atlassian-confluence.log:

org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.crowd.embedded.hibernate2.HibernateMembership#6456133]; SQL []; Violation of UNIQUE KEY constraint 'cwd_unique_membership'. 
Cannot insert duplicate key in object 'dbo.cwd_membership'. The duplicate key value is (310715, <NULL>, 6462549).; nested exception is java.sql.SQLException: Violation of UNIQUE KEY constraint 'cwd_unique_membership'. Cannot insert duplicate key in object 'dbo.cwd_membership'. The duplicate key value is (310715, <NULL>, 6462549).
caused by: org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.crowd.embedded.hibernate2.HibernateMembership#6456132]; SQL []; Violation of PRIMARY KEY constraint 'PK__cwd_memb__3213E83FC6CE8E53'. Cannot insert duplicate key in object 'dbo.cwd_membership'. The duplicate key value is (6462549).; nested exception is java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__cwd_memb__3213E83FC6CE8E53'. Cannot insert duplicate key in object 'dbo.cwd_membership'. The duplicate key value is (6462549).
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100)
caused by: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__cwd_memb__3213E83FC6CE8E53'. Cannot insert duplicate key in object 'dbo.cwd_membership'. The duplicate key value is (6462549).
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)

Diagnosis

Recreating the Directory do not help. It might be a bug on version 5.1 that we could not identify already.

 

Workaround

Upgrade Confluence to 5.3.

 

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.