Problem
Sometimes when a user tries to log in to confluence the system gets stuck loading for a while. There seems to be a problem with synchronising users from the active directory.
Firstly it tries to perform an incremental synchronisation of the cache with the active directory, and try to add 100 users (who have seemingly been added recently):
2017-06-29 09:09:39,563 INFO [Caesium-1-2] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache INCREMENTAL synchronisation for directory [ 76480513 ] starting
...
2017-06-29 09:09:43,161 INFO [Caesium-1-2] [atlassian.crowd.directory.DbCachingRemoteChangeOperations] addUsers adding [ 100 ] users
Then it will throw a duplicate key error for a user (alias xxx.xxx)
2017-06-29 09:09:43,246 ERROR [Caesium-1-2] [engine.jdbc.spi.SqlExceptionHelper] logExceptions Violation of UNIQUE KEY constraint 'cwd_user_name_dir_id'. Cannot insert duplicate key in object 'dbo.cwd_user'. The duplicate key value is (xxx.xxx, 0513).
2017-06-29 09:09:43,248 WARN [Caesium-1-2] [persistence.hibernate.batch.AbstractBatchProcessor] processBatch batch failed falling back to individual processing
java.lang.RuntimeException: could not flush session
It can't seem to process users in a batch because of single user xxx.xxx? And so it tries to process indivduals - but confluence does not support individual processing.
2017-06-29 09:09:43,250 ERROR [Caesium-1-2] [persistence.hibernate.batch.AbstractBatchProcessor] processIndividual Could not process class com.atlassian.crowd.util.persistence.hibernate.batch.TransactionGroup: com.atlassian.crowd.util.persistence.hibernate.batch.TransactionGroup@7faa647e[primaryObject=com.atlassian.crowd.model.user.InternalUser@7c8e78d8[id=130457012,name=yyy.yyy,createdDate=Thu Jun 29 09:09:43 BST 2017,updatedDate=Thu Jun 29 09:09:43 BST
java.lang.RuntimeException: Confluence does not support individual processing
Then notifies that those users cannot be processed:
2017-06-29 09:09:43,314 ERROR [Caesium-1-2] [crowd.embedded.hibernate2.HibernateUserDao] addAll The following users could not be processed:
list of the users
Then confluence goes unresponsive for a few minutes (see time stamps) where confluence is essentially stuck in loading and then this is reported:
2017-06-29 09:12:55,713 WARN [http-nio-8443-exec-3] [confluence.util.profiling.DefaultActivityMonitor] close Exceeded the threshold of 60000 ms: ActivitySnapshot{startTime=1498723405374, threadId=226, threadName='http-nio-8443-exec-3', userId='alex.Perrin', type='web-request', summary='/'}
-- url: / | traceId: 8ff5ec5656cd6ef0 | userName: alex.Perrin
Then it seems to work fine for a while until it tries to do this again.
Any help/comments much appreciated!