Can't Synchronize User Directory due to duplicate membership entry

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Syncing the user directory fails and the following appears in the atlassian-confluence.log:

2013-07-11 11:54:09,052 ERROR [scheduler_Worker-7] [atlassian.crowd.directory.DbCachingDirectoryPoller] pollChanges Error occurred while refreshing the cache for directory [ 9601026 ].
org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.crowd.embedded.hibernate2.HibernateMembership#13533267]; SQL []; Duplicate entry '9666569-12910594' for key 'cwd_unique_user_membership'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '9666569-12910594' for key 'cwd_unique_user_membership'
	at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
	at org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619)
	at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605)
	at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518)

Workaround

To clear this problem, create a Directory with the same information of your current Directory and then disable the old one, and synchronize the new one. The error should go away.

Last modified on Mar 30, 2016

Was this helpful?

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