Issue Summary
Upgrading Bamboo to 8.0.0 and connected to an Oracle database the upgrade with "ORA-22859: invalid modification of columns" errors.
Diagnosis
Look for the DDL of the following tables and check the data type of the following columns:
| TABLE_NAME | COLUMN |
|---|---|
| CWD_PROPERTY | PROPERTY_VALUE |
| CWD_SYNCHRONISATION_TOKEN | SYNC_STATUS_TOKEN |
| CWD_SYNCHRONISATION_STATUS | STATUS_PARAMETERS |
| CWD_APPLICATION_ATTRIBUTE | ATTRIBUTE_VALUE |
Upgrade task # 80004 will attempt to convert the following columns data types from LONG to CLOB. If they are set to CLOB by the time you attempt to upgrade the application, the process will fail.
The following select query will help you extract the DDL for the tables above:
select dbms_metadata.get_ddl('TABLE', 'TABLE_NAME', 'SCHEMA_NAME') from dual;
You must replace TABLE, TABLE_NAME (with the names of the tables above) and SCHEMA_NAME before running the select query.
Steps to Reproduce
- Start an upgrade from Bamboo version ≤ 7.2.5 to ≥ 8.0.0 connected to Oracle.
- Stop the upgrade to make it fail after completing UpgradeTask80004ConvertOracleLongToClob to simulate an issue with the upgrade process.
- Restart the application to kick off the upgrade process again (or fix whatever problem caused the upgrade to stop after it ran UpgradeTask80004ConvertOracleLongToClob).
OR
- Upgrade your Bamboo instance twice to force both upgrade tasks to happen one after the other # 70003 (UpgradeTask70003ChangeECDirectoryAttributeColumnType) and # 80004 (UpgradeTask80004ConvertOracleLongToClob).
- Start an upgrade from Bamboo version 6.10.6 to 7.2.2 connected to Oracle.
- Once the upgrade is complete upgrade again from Bamboo version 7.2.5 to 8.0.0 connected to Oracle.
Expected Results
Upgrade process does not fail on UpgradeTask80004ConvertOracleLongToClob and completes successfully.
The upgrade task should check those columns before attempting to convert them to see if have been changed already and make a decision on whether to proceed or skip the update.
Actual Results
The upgrade fails with the following errors inside the <Bamboo server home directory>/logs/atlassian-bamboo.log because those columns have already been set to CLOB in a previous upgrade run.
The fact that the tables are set to CLOB indicate that a) you have upgraded Bamboo in the past and the some of those columns have already been converted to CLOB by upgrade task # 70003 (UpgradeTask70003ChangeECDirectoryAttributeColumnType) or b) you have probably attempted to upgrade that Bamboo database already (which could've been interrupted for another reason) but was enough to convert the columns to CLOB. Attempting to run another upgrade against the same database will fail because the columns are now set to CLOB.
2021-08-19 14:03:17,256 INFO [localhost-startStop-1] [AbstractUpgradeManager] ------------------------------------------------------------------
2021-08-19 14:03:17,258 INFO [localhost-startStop-1] [AbstractUpgradeManager] 80004 : Convert columns of type LONG to CLOB on Oracle (bootstrap)
2021-08-19 14:03:17,259 INFO [localhost-startStop-1] [AbstractUpgradeManager] ------------------------------------------------------------------
2021-08-19 14:03:17,275 WARN [localhost-startStop-1] [HikariConfig] {} - idleTimeout has been set but has no effect because the pool is operating as a fixed size pool.
2021-08-19 14:03:17,277 INFO [localhost-startStop-1] [HikariDataSource] HikariPool-2 - Starting...
2021-08-19 14:03:17,340 INFO [localhost-startStop-1] [HikariDataSource] HikariPool-2 - Start completed.
2021-08-19 14:03:17,545 ERROR [localhost-startStop-1] [AbstractUpgradeManager] java.sql.SQLException: ORA-22859: invalid modification of columns
java.sql.SQLException: ORA-22859: invalid modification of columns
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:461)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1104)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:550)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:268)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:655)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:229)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:41)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:928)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1205)
at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1823)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1778)
at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:303)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at com.atlassian.bamboo.utils.db.JdbcUtils.execute(JdbcUtils.java:59)
at com.atlassian.bamboo.upgrade.tasks.v8_0.UpgradeTask80004ConvertOracleLongToClob.lambda$doUpgrade$1(UpgradeTask80004ConvertOracleLongToClob.java:56)
at com.atlassian.bamboo.upgrade.AbstractBootstrapUpgradeTask.withDatabaseConnection(AbstractBootstrapUpgradeTask.java:65)
at com.atlassian.bamboo.upgrade.tasks.v8_0.UpgradeTask80004ConvertOracleLongToClob.doUpgrade(UpgradeTask80004ConvertOracleLongToClob.java:50)
at com.atlassian.bamboo.upgrade.AbstractUpgradeManager.runUpgradeTask(AbstractUpgradeManager.java:230)
at com.atlassian.bamboo.upgrade.BootstrapUpgradeManagerImpl.doUpgrade(BootstrapUpgradeManagerImpl.java:75)
at com.atlassian.bamboo.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:394)
at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:81)
at com.atlassian.bamboo.setup.BootstrapLoaderListener.contextInitialized(BootstrapLoaderListener.java:155)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4705)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5171)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: Error : 22859, Position : 33, Sql = alter table CWD_PROPERTY modify (PROPERTY_VALUE clob), OriginalSql = alter table CWD_PROPERTY modify (PROPERTY_VALUE clob), Error Msg = ORA-22859: invalid modification of columns
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:513)
... 32 more
2021-08-19 14:03:17,549 INFO [localhost-startStop-1] [AbstractUpgradeManager] Task 80004 completed successfully.
2021-08-19 14:03:17,550 FATAL [localhost-startStop-1] [DefaultBootstrapManager] Pre-bootstrap upgrade tasks failed
com.atlassian.upgrade.UpgradeException: Pre-bootstrap upgrade tasks failed: [Task for build 80004 failed with exception: ORA-22859: invalid modification of columns
]
at com.atlassian.bamboo.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:396)
at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:81)
at com.atlassian.bamboo.setup.BootstrapLoaderListener.contextInitialized(BootstrapLoaderListener.java:155)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4705)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5171)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Workaround
Workaround 1 (not recommended without getting in touch with support first)
- Stop Bamboo server.
- Tell Bamboo to ignore the upgrade task # 80004 (UpgradeTask80004ConvertOracleLongToClob) in the next upgrade attempt by commenting out the following line inside the <Bamboo server installation directory>/atlassian-bamboo/WEB-INF/classes/upgrades.xml file:
<!-- <upgrade build="80004" class="com.atlassian.bamboo.upgrade.tasks.v8_0.UpgradeTask80004ConvertOracleLongToClob"/> --
- Change the datatype of all 4 columns manually to CLOB with
alter table TABLE_NAME modify (COLUMN_NAME clob)
the 4 columns are listed in the table above. - Start Bamboo server.
- mentioned in
-
Page Loading...