Upgrade task fails on df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION

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.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

    

Summary

Upgrade of Confluence fails.

The following appears in the atlassian-confluence.log:

2021-08-05 09:17:42,594 ERROR [localhost-startStop-1] [atlassian.confluence.plugin.PluginFrameworkContextListener] launchUpgrades Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.MsSqlServerAoUpgradeTask@29936941 failed during the SCHEMA_UPGRADE phase due to: StatementCallback; SQL [ALTER TABLE "AO_B58FB0_ST_CONFIG4_V1" ALTER COLUMN "AXIS_ORIENTATION" nvarchar(255) NULL;]; The object 'df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION' is dependent on column 'AXIS_ORIENTATION'.; nested exception is java.sql.SQLException: The object 'df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION' is dependent on column 'AXIS_ORIENTATION'.
com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.MsSqlServerAoUpgradeTask@29936941 failed during the SCHEMA_UPGRADE phase due to: StatementCallback; SQL [ALTER TABLE "AO_B58FB0_ST_CONFIG4_V1" ALTER COLUMN "AXIS_ORIENTATION" nvarchar(255) NULL;]; The object 'df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION' is dependent on column 'AXIS_ORIENTATION'.; nested exception is java.sql.SQLException: The object 'df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION' is dependent on column 'AXIS_ORIENTATION'.
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:229)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:185)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:140)
	at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:118)
	at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:77)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.dao.TransientDataAccessResourceException: StatementCallback; SQL [ALTER TABLE "AO_B58FB0_ST_CONFIG4_V1" ALTER COLUMN "AXIS_ORIENTATION" nvarchar(255) NULL;]; The object 'df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION' is dependent on column 'AXIS_ORIENTATION'.; nested exception is java.sql.SQLException: The object 'df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION' is dependent on column 'AXIS_ORIENTATION'.
	at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:108)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:415)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:439)
	at com.atlassian.confluence.upgrade.upgradetask.MsSqlServerAoUpgradeTask.executeStatement(MsSqlServerAoUpgradeTask.java:195)
	at com.atlassian.confluence.upgrade.upgradetask.MsSqlServerAoUpgradeTask.executeStatements(MsSqlServerAoUpgradeTask.java:188)
	at com.atlassian.confluence.upgrade.upgradetask.MsSqlServerAoUpgradeTask.doUpgrade(MsSqlServerAoUpgradeTask.java:174)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
	at com.sun.proxy.$Proxy46.doUpgrade(Unknown Source)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager$UpgradeStep$3.execute(AbstractUpgradeManager.java:636)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeTask(AbstractUpgradeManager.java:243)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:223)
	... 13 more
Caused by: java.sql.SQLException: The object 'df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION' is dependent on column 'AXIS_ORIENTATION'.
	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
	at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
	at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
	at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1157)
	at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)
	at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:431)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:404)
	... 33 more
caused by:
java.sql.SQLException: ALTER TABLE ALTER COLUMN AXIS_ORIENTATION failed because one or more objects access this column.
	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
	at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:636)
	at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
	at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1157)
	at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)
	at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:431)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:404)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:439)
	at com.atlassian.confluence.upgrade.upgradetask.MsSqlServerAoUpgradeTask.executeStatement(MsSqlServerAoUpgradeTask.java:195)
	at com.atlassian.confluence.upgrade.upgradetask.MsSqlServerAoUpgradeTask.executeStatements(MsSqlServerAoUpgradeTask.java:188)
	at com.atlassian.confluence.upgrade.upgradetask.MsSqlServerAoUpgradeTask.doUpgrade(MsSqlServerAoUpgradeTask.java:174)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
	at com.sun.proxy.$Proxy46.doUpgrade(Unknown Source)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager$UpgradeStep$3.execute(AbstractUpgradeManager.java:636)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeTask(AbstractUpgradeManager.java:243)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:223)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:185)
	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:140)
	at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:118)
	at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:77)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

Environment

Upgrading from an old version of Confluence (usually Confluence 5) integrated with Microsoft SQL Server.

Cause

The AO_B58FB0_ST_CONFIG4_V1  table is created from the:

When upgrading from an old Confluence version (usually Confluence 5), there is an upgrade task that runs to converts VARCHAR → NVARCHAR:

When the upgrade task runs to convert two columns on the AO_B58FB0_ST_CONFIG4_V1 table, it fails due to default values on the column.

  • AXIS_ORIENTATION default value 'bottom'
  • NUMBER_OF_ROWS default value '10'

To allow the upgrade task to run successfully, we just need to temporarily drop the above default values (which appear as constraints in the database) that causes the following SQL to error out:

ALTER TABLE "AO_B58FB0_ST_CONFIG4_V1" ALTER COLUMN "AXIS_ORIENTATION" nvarchar(255) NULL;

The issue may still occur even if the Staffing Timeline App is no longer installed on the Confluence instance as the AO_B58FB0_ST_CONFIG4_V1 database table would still be present in the Confluence database.

Solution

  1. Rollback the Confluence Home and Database to prior the upgrade attempt
  2. Manually drop the two constraints on AO_B58FB0_ST_CONFIG4_V1

    ALTER TABLE "AO_B58FB0_ST_CONFIG4_V1" DROP CONSTRAINT df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION;
    ALTER TABLE "AO_B58FB0_ST_CONFIG4_V1" DROP CONSTRAINT df_AO_B58FB0_ST_CONFIG4_V1_NUMBER_OF_ROWS;
  3. Start Confluence and the upgrade should move past the error
  4. Once Confluence has upgraded successfully:
    1. If you still have Staffing Timeline app installed, there is nothing further that needs to be done. The Staffing Timeline app should automatically re-add back in the DEFAULT column constraints onto the table.
    2. If you no longer have Staffing Timeline app installed, we should manually put back the constraints just to ensure data integrity:

      ALTER TABLE "AO_B58FB0_ST_CONFIG4_V1" ADD  CONSTRAINT df_AO_B58FB0_ST_CONFIG4_V1_AXIS_ORIENTATION  DEFAULT 'bottom' FOR "AXIS_ORIENTATION";
      ALTER TABLE "AO_B58FB0_ST_CONFIG4_V1" ADD  CONSTRAINT df_AO_B58FB0_ST_CONFIG4_V1_NUMBER_OF_ROWS  DEFAULT '10' FOR "NUMBER_OF_ROWS";


Last modified on Sep 20, 2021

Was this helpful?

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