org.postgresql.util.PSQLException: ERROR: column "DEFAULT_LANE" cannot be cast to type boolean

Atlassian JIRA | Alejandro Conde Carrillo | 3 years ago
  1. 0

    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: {noformat}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 {noformat} +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

    Atlassian JIRA | 3 years ago | Alex Conde [Atlassian]
    org.postgresql.util.PSQLException: ERROR: column "DEFAULT_LANE" cannot be cast to type boolean
  2. 0

    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: {noformat}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 {noformat} +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

    Atlassian JIRA | 3 years ago | Alejandro Conde Carrillo
    org.postgresql.util.PSQLException: ERROR: column "DEFAULT_LANE" cannot be cast to type boolean
  3. 0

    Stop Hibernate from trying to re-create indexes on every startup

    Stack Overflow | 2 years ago | Evgeny Chesnokov
    org.postgresql.util.PSQLException: ERROR: relation "statusindex" already exists
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    how to insert array in table using JDBC insert

    Stack Overflow | 1 year ago | Mary.Hansen
    org.postgresql.util.PSQLException: ERROR: syntax error at or near "[" Position: 99
  6. 0

    Pentaho ce 5 Initialization Exception

    pentaho.com | 5 months ago
    org.postgresql.util.PSQLException: ERROR: syntax error at or near "RUNSCRIPT" Position: 1

  1. silex 2 times, last 3 weeks ago
  2. silex 18 times, last 6 months ago
20 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.postgresql.util.PSQLException

    ERROR: column "DEFAULT_LANE" cannot be cast to type boolean

    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse()
  2. PostgreSQL JDBC Driver
    AbstractJdbc2Statement.executeUpdate
    1. org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
    2. org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
    3. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    4. org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
    5. org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
    6. org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:302)
    6 frames
  3. Commons DBCP
    DelegatingStatement.executeUpdate
    1. org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
    2. org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
    2 frames
  4. net.java.ao
    EntityManager.migrate
    1. net.java.ao.DatabaseProvider.executeUpdate(DatabaseProvider.java:2309)
    2. net.java.ao.DatabaseProvider.executeUpdateForAction(DatabaseProvider.java:2379)
    3. net.java.ao.DatabaseProvider.executeUpdatesForActions(DatabaseProvider.java:2342)
    4. net.java.ao.schema.SchemaGenerator.migrate(SchemaGenerator.java:99)
    5. net.java.ao.EntityManager.migrate(EntityManager.java:143)
    5 frames
  5. com.atlassian.activeobjects
    DelegatingActiveObjects$MemoizingSupplier.get
    1. com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:44)
    2. com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory.create(AbstractActiveObjectsFactory.java:52)
    3. com.atlassian.activeobjects.internal.DelegatingActiveObjectsFactory.create(DelegatingActiveObjectsFactory.java:39)
    4. com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.createActiveObjects(ActiveObjectsServiceFactory.java:136)
    5. com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory.access$000(ActiveObjectsServiceFactory.java:51)
    6. com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:65)
    7. com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$1$1.get(ActiveObjectsServiceFactory.java:61)
    8. com.atlassian.activeobjects.osgi.DelegatingActiveObjects$MemoizingSupplier.get(DelegatingActiveObjects.java:156)
    8 frames