Scheduler fails after upgrade from 6.3 to 6.4.12

Issue #119 closed
Kerem Caglar [Solveka] created an issue

Hi, After we upgraded from 6.3 to 6.4.12 we also updated scheduler's version to 3.2.13. When the add-on is activated the following logs are thrown: {noformat} [net.java.ao.sql] Exception executing SQL update <ALTER TABLE " AO_A406ED_SCHEDULED_ISSUE" DROP CONSTRAINT U_AO_A406ED_SCHEDUL1453239299> java.sql.SQLException: ORA-02443: Cannot drop constraint - nonexistent constraint

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:999)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
    at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1822)
    at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1787)
    at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:280)
    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:2361)
    at net.java.ao.DatabaseProvider.executeUpdateForAction(DatabaseProvider.java:2431)
    at net.java.ao.DatabaseProvider.executeUpdatesForActions(DatabaseProvider.java:2394)
    at net.java.ao.schema.SchemaGenerator.migrate(SchemaGenerator.java:98)
    at net.java.ao.EntityManager.migrate(EntityManager.java:130)
    at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:50)
    at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory$1.doInTransaction(AbstractActiveObjectsFactory.java:91)
    at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory$1.doInTransaction(AbstractActiveObjectsFactory.java:85)
    at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25)
    at com.atlassian.jira.DefaultHostContextAccessor.doInTransaction(DefaultHostContextAccessor.java:34)  <+2> (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:134)
    at com.sun.proxy.$Proxy34.doInTransaction(Unknown Source)  <+2> (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:154)
    at com.sun.proxy.$Proxy34.doInTransaction(Unknown Source)
    at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:21)  <+2> (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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)
    at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
    at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)

2016-02-04 14:15:06,509 active-objects-init-JiraTenantImpl{id='jira.est.com.tr/jira'}-0 WARN solveka [java.ao.db.OracleDatabaseProvider] Error in schema creation: ORA-02443: Cannot drop constraint - nonexistent constraint ; attempting to roll back last partially generated table 2016-02-04 14:15:06,510 ajp-bio-8180-exec-41 ERROR solveka 855x57415x1 1dm28di 95.9.103.249 /rest/plugins/1.0/pl.com.tt.jira.plugin.theschedulerpro-key [tt.thescheduler.core.TheSchedulerManager] Unexpected error during launch com.atlassian.activeobjects.internal.ActiveObjectsInitException: bundle [pl.com.tt.jira.plugin.theschedulerpro] at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects$1$1$1.call(TenantAwareActiveObjects.java:105) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects$1$1$1.call(TenantAwareActiveObjects.java:92) at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:42) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:Oracle - version:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options - major version:11 Driver: - name:Oracle JDBC driver - version:11.2.0.2.0 java.sql.SQLException: ORA-02443: Cannot drop constraint - nonexistent constraint at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:54) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory$1.doInTransaction(AbstractActiveObjectsFactory.java:91) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory$1.doInTransaction(AbstractActiveObjectsFactory.java:85) at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25) at com.atlassian.jira.DefaultHostContextAccessor.doInTransaction(DefaultHostContextAccessor.java:34) <+2> (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:134) at com.sun.proxy.$Proxy34.doInTransaction(Unknown Source) <+2> (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:154) at com.sun.proxy.$Proxy34.doInTransaction(Unknown Source) at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:21) <+2> (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Meth

Comments (7)

  1. Bartosz Gilewski

    Hello,

    The problem was caused by the database (logs indicates that you have Oracle database in your JIRA instance). In the earlier versions of the plugin, there was a constraint on the database table that was removed in the recent versions.

    After the upgrade, plugin will try to remove that constraint. But for some reason, plugin hasn't removed the index with the same name from the database. When the index with the same name exist, plugin will again try to remove the constraint. If the constraint doesn't exist, the exception will be thrown and plugin will not be initialized properly.

    To solve this problem, could you check if your database contains that index by performing database query:

    #!
    
    SELECT * from all_indexes WHERE index_name = 'U_AO_A406ED_SCHEDUL1453239299' AND table_name = 'AO_A406ED_SCHEDULED_ISSUE';
    

    If the query will return data, please stop the JIRA and remove index from database by performing database query:

    #!
    
    DROP index U_AO_A406ED_SCHEDUL1453239299;
    

    When both constraint and index will be deleted, please start JIRA and let us know if the plugin will work properly.

    Regards

  2. Kerem Caglar [Solveka] reporter

    Hi Bartosz, I dropped the existing index. Waiting for next scheduled job run. I'll let you know Kerem

  3. Log in to comment