Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-66547

Confluence upgrade to 7.12.3 fails because of new column missing in cwd_group table (MS SQL Server)

      We don't plan to backport the fix for this bug to earlier Long Term Support versions

      The fix for this bug isn't suitable for backporting to a bug fix release for any previous LTS versions. This is often because the fix is considered too high risk to implement in an older version.

      The fix for this issue will be included in future Long Term Support versions.

      Issue Summary

      If the database name or schema name in a Microsoft SQL Server database has multiple prefixes, the upgrade will fail for Confluence 7.12.3

      Example: confluence.company.com.dbo.SPACES

      Steps to Reproduce

      1. Install Confluence 7.4.10 with Microsoft SQL Server 2016
      2. Upgrade to Confluence 7.12.3

      Expected Results

      The upgrade should complete without errors.

      Actual Results

      The below exception is thrown in the atlassian-confluence.log file:

      2021-07-07 07:27:44,369 ERROR [perm-delta-cache-receiver] [engine.jdbc.spi.SqlExceptionHelper] logExceptions Invalid column name 'external_id'.
      2021-07-07 07:27:44,377 WARN [perm-delta-cache-receiver] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
        ->[PluginReadWriteTx]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #282090034)
      2021-07-07 07:27:44,418 ERROR [perm-delta-cache-receiver] [gatekeeper.evaluator.cache.CacheUpdateReceiver] error Failed to initialize evaluator cache
      org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      	at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:228)
      	at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:388)
      	at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:337)
      	at com.atlassian.crowd.embedded.hibernate2.HibernateGroupDao.internalFindByName(HibernateGroupDao.java:479)
      	at com.atlassian.crowd.embedded.hibernate2.HibernateGroupDao.findByName(HibernateGroupDao.java:82)
      	at com.atlassian.confluence.impl.user.crowd.CachedCrowdGroupDao.findGroupInternal(CachedCrowdGroupDao.java:78)
      	at com.atlassian.confluence.impl.user.crowd.CachedCrowdGroupDao.lambda$findGroup$0(CachedCrowdGroupDao.java:101)
      	at com.atlassian.confluence.cache.CacheOperations.lambda$get$0(CacheOperations.java:172)
      	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1133)
      	at com.atlassian.confluence.cache.CacheOperations.get(CacheOperations.java:172)
      	at com.atlassian.confluence.cache.DeferredOperationsCache.getOrLoad(DeferredOperationsCache.java:93)
      	at com.atlassian.confluence.cache.DeferredOperationsCache.get(DeferredOperationsCache.java:57)
      	at com.atlassian.confluence.cache.TransactionalCacheFactory$TransactionalCache.get(TransactionalCacheFactory.java:343)
      	at com.atlassian.confluence.impl.cache.tx.TransactionAwareCache$1.get(TransactionAwareCache.java:43)
      	at com.atlassian.confluence.impl.user.crowd.CachedCrowdGroupDao.findGroup(CachedCrowdGroupDao.java:101)
      	at com.atlassian.confluence.impl.user.crowd.CachedCrowdGroupDao.findByName(CachedCrowdGroupDao.java:113)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy77.findByName(Unknown Source)
      	at com.atlassian.crowd.directory.AbstractInternalDirectory.findGroupByName(AbstractInternalDirectory.java:709)
      	at com.atlassian.crowd.directory.AbstractInternalDirectory.findGroupByName(AbstractInternalDirectory.java:64)
      	at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.findGroupByName(DirectoryManagerGeneric.java:497)
      	at com.atlassian.crowd.manager.application.canonicality.CanonicalEntityByNameFinder.findByName(CanonicalEntityByNameFinder.java:106)
      	at com.atlassian.crowd.manager.application.canonicality.CanonicalEntityByNameFinder.findByName(CanonicalEntityByNameFinder.java:92)
      	at com.atlassian.crowd.manager.application.canonicality.CanonicalEntityByNameFinder.findGroupByName(CanonicalEntityByNameFinder.java:66)
      	at com.atlassian.crowd.manager.application.ApplicationServiceGeneric.findGroupByName(ApplicationServiceGeneric.java:653)
      	at com.atlassian.crowd.embedded.core.CrowdServiceImpl.getGroup(CrowdServiceImpl.java:135)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy86.getGroup(Unknown Source)
      	at com.atlassian.crowd.embedded.atlassianuser.EmbeddedCrowdGroupManager.getGroup(EmbeddedCrowdGroupManager.java:108)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy124.getGroup(Unknown Source)
      	at bucket.user.DefaultUserAccessor.getGroup(DefaultUserAccessor.java:257)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy71.getGroup(Unknown Source)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy514.getGroup(Unknown Source)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy2729.getGroup(Unknown Source)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.GroupMembersCache.getGroupMembersFromApi(GroupMembersCache.java:85)
      	at java.base/java.util.Map.computeIfAbsent(Map.java:1003)
      	at java.base/java.util.Collections$SynchronizedMap.computeIfAbsent(Collections.java:2682)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.GroupMembersCache.get(GroupMembersCache.java:105)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.EvaluatorCacheImpl.hasUserCanUse(EvaluatorCacheImpl.java:209)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.UserCache.finish(UserCache.java:176)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.EvaluatorCacheImpl.finish(EvaluatorCacheImpl.java:169)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.EvaluatorCacheImpl.<init>(EvaluatorCacheImpl.java:85)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.EvaluatorCacheFactoryImpl.lambda$createInstance$0(EvaluatorCacheFactoryImpl.java:38)
      	at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21)
      	at com.atlassian.sal.spring.component.SpringHostContextAccessor.lambda$doInTransaction$0(SpringHostContextAccessor.java:70)
      	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
      	at com.atlassian.sal.spring.component.SpringHostContextAccessor.doInTransaction(SpringHostContextAccessor.java:68)
      	at com.atlassian.confluence.spring.transaction.interceptor.ConfluenceSpringHostContextAccessor.access$001(ConfluenceSpringHostContextAccessor.java:21)
      	at com.atlassian.confluence.spring.transaction.interceptor.ConfluenceSpringHostContextAccessor.lambda$doInTransaction$3(ConfluenceSpringHostContextAccessor.java:72)
      	at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84)
      	at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68)
      	at com.atlassian.confluence.spring.transaction.interceptor.ConfluenceSpringHostContextAccessor.doInTransaction(ConfluenceSpringHostContextAccessor.java:72)
      	at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:18)
      	at jdk.internal.reflect.GeneratedMethodAccessor280.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy251.execute(Unknown Source)
      	at jdk.internal.reflect.GeneratedMethodAccessor280.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy2728.execute(Unknown Source)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.EvaluatorCacheFactoryImpl.createInstance(EvaluatorCacheFactoryImpl.java:36)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.CacheUpdateReceiver.initCache(CacheUpdateReceiver.java:85)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.CacheUpdateReceiver.processAnyEvents(CacheUpdateReceiver.java:113)
      	at com.atlassian.confluence.plugins.gatekeeper.evaluator.cache.CacheUpdateReceiver.run(CacheUpdateReceiver.java:98)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106)
      	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
      	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:69)
      	at org.hibernate.loader.Loader.getResultSet(Loader.java:2168)
      	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1931)
      	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1893)
      	at org.hibernate.loader.Loader.doQuery(Loader.java:938)
      	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
      	at org.hibernate.loader.Loader.doList(Loader.java:2692)
      	at org.hibernate.loader.Loader.doList(Loader.java:2675)
      	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2507)
      	at org.hibernate.loader.Loader.list(Loader.java:2502)
      	at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:109)
      	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1936)
      	at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:370)
      	at org.hibernate.internal.CriteriaImpl.uniqueResult(CriteriaImpl.java:392)
      	at com.atlassian.crowd.embedded.hibernate2.HibernateGroupDao.lambda$internalFindByName$17(HibernateGroupDao.java:483)
      	at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:385)
      	... 154 more
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'external_id'.
      	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:260)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1547)
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:528)
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:461)
      	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7342)
      	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2688)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:224)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:204)
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:383)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:1471)
      	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60)
      	... 169 more
      

      Workaround

      There are two possible workarounds of this problem:

      Option 1

      Update the database/schema name and remove the periods(.) from the name and update the confluence.cfg.xml file with the new name.

      Option 2

      Add new column external_id to the cwd_group table before starting upgrade (it's important to put your database and schema name in square brackets []):

      alter table [your_database_name].[your_schema_name].cwd_group add external_id nvarchar(255) 

            [CONFSERVER-66547] Confluence upgrade to 7.12.3 fails because of new column missing in cwd_group table (MS SQL Server)

            A fix for this issue is available in Confluence Server and Data Center 8.0.0.
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            James Whitehead added a comment - A fix for this issue is available in Confluence Server and Data Center 8.0.0. Upgrade now or check out the Release Notes to see what other issues are resolved.

            Hi All,

            Resolving this issue requires upgrading an underlying core library, which is a breaking change. Breaking changes are only introduced in major version releases, such as Confluence 8.0.0.

            As a result, this change cannot be backported to older versions of Confluence.

            Thanks,
            James Ponting
            Engineering Manager - Confluence Data Center

            James Ponting added a comment - Hi All, Resolving this issue requires upgrading an underlying core library, which is a breaking change. Breaking changes are only introduced in major version releases, such as Confluence 8.0.0. As a result, this change cannot be backported to older versions of Confluence. Thanks, James Ponting Engineering Manager - Confluence Data Center

            Hi @SamLe,

            Ok, I get it . Thank you very much for your return and explanation.

            Have a nice day!

            Bruno Benatti Godinho added a comment - Hi @SamLe, Ok, I get it . Thank you very much for your return and explanation. Have a nice day!

            SamLe added a comment - - edited

            Hi Bruno,

            Only if you have a hyphen in the database name and do NOT wish to rename the database, do you need to apply the database modifications! If you rename the database (Option 1) then I assume there is no need to apply the DB modifications!

            So, if you wish to keep a hyphen in the database name, then yes, apply all 3 columns (remembering to run the null value update for CONFVERSION... Step 3)

            Disclaimer: I do not work for Atlassian, this is purely just what I needed to do, based on responses from their support team after providing logs back and forth over numerous upgrades.

            I recommend you take a copy of your logs before AND after the upgrade (if it fails), so then if you need to roll back you've got the appropriate logs to provide to Atlassian.

            Remember to edit in your own database name and schema name to the  code below.

            ALTER TABLE [your_database_name].[your_schema_name].cwd_group add external_id nvarchar(255) 
            ALTER TABLE [your_database_name].[your_schema_name].CONFVERSION ADD FINALIZED CHAR (1) NOT NULL DEFAULT 'N';
            update CONFVERSION SET FINALIZED = 'N';
            ALTER TABLE [your_database_name].[your_schema_name].CONFZDU ADD ORIG_BUILD_NUMBER INT NOT NULL DEFAULT 0;

            SamLe added a comment - - edited Hi Bruno, Only if you have a hyphen in the database name and do NOT wish to rename the database, do you need to apply the database modifications! If you rename the database (Option 1) then I assume there is no need to apply the DB modifications! So, if you wish to keep a hyphen in the database name, then yes, apply all 3 columns (remembering to run the null value update for CONFVERSION... Step 3) Disclaimer: I do not work for Atlassian, this is purely just what I needed to do, based on responses from their support team after providing logs back and forth over numerous upgrades. I recommend you take a copy of your logs before AND after the upgrade (if it fails), so then if you need to roll back you've got the appropriate logs to provide to Atlassian. Remember to edit in your own database name and schema name to the  code below. ALTER TABLE [your_database_name].[your_schema_name].cwd_group add external_id nvarchar(255) ALTER TABLE [your_database_name].[your_schema_name].CONFVERSION ADD FINALIZED CHAR (1) NOT NULL DEFAULT 'N' ; update CONFVERSION SET FINALIZED = 'N' ; ALTER TABLE [your_database_name].[your_schema_name].CONFZDU ADD ORIG_BUILD_NUMBER INT NOT NULL DEFAULT 0;

            Bruno Benatti Godinho added a comment - - edited

            Hi team,

            I'm a little confused about this issue and I hope you could help me to understand what is needed to do. I'm about to upgrade my Confluence instance from version 6.13.0 to 7.15.0 so, in order to accomplish this successfully, I need (before upgrade) to add three new columns to the database (external_id, finalized and orig_build_number), is that right? And only the column "finalized" needs a default value?

            Thanks in advance. 

            Bruno Benatti Godinho added a comment - - edited Hi team, I'm a little confused about this issue and I hope you could help me to understand what is needed to do. I'm about to upgrade my Confluence instance from version 6.13.0 to 7.15.0 so, in order to accomplish this successfully, I need (before upgrade) to add three new columns to the database ( external_id , finalized and orig_build_number ), is that right? And only the column "finalized" needs a default value? Thanks in advance. 

            SamLe added a comment -

            If you used Option 2 to upgrade previously; then subsequent upgrades (eg. 7.13.0 to 7.15.0) will fail even though you've added the external_id column. (This is probably of interest to you 303852dbdc1a,)
            However, to prevent/resolve this issue, follow these steps:

            1. (If you've already attempted an upgrade, then unfortunately you'll need to start by rolling back your version and database to whatever stable version you had before attempting the upgrade.)
            2. Before upgrading, run the following query to manually create the FINALIZED column
              • ALTER TABLE [your_database_name].[your_schema_name].CONFVERSION ADD FINALIZED CHAR (1) NOT NULL DEFAULT 'N';
            3. After creating the column, you need to insert a value to the column as the column does not allow null value
              • update CONFVERSION SET FINALIZED = 'N';
            4. Run the following query to manually create the ORIG_BUILD_NUMBER column
              • ALTER TABLE [your_database_name].[your_schema_name].CONFZDU ADD ORIG_BUILD_NUMBER INT NOT NULL DEFAULT 0;
              •  Based on tests, there isn't really a need to add the default value 0 to the ORIG_BUILD_NUMBER
            5. Once the these columns are created, you can attempt/re-attempt the upgrade.

            SamLe added a comment - If you used  Option 2 to upgrade previously; then subsequent upgrades (eg. 7.13.0 to 7.15.0) will fail even though you've added the external_id column. (This is probably of interest to you 303852dbdc1a ,) However, to prevent/resolve this issue, follow these steps: (If you've already attempted an upgrade, then unfortunately you'll need to start by rolling back your version and database to whatever stable version you had before attempting the upgrade.) Before upgrading, run the following query to manually create the FINALIZED  column ALTER TABLE  [your_database_name] . [your_schema_name] .CONFVERSION ADD FINALIZED CHAR (1) NOT NULL DEFAULT 'N'; After creating the column, you need to insert a value to the column as the column does not allow null value update CONFVERSION SET FINALIZED = 'N'; Run the following query to manually create the  ORIG_BUILD_NUMBER  column ALTER TABLE  [your_database_name] . [your_schema_name] .CONFZDU ADD ORIG_BUILD_NUMBER INT NOT NULL DEFAULT 0;  Based on tests, there isn't really a need to add the default value 0 to the ORIG_BUILD_NUMBER Once the these columns are created, you can attempt/re-attempt the upgrade.

            Hi 303852dbdc1a,

            Here are answers to your questions:

            • Does this affect if you are upgrading from 7.4.4 to 7.13.1? - Yes, this problem affects versions 7.11.3 and higher and it's not solved yet.
            • Upgrading your database to 2017 instead of 2016, will that resolve the issue or should the workaround still be applied? - Database upgrade will not resolve this issue, you need apply the workaround in any case
            • What happens if I try Adding new column external_id to the cwd_group table after doing the upgrade when the upgrade fails? - I would highly recommend to add this column to the table before you start Confluence upgrade. The fact that this column is missing could affect some upgrade tasks which run during Confluence upgrade. We couldn't guarantee that Confluence will work properly if you upgrade first and add this column later as some upgrade task could fail and never run again. If you have already run your upgrade I would suggest to use your db backup that you have created before your last attempt to upgrade Confluence and start everything from scratch again.

            Irina Tiapchenko added a comment - Hi 303852dbdc1a , Here are answers to your questions: Does this affect if you are upgrading from 7.4.4 to 7.13.1? - Yes, this problem affects versions 7.11.3 and higher and it's not solved yet. Upgrading your database to 2017 instead of 2016, will that resolve the issue or should the workaround still be applied? - Database upgrade will not resolve this issue, you need apply the workaround in any case What happens if I try Adding new column external_id to the cwd_group table after doing the upgrade when the upgrade fails? - I would highly recommend to add this column to the table before you start Confluence upgrade. The fact that this column is missing could affect some upgrade tasks which run during Confluence upgrade. We couldn't guarantee that Confluence will work properly if you upgrade first and add this column later as some upgrade task could fail and never run again. If you have already run your upgrade I would suggest to use your db backup that you have created before your last attempt to upgrade Confluence and start everything from scratch again.

            Does this affect if you are upgrading from 7.4.4 to 7.13.1?

            Also, upgrading your database to 2017 instead of 2016, will that resolve the issue or should the workaround still be applied?

            What happens if I try Adding new column external_id to the cwd_group table after doing the upgrade when the upgrade fails?

             

            Ganga Bopaiah added a comment - Does this affect if you are upgrading from 7.4.4 to 7.13.1? Also, upgrading your database to 2017 instead of 2016, will that resolve the issue or should the workaround still be applied? What happens if I try Adding new column  external_id  to the  cwd_group  table after doing the upgrade when the upgrade fails?  

            PokLa added a comment -

            PokLa my account

            PokLa added a comment - PokLa my account

            Saquia Naz added a comment -

            Hi f3b0652f7cda,

            There is a workaround if you are stuck and want to move forward. 

            So workaround is, go to database directly and execute following ddl sql statement to add a new column in the cwd_group table. Main point is quote your database and schema name with square bracket if it's name has dot or hyphen. DDL statement is…

            alter table [your database name].[your schema name].cwd_group add external_id nvarchar(255) 

            Saquia Naz added a comment - Hi f3b0652f7cda , There is a workaround if you are stuck and want to move forward.  So workaround is, go to database directly and execute following ddl sql statement to add a new column in the cwd_group table. Main point is quote your database and schema name with square bracket if it's name has dot or hyphen. DDL statement is… alter table  [your database name] . [your schema name] .cwd_group add external_id nvarchar(255) 

              bhyde Bradley Hyde
              03cb0c04aa4f Irina Tiapchenko
              Affected customers:
              19 This affects my team
              Watchers:
              28 Start watching this issue

                Created:
                Updated:
                Resolved: