Constraint Violation When a User Tries to Login

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

The following appears in the atlassian-confluence.log:

caused by: org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.crowd.embedded.hibernate2.HibernateMembership#188383471]; SQL []; ORA-00001: unique constraint (CONFLUENCE.CWD_UNIQUE_MEMBERSHIP) violated
; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (CONFLUENCE.CWD_UNIQUE_MEMBERSHIP) violated

at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:110)
caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (CONFLUENCE.CWD_UNIQUE_MEMBERSHIP) violated

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)

2012-12-18 15:07:49,153 INFO [TP-Processor14] [atlassian.crowd.directory.DelegatedAuthenticationDirectory] updateGroups Deleted user "user1"'s imported membership of remote group "group1" to directory "Delegated Authentication Directory".
2012-12-18 15:07:49,158 INFO [TP-Processor14] [atlassian.crowd.directory.DelegatedAuthenticationDirectory] importMembership Imported user "user1"'s membership of remote group "group1" to directory "Delegated Authentication Directory".
2012-12-18 15:07:49,162 ERROR [TP-Processor14] [sf.hibernate.util.JDBCExceptionReporter] logExceptions ORA-00001: unique constraint (CONFLUENCE.CWD_UNIQUE_MEMBERSHIP) violated

Diagnosis

If the group names set in LDAP are Uppercase and how they are shown in logs. In this example we see that GROUP1 is set like group1 in Crowd.

2012-12-18 15:07:49,158 INFO [TP-Processor14] [atlassian.crowd.directory.DelegatedAuthenticationDirectory] importMembership Imported user "user1"'s membership of remote group "group1" to directory "Delegated Authentication Directory".

Cause

The group is set as lowercase in Crowd when actually the original group in LDAP is uppercase.

Workaround

  1. Compare the groups in Crowd with the groups in LDAP to find out which are different (lowercase instead of uppercase).
  2. Remove the users from all these groups.
  3. Use GUI or SQL to remove the lowercase groups from the DB.
  4. Perform a Flush - Administration->Cache Statistics->Flush All
  5. Restart Confluence.
  6. Try to login with using a user that was inside on of the former group.

Last modified on Mar 30, 2016

Was this helpful?

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