Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-3917

Application syncs from Crowd fail due to "com.atlassian.crowd.model.event.AliasEvent" incorrectly invoked

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Low Low
    • 2.6.2
    • None
    • None
    • None

      Problem Summary

      Crowd-integrated applications (e.g. Confluence, JIRA, Stash) can suddenly fail to sync from the Crowd server. This happens seemingly out of the blue without changes to the application.

      Stacktrace shown on the client application side in logs:

      2014-04-29 11:18:38,252 ERROR [scheduler_Worker-5] [atlassian.crowd.directory.DbCachingDirectoryPoller] pollChanges Error occurred while refreshing the cache for directory [ 38076417 ].
      com.atlassian.crowd.exception.OperationFailedException: Internal error from Crowd server: class com.atlassian.crowd.model.event.AliasEvent is not supported
      	at com.atlassian.crowd.integration.rest.service.RestCrowdClient.handleCommonExceptions(RestCrowdClient.java:1308)
      	at com.atlassian.crowd.integration.rest.service.RestCrowdClient.getNewEvents(RestCrowdClient.java:1082)
      	at com.atlassian.crowd.directory.RemoteCrowdDirectory.getNewEvents(RemoteCrowdDirectory.java:682)
      	at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:73)
      	at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:612)
      	at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:63)
      	at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)
      	at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJobBean.executeInternal(DirectoryPollerJobBean.java:29)
      	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
      	at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:20)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) 
      

      "com.atlassian.crowd.model.event.AliasEvent" should be invoked when a user's alias has been updated/created/removed. However in cases where this has been observed, the integrated application in question does not have aliasing enabled in Crowd. In some cases, there may be an unrelated application (e.g. Google Apps) where aliasing is enabled. Not sure if this is a red herring.

      Workaround

      1. In Crowd, re-set the integrated application's name and password.
      2. In the integrated application's user directory configurations, update the application credentials as appropriate

      This should allow the sync to succeed once more.

            [CWD-3917] Application syncs from Crowd fail due to "com.atlassian.crowd.model.event.AliasEvent" incorrectly invoked

            I just got this error with Bitbucket and this version of Crowd: [ Crowd|https://www.atlassian.com/software/crowd/] Version: 2.8.4 (Build:#649 - 2016-02-10)

             

            Owen Manske added a comment - I just got this error with Bitbucket and this version of Crowd: [ Crowd|https://www.atlassian.com/software/crowd/] Version: 2.8.4 (Build:#649 - 2016-02-10)  

            I see it with Confluence and Crowd 2.8.2

            2016-05-09 11:00:01,502 INFO [scheduler_Worker-3] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache INCREMENTAL synchronisation for directory [ 98306 ] starting
            2016-05-09 11:00:01,503 INFO [scheduler_Worker-3] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache Attempting INCREMENTAL synchronisation for directory [ 98306 ]
            2016-05-09 11:00:01,592 INFO [scheduler_Worker-3] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache failed synchronisation complete for directory [ 98306 ] in [ 90ms ]
            2016-05-09 11:00:01,603 ERROR [scheduler_Worker-3] [atlassian.crowd.directory.DbCachingDirectoryPoller] pollChanges Error occurred while refreshing the cache for directory [ 98306 ].
            com.atlassian.crowd.exception.OperationFailedException: Error from Crowd server propagated to here via REST API (check the Crowd server logs for details): class com.atlassian.crowd.model.event.AliasEvent is not supported
            at com.atlassian.crowd.integration.rest.service.RestCrowdClient.handleCommonExceptions(RestCrowdClient.java:1507)
            at com.atlassian.crowd.integration.rest.service.RestCrowdClient.getNewEvents(RestCrowdClient.java:1191)
            at com.atlassian.crowd.directory.RemoteCrowdDirectory.getNewEvents(RemoteCrowdDirectory.java:813)
            at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:112)
            at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:1097)
            at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:76)
            at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50)
            at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJobRunner.runJob(DirectoryPollerJobRunner.java:93)
            at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:135)
            at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:101)
            at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:80)
            at com.atlassian.scheduler.quartz1.Quartz1Job.execute(Quartz1Job.java:32)
            at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
            at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool.lambda$runInThread$151(ConfluenceQuartzThreadPool.java:19)
            at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$$Lambda$93/1474565418.run(Unknown Source)
            at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
            Caused by: com.atlassian.crowd.integration.rest.service.CrowdRestException: class com.atlassian.crowd.model.event.AliasEvent is not supported
            at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.throwError(RestExecutor.java:656)
            at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.andReceive(RestExecutor.java:485)
            at com.atlassian.crowd.integration.rest.service.RestCrowdClient.getNewEvents(RestCrowdClient.java:1179)
            ... 14 more

            Martin Cleaver added a comment - I see it with Confluence and Crowd 2.8.2 2016-05-09 11:00:01,502 INFO [scheduler_Worker-3] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache INCREMENTAL synchronisation for directory [ 98306 ] starting 2016-05-09 11:00:01,503 INFO [scheduler_Worker-3] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache Attempting INCREMENTAL synchronisation for directory [ 98306 ] 2016-05-09 11:00:01,592 INFO [scheduler_Worker-3] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache failed synchronisation complete for directory [ 98306 ] in [ 90ms ] 2016-05-09 11:00:01,603 ERROR [scheduler_Worker-3] [atlassian.crowd.directory.DbCachingDirectoryPoller] pollChanges Error occurred while refreshing the cache for directory [ 98306 ]. com.atlassian.crowd.exception.OperationFailedException: Error from Crowd server propagated to here via REST API (check the Crowd server logs for details): class com.atlassian.crowd.model.event.AliasEvent is not supported at com.atlassian.crowd.integration.rest.service.RestCrowdClient.handleCommonExceptions(RestCrowdClient.java:1507) at com.atlassian.crowd.integration.rest.service.RestCrowdClient.getNewEvents(RestCrowdClient.java:1191) at com.atlassian.crowd.directory.RemoteCrowdDirectory.getNewEvents(RemoteCrowdDirectory.java:813) at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseChanges(EventTokenChangedCacheRefresher.java:112) at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:1097) at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:76) at com.atlassian.crowd.directory.DbCachingDirectoryPoller.pollChanges(DbCachingDirectoryPoller.java:50) at com.atlassian.crowd.manager.directory.monitor.poller.DirectoryPollerJobRunner.runJob(DirectoryPollerJobRunner.java:93) at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:135) at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:101) at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:80) at com.atlassian.scheduler.quartz1.Quartz1Job.execute(Quartz1Job.java:32) at org.quartz.core.JobRunShell.run(JobRunShell.java:223) at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool.lambda$runInThread$151(ConfluenceQuartzThreadPool.java:19) at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$$Lambda$93/1474565418.run(Unknown Source) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) Caused by: com.atlassian.crowd.integration.rest.service.CrowdRestException: class com.atlassian.crowd.model.event.AliasEvent is not supported at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.throwError(RestExecutor.java:656) at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.andReceive(RestExecutor.java:485) at com.atlassian.crowd.integration.rest.service.RestCrowdClient.getNewEvents(RestCrowdClient.java:1179) ... 14 more

            We receive the error in Stash 4.3.1 and Crowd 2.8.1 - is this a new bug ore the same again?

            Communardo Switzerland AG added a comment - We receive the error in Stash 4.3.1 and Crowd 2.8.1 - is this a new bug ore the same again?

            Products using embedded Crowd >= 2.6.2 are not affected by this bug.

            Products using a version of embedded Crowd containing the fix for CWD-3188 may be affected, but the incremental synchronisation fallbacks to full sync and eventually succeeds without any user action.

            Diego Berrueta added a comment - Products using embedded Crowd >= 2.6.2 are not affected by this bug. Products using a version of embedded Crowd containing the fix for CWD-3188 may be affected, but the incremental synchronisation fallbacks to full sync and eventually succeeds without any user action.

            AliasEvents were introduced in Crowd 2.6.2 (CWD-3215) and they're are not associated to any particular directory. When any alias-related operation occurs in the Crowd server, all applications that are using incremental Crowd-to-Crowd sync (also called "event-based sync") are notified about the event, even if the event is not actually relevant to them, e.g., because they are not alias-enabled.

            Unfortunately, products using embedded Crowd < 2.6.2 do not know how to handle the AliasEvents when they receive them. This causes the stacktrace in the issue report. If the version of embedded Crowd in the product does not contain the fix for CWD-3188 (for instance, Confluence 5.1, which uses embedded Crowd 2.6.1), then unhanded event will cause the incremental sync to fail without falling back to full sync. Subsequent attempts to resynchronise will fail for the same reason because the AliasEvent has not been consumed yet.

            The proposed workaround is effective because it forces the product to do a full sync. Once the full sync has completed, the subsequent synchronisations will be incremental and will succeed until a new AliasEvent occurs in the server.

            CWD-3188 addresses this exact issue: it does not cause the stacktrace to disappear if the version of embedded Crowd is < 2.6.2, but it causes an automated fallback to a full sync which will not only allow the sync to succeed, but it will also consume the AliasEvent and make it possible for subsequent incremental syncs to succeed without any user action or workaround.

            Therefore, the fix for this issue is to use versions of the products that include either embedded Crowd >= 2.6.2, or a version of embedded Crowd that contains the fix for CWD-3188, e.g., 2.5.4. For instance, upgrading from Confluence 5.1 to Confluence 5.2 will fix the problem.

            Diego Berrueta added a comment - AliasEvents were introduced in Crowd 2.6.2 ( CWD-3215 ) and they're are not associated to any particular directory. When any alias-related operation occurs in the Crowd server, all applications that are using incremental Crowd-to-Crowd sync (also called "event-based sync") are notified about the event, even if the event is not actually relevant to them, e.g., because they are not alias-enabled. Unfortunately, products using embedded Crowd < 2.6.2 do not know how to handle the AliasEvents when they receive them. This causes the stacktrace in the issue report. If the version of embedded Crowd in the product does not contain the fix for CWD-3188 (for instance, Confluence 5.1, which uses embedded Crowd 2.6.1), then unhanded event will cause the incremental sync to fail without falling back to full sync. Subsequent attempts to resynchronise will fail for the same reason because the AliasEvent has not been consumed yet. The proposed workaround is effective because it forces the product to do a full sync. Once the full sync has completed, the subsequent synchronisations will be incremental and will succeed until a new AliasEvent occurs in the server. CWD-3188 addresses this exact issue: it does not cause the stacktrace to disappear if the version of embedded Crowd is < 2.6.2, but it causes an automated fallback to a full sync which will not only allow the sync to succeed, but it will also consume the AliasEvent and make it possible for subsequent incremental syncs to succeed without any user action or workaround. Therefore, the fix for this issue is to use versions of the products that include either embedded Crowd >= 2.6.2, or a version of embedded Crowd that contains the fix for CWD-3188 , e.g., 2.5.4. For instance, upgrading from Confluence 5.1 to Confluence 5.2 will fix the problem.

              Unassigned Unassigned
              rchang Robert Chang
              Affected customers:
              1 This affects my team
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: