Details
-
Bug
-
Resolution: Timed out
-
Low
-
None
-
None
-
None
-
2
-
Severity 3 - Minor
-
Description
NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.
In Oracle Database there is not a type called boolean. An integer is used instead. This causes problems when generating a JIRA XML backup and restoring it in and instance using another database, as the boolean fields are created as integers when they should be boolean.
This only affects Active Object tables as there is not a column of the type boolean in JIRA database schema.
I have noticed this problems affects the JIRA Agile add-on but it could potentially affect all add-ons which use Active Objects and have a boolean column in their DB tables.
In the logs, when restoring from the backup, you should get an error similar to this:
2014-01-21 15:09:36,753 JiraImportTaskExecutionThread-1 ERROR alex 908x453x1 99o1bj 127.0.0.1 /secure/admin/XmlRestore.jspa [net.java.ao.sql] Exception executing SQL update <ALTER TABLE public."AO_60DB71_SWIMLANE" ALTER COLUMN "DEFAULT_LANE" TYPE BOOLEAN> org.postgresql.util.PSQLException: ERROR: column "DEFAULT_LANE" cannot be cast to type boolean at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:302) at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228) at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228) at net.java.ao.DatabaseProvider.executeUpdate(DatabaseProvider.java:2309) at net.java.ao.DatabaseProvider.executeUpdateForAction(DatabaseProvider.java:2379) at net.java.ao.DatabaseProvider.executeUpdatesForActions(DatabaseProvider.java:2342) at net.java.ao.schema.SchemaGenerator.migrate(SchemaGenerator.java:99) at net.java.ao.EntityManager.migrate(EntityManager.java:143) at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:44) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory.create(AbstractActiveObjectsFactory.java:52) at com.atlassian.activeobjects.internal.DelegatingActiveObjectsFactory.create(DelegatingActiveObjectsFactory.java:39) at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.createActiveObjects(ActiveObjectsServiceFactory.java:136) at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.access$000(ActiveObjectsServiceFactory.java:51) at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:65) at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:61) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects$MemoizingSupplier.get(DelegatingActiveObjects.java:156) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:88) <+3> at java.lang.reflect.Method.invoke(Unknown Source) ... 2014-01-21 15:09:36,759 JiraImportTaskExecutionThread-1 WARN alex 908x453x1 99o1bj 127.0.0.1 /secure/admin/XmlRestore.jspa [java.ao.db.PostgreSQLDatabaseProvider] Error in schema creation: ERROR: column "DEFAULT_LANE" cannot be cast to type boolean; attempting to roll back last partially generated table 2014-01-21 15:09:36,760 JiraImportTaskExecutionThread-1 ERROR alex 908x453x1 99o1bj 127.0.0.1 /secure/admin/XmlRestore.jspa [sal.core.lifecycle.DefaultLifecycleManager] Unable to start component: com.sun.proxy.$Proxy4099 com.atlassian.util.concurrent.LazyReference$InitializationException: com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:PostgreSQL - version:9.1.11 - minor version:1 - major version:9 Driver: - name:PostgreSQL Native Driver - version:PostgreSQL 9.0 JDBC4 (build 801) org.postgresql.util.PSQLException: ERROR: column "DEFAULT_LANE" cannot be cast to type boolean at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:152) at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:115) at com.atlassian.greenhopper.Launcher.onSystemStartPhase(Launcher.java:197) at com.atlassian.greenhopper.Launcher.onStart(Launcher.java:176) <+2> at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) ... Caused by: com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:PostgreSQL - version:9.1.11 - minor version:1 - major version:9 - name:PostgreSQL Native Driver - version:PostgreSQL 9.0 JDBC4 (build 801) org.postgresql.util.PSQLException: ERROR: column "DEFAULT_LANE" cannot be cast to type boolean at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:48) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory.create(AbstractActiveObjectsFactory.java:52) at com.atlassian.activeobjects.internal.DelegatingActiveObjectsFactory.create(DelegatingActiveObjectsFactory.java:39) at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.createActiveObjects(ActiveObjectsServiceFactory.java:136) at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.access$000(ActiveObjectsServiceFactory.java:51) at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:65) at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:61) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects$MemoizingSupplier.get(DelegatingActiveObjects.java:156) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:88) <+3> at java.lang.reflect.Method.invoke(Unknown Source) ... Caused by: org.postgresql.util.PSQLException: ERROR: column "DEFAULT_LANE" cannot be cast to type boolean at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374) at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228) at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228) at net.java.ao.DatabaseProvider.executeUpdate(DatabaseProvider.java:2309) at net.java.ao.DatabaseProvider.executeUpdateForAction(DatabaseProvider.java:2379) at net.java.ao.DatabaseProvider.executeUpdatesForActions(DatabaseProvider.java:2342) at net.java.ao.schema.SchemaGenerator.migrate(SchemaGenerator.java:99) at net.java.ao.EntityManager.migrate(EntityManager.java:143) at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:44) ... 93 more
Repro steps:
- Install JIRA and set an Oracle Database as the JIRA database.
- Install the JIRA Agile plugin.
- Create an XML backup.
- Restore the XML backup
Attachments
Issue Links
- relates to
-
JRACLOUD-36776 Boolean type lost on XML backup from Oracle DB in AO tables
- Closed
- is related to
-
AO-419 Loading...
- was cloned as
-
AO-494 Loading...