NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Steps to replicate

      1. Add an Active Directory as Confluence User Directory
      2. Enable Incremental Synchronisation
      3. Wait for Incremental Synchronisation to fail

      Observed behaviour
      Error shown in the log:

      2015-02-26 10:54:24,942 ERROR [scheduler_Worker-8] [atlassian.crowd.directory.DbCachingRemoteDirectory] synchroniseCache Incremental synchronisation for directory [ 294914 ] was unexpectedly interrupted, falling back to a full synchronisation
      org.springframework.orm.hibernate.HibernateQueryException: could not resolve property: directory.externalId of: com.atlassian.crowd.model.user.InternalUser; nested exception is net.sf.hibernate.QueryException: could not resolve property: directory.externalId of: com.atlassian.crowd.model.user.InternalUser
      	at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:581)
      	at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353)
      	at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375)
      	at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337)
      	at com.atlassian.crowd.embedded.hibernate2.HibernateUserDao.internalFindAllUsersWithExternalId(HibernateUserDao.java:590)
      	at com.atlassian.crowd.embedded.hibernate2.HibernateUserDao.getAllExternalIds(HibernateUserDao.java:538)
      	at com.atlassian.confluence.user.crowd.CachedCrowdUserDao.getAllExternalIds(CachedCrowdUserDao.java:392)
      	at sun.reflect.GeneratedMethodAccessor1568.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at com.sun.proxy.$Proxy42.getAllExternalIds(Unknown Source)
      	at com.atlassian.crowd.directory.AbstractInternalDirectory.getAllUserExternalIds(AbstractInternalDirectory.java:671)
      	at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.getAllUserGuids(DbCachingRemoteChangeOperations.java:1513)
      	at sun.reflect.GeneratedMethodAccessor1567.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at com.atlassian.crowd.directory.$Proxy2662.getAllUserGuids(Unknown Source)
      	at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.getAllUserGuids(DirectoryCacheImplUsingChangeOperations.java:220)
      	at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.validateAndReturnGuidsToAddAndDelete(UsnChangedCacheRefresher.java:277)
      	at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseUserChangesGuid(UsnChangedCacheRefresher.java:313)
      	at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseUserChanges(UsnChangedCacheRefresher.java:374)
      	at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseChanges(UsnChangedCacheRefresher.java:117)
      	at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:1095)
      	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$1.run(ConfluenceQuartzThreadPool.java:22)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
      Caused by: net.sf.hibernate.QueryException: could not resolve property: directory.externalId of: com.atlassian.crowd.model.user.InternalUser
      	at net.sf.hibernate.persister.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:50)
      	at net.sf.hibernate.expression.AbstractCriterion.getColumns(AbstractCriterion.java:42)
      	at net.sf.hibernate.expression.NotNullExpression.toSqlString(NotNullExpression.java:26)
      	at net.sf.hibernate.loader.CriteriaLoader.<init>(CriteriaLoader.java:64)
      	at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3676)
      	at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:238)
      	at com.atlassian.crowd.embedded.hibernate2.HibernateUserDao$6.doInHibernate(HibernateUserDao.java:595)
      	at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
      	... 42 more
      

      Despite this error, the FULL Sync is working correctly.

            [CONFSERVER-36806] Incremental Sync with AD Always Fails

            ishan.liyanage yes, the bug was introduced in Confluence 5.7, and fixed in 5.7.5. We do not itemize every affected point release. For old enough issues, this becomes an exercise in frustration for everyone watching an issue, as each change to the affected versions triggers notifications - we'll spend more time on paperwork updating the outstanding issues and less time actually fixing them. You can assume that if 5.7 is affected, then 5.7.1, 5.7.2, 5.7.3 and 5.7.4 are all affected too. If only particular point releases are affected, we'll call that out in the issue description.

            Richard Atkins added a comment - ishan.liyanage yes, the bug was introduced in Confluence 5.7, and fixed in 5.7.5. We do not itemize every affected point release. For old enough issues, this becomes an exercise in frustration for everyone watching an issue, as each change to the affected versions triggers notifications - we'll spend more time on paperwork updating the outstanding issues and less time actually fixing them. You can assume that if 5.7 is affected, then 5.7.1, 5.7.2, 5.7.3 and 5.7.4 are all affected too. If only particular point releases are affected, we'll call that out in the issue description.

            Same error in 5.7.4

            Ishan Liyanage added a comment - Same error in 5.7.4

            dodok1 No, this issue is not fixed by the Crowd upgrade to 2.8.2. The fix is not in Confluence 5.7.4.

            Nick Clarke added a comment - dodok1 No, this issue is not fixed by the Crowd upgrade to 2.8.2. The fix is not in Confluence 5.7.4.

            In Cofluence 5.7.4 were CROWD libraries updated to 2.8.2 (as in JIRA/Stash). Isn't this fixing the issue?

            Jozef Kotlár added a comment - In Cofluence 5.7.4 were CROWD libraries updated to 2.8.2 (as in JIRA/Stash). Isn't this fixing the issue?

            Matt Ryall added a comment -

            Looks like this has been merged into release/5.8. Can you please update the status, Richard?

            Matt Ryall added a comment - Looks like this has been merged into release/5.8. Can you please update the status, Richard?

            We also have this error running v 5.7.3. Since the upgrade we have seen performance dropped significantly to the point where confluence becomes almost unusable. Wondering if others are getting the same performance hit due to this error or if we have other issues as well?

            David Mouchemore added a comment - We also have this error running v 5.7.3. Since the upgrade we have seen performance dropped significantly to the point where confluence becomes almost unusable. Wondering if others are getting the same performance hit due to this error or if we have other issues as well?

            This functionality of embedded crowd seems to work in the most recent versions of JIRA and Stash, but not Confluence. Is there a workaround or jar we can swap out from those products?

            DI2E Licensing added a comment - This functionality of embedded crowd seems to work in the most recent versions of JIRA and Stash, but not Confluence. Is there a workaround or jar we can swap out from those products?

            On a high workload during the day this takes even longer...
            Last synchronised at 4/8/15 11:07 AM (took 740s).
            the tasks still runs every 14 Minutes
            Would like to raise the priority...

            Andre Lehmann added a comment - On a high workload during the day this takes even longer... Last synchronised at 4/8/15 11:07 AM (took 740s). the tasks still runs every 14 Minutes Would like to raise the priority...

            This seems to be significantly slowing down our Confluence instance. I would debate the Minor priority.

            Denis Cabasson added a comment - This seems to be significantly slowing down our Confluence instance. I would debate the Minor priority.

            An estimated Fix-Date would be nice.
            In our environment (Confluence 5.7.1) we had a 14min incremental sync.
            Now every 14min a full sync is made and each sync takes around 3 Minutes

            Andre Lehmann added a comment - An estimated Fix-Date would be nice. In our environment (Confluence 5.7.1) we had a 14min incremental sync. Now every 14min a full sync is made and each sync takes around 3 Minutes

              richatkins Richard Atkins
              prompas Patrice Rompas (Inactive)
              Affected customers:
              29 This affects my team
              Watchers:
              54 Start watching this issue

                Created:
                Updated:
                Resolved: