Atlassian Crowd sync is failing
Asked by Hugo Pires:

Hi,

The user sync in confluence is failing and I can't create new users in confluence.

Can anyone provide a hint on how to solve the problem?


Answers:
author: AnnWorley
body: To get started troubleshooting, please check your atlassian-confluence.log for the failed synchronization. There should be a descriptive error message there. If it isn't obvious what the error means, please post it here so I can help research it.

The log is located at \<confluence_home\>/logs/atlassian-confluence.log. Note: The \<confluence_home\> directory is the path defined in the following file: \<confluence_install\>/confluence/WEB-INF/classes/confluence-init.properties.

Here is some more information on how user management works in Confluence when synchronizing with Crowd: [Connecting to Crowd or JIRA for User Management](https://confluence.atlassian.com/doc/connecting-to-crowd-or-jira-for-user-management-229838465.html)

comments: author: Hugo Pires
body: Here it is:

2017-08-21 13:19:36,032 INFO \[http-nio-2087-exec-12\] \[embedded.admin.list.DirectoriesController\] sync User directory synchronisation requested: \[ Remote JIRA Directory \], type: \[ CROWD \]  
2017-08-21 13:19:36,057 INFO \[Caesium-1-1\] \[atlassian.crowd.directory.DbCachingRemoteDirectory\] synchroniseCache FULL synchronisation for directory \[ 98305 \] starting  
2017-08-21 13:19:36,222 INFO \[Caesium-1-1\] \[atlassian.crowd.directory.DbCachingRemoteDirectory\] synchroniseCache failed synchronisation complete for directory \[ 98305 \] in \[ 165ms \]  
2017-08-21 13:19:36,226 ERROR \[Caesium-1-1\] \[atlassian.crowd.directory.DbCachingDirectoryPoller\] pollChanges Error occurred while refreshing the cache for directory \[ 98305 \].  
com.atlassian.crowd.exception.OperationFailedException: com.atlassian.crowd.exception.ApplicationPermissionException: ?\^H\^@\^@\^@\^@\^@\^@\^@?UYo?0\^P\~?W?tWZ?+?\>????tU?\^G\^BU?\^@\^H ?$55v??p???? \^Pzo\^?????73???\>?\[?P??\^WAt\^ZM???t ;g??\^P??_\~\~??uT???"??????:\^X?\^V2?0?i?(?2uM?I? 8\\??9,??\^F?%?fdtn?m???Gsi??uT?? :???????$  
at com.atlassian.crowd.directory.RemoteCrowdDirectory.searchUsers(RemoteCrowdDirectory.java:410)  
at com.atlassian.crowd.directory.ldap.cache.RemoteDirectoryCacheRefresher.findAllRemoteUsers(RemoteDirectoryCacheRefresher.java:55)  
at com.atlassian.crowd.directory.ldap.cache.RemoteDirectoryCacheRefresher.synchroniseAllUsers(RemoteDirectoryCacheRefresher.java:83)  
at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:56)  
at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseAll(EventTokenChangedCacheRefresher.java:69)  
at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:1186)  
at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:74)  
at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)  
at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJobRunner.runJob(DirectoryPollerJobRunner.java:96)  
at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.doRunJob(JobRunnerWrapper.java:114)  
at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.lambda$runJob$0(JobRunnerWrapper.java:90)  
at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:87)  
at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:71)  
at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.runJob(JobRunnerWrapper.java:90)  
at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:153)  
at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:118)  
at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:97)  
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(CaesiumSchedulerService.java:443)  
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeLocalJob(CaesiumSchedulerService.java:410)  
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(CaesiumSchedulerService.java:388)  
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService$1.consume(CaesiumSchedulerService.java:285)  
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService$1.consume(CaesiumSchedulerService.java:282)  
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(SchedulerQueueWorker.java:65)  
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(SchedulerQueueWorker.java:59)  
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.run(SchedulerQueueWorker.java:34)  
at java.lang.Thread.run(Thread.java:745)  
Caused by: com.atlassian.crowd.exception.ApplicationPermissionException: ?\^H\^@\^@\^@\^@\^@\^@\^@?UYo?0\^P\~?W?tWZ?+?\>????tU?\^G\^BU?\^@\^H ?$55v??p???? \^Pzo\^?????73???\>?\[?P??\^WAt\^ZM???t ;g??\^P??_\~\~??uT???"??????:\^X?\^V2?0?i?(?2uM?I? 8\\??9,??\^F?%?fdtn?m???Gsi??uT?? :???????e?\~}\|\|x:??\|??\^T,???{?w?Bk??7?JW??x\^E8 "???\^T\^$  
at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.throwError(RestExecutor.java:614)  
at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.andReceive(RestExecutor.java:417)  
at com.atlassian.crowd.integration.rest.service.RestCrowdClient.searchUsers(RestCrowdClient.java:624)  
at com.atlassian.crowd.directory.RemoteCrowdDirectory.searchUsers(RemoteCrowdDirectory.java:400)  
... 25 more


author: AnnWorley
body: From the log, it looks like you are using JIRA to manage your Confluence users. It also seems like the application does not have permission to sync from JIRA:

```
Caused by: com.atlassian.crowd.exception.ApplicationPermissionException
```

Please go to the JIRA User Server on your JIRA instance and make sure the application name and password there match what you are using in Confluence. Also, please check that the IP address of the Confluence server is in the configuration.

There are details for JIRA User Server on this page: [Connecting Confluence to JIRA applications for User Management](https://confluence.atlassian.com/doc/connecting-to-crowd-or-jira-for-user-management-229838465.html#ConnectingtoCrowdorJIRAforUserManagement-ConnectingConfluencetoJIRAapplicationsforUserManagement)


Tags: crowd