Synchronization with LDAP fails Only deleted users can be archived

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.

Problem

Synchronization between Bitbucket Sever and an external LDAP fails.

The following appears in the atlassian-bitbucket.log

2016-05-04 10:28:23,990 ERROR [clusterScheduler_Worker-10]  c.a.c.d.DbCachingDirectoryPoller Error occurred while refreshing the cache for directory [ 111111 ].
java.lang.IllegalArgumentException: Only deleted users can be archived
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) ~[guava-18.0.jar:na]
        at com.atlassian.stash.internal.user.HibernateStashUserDao.archive(HibernateStashUserDao.java:66) ~[bitbucket-dao-impl-4.5.2.jar:na]
        at com.atlassian.stash.internal.crowd.HibernateUserDao.archiveIfNeeded(HibernateUserDao.java:297) ~[bitbucket-dao-impl-4.5.2.jar:na]
        at com.atlassian.stash.internal.crowd.HibernateUserDao.rename(HibernateUserDao.java:189) ~[bitbucket-dao-impl-4.5.2.jar:na]
        at com.atlassian.stash.internal.crowd.HibernateUserDao.rename(HibernateUserDao.java:63) ~[bitbucket-dao-impl-4.5.2.jar:na]
        at com.atlassian.crowd.directory.AbstractInternalDirectory.forceRenameUser(AbstractInternalDirectory.java:656) ~[crowd-persistence-2.8.4-m2.jar:na]
        at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.updateUsers(DbCachingRemoteChangeOperations.java:241) ~[crowd-core-2.8.4-m2.jar:na]
        at com.atlassian.crowd.directory.$Proxy1471.updateUsers(Unknown Source) ~[na:na]
        at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.addOrUpdateCachedUsers(DirectoryCacheImplUsingChangeOperations.java:62) ~[crowd-core-2.8.4-m2.jar:na]
        at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAllUsers(UsnChangedCacheRefresher.java:195) ~[crowd-ldap-2.8.4-m2.jar:na]
        at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:89) ~[crowd-ldap-2.8.4-m2.jar:na]
        at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAll(UsnChangedCacheRefresher.java:168) ~[crowd-ldap-2.8.4-m2.jar:na]
        at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:1122) ~[crowd-core-2.8.4-m2.jar:na]
        at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:76) ~[crowd-core-2.8.4-m2.jar:na]
        at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50) ~[crowd-core-2.8.4-m2.jar:na]
        at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJobRunner.runJob(DirectoryPollerJobRunner.java:93) [crowd-core-2.8.4-m2.jar:na]
        at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:153) [atlassian-scheduler-core-1.7.0.jar:na]
        at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:118) [atlassian-scheduler-core-1.7.0.jar:na]
        at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:97) [atlassian-scheduler-core-1.7.0.jar:na]
        at com.atlassian.scheduler.quartz2.Quartz2Job.execute(Quartz2Job.java:32) [atlassian-scheduler-quartz2-1.7.0.jar:na]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.2.2.jar:na]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.2.jar:na]
        ... 60 frames trimmed


Workaround

  1. Disable the external user directory from within Bitbucket Server
  2. Add a new user directory to Bitbucket Server with the same settings the one that has failed the sync but with a different name
  3. Test the sync between the newly added user directory and Bitbucket Server
  4. If the sync is successful, disable the user directory and test the previous directory

The issue should be resolved. If the initial directory still does not sync and new directory does, use the new directory and remove the old one.

Last modified on Sep 15, 2016

Was this helpful?

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