com.atlassian.activeobjects.spi.ActiveObjectsImportExportException: There was an error during import/export with plugin Atlassian Navigation Links Plugin(com.atlassian.plugins.atlassian-nav-links-plugin) #3.3.21 (table AO_38321B_CUSTOM_CONTENT_LINK):Error executing update for SQL statement 'CREATE SEQUENCE "AO_38321B_CUSTOM_CO518521787" INCREMENT BY 1 START WITH 1 NOMAXVALUE MINVALUE 1'

Atlassian JIRA | Kamil Cichy [Atlassian] | 8 months ago
  1. 0

    In {{com.atlassian.crucible.actions.admin.database.DBEditHelper#migrateToDB}} we start Active Objects in {{changeDB()}}. This eventually causes AO writing to the DB and creating tables/sequences should these not exist (in {{net.java.ao.EntityManager#migrate}}). Then we start restoring the backup. There is a race between the DB restore and AO starting. If AO creates an {{AO_*}} sequence by the time we try to restore it from the backup, we fail with the following message: {noformat}2016-04-06 12:21:11,880 INFO [ThreadPool1 ] fisheye DefaultDBControl-stop - Shutdown in progress... 2016-04-06 12:21:11,888 INFO [ThreadPool1 ] fisheye DefaultDBControl-start - Starting database... 2016-04-06 12:21:11,924 DEBUG [ThreadPool1 ] fisheye HibernateUtil-setUp - Configuring db pools with (min/max connections): main(5,17), retriable(3,3). 2016-04-06 12:21:12,112 INFO [ThreadPool1 ] fisheye Config-setUpStatementTracking - BoneCP - tracking statements enabled for pool [mainPool] 2016-04-06 12:21:12,688 INFO [ThreadPool1 ] fisheye Config-setUpStatementTracking - BoneCP - tracking statements enabled for pool [retriablePool] 2016-04-06 12:21:13,155 INFO [ThreadPool1 ] fisheye DefaultDBControl-start - Database started. 2016-04-06 12:21:17,051 ERROR [ThreadPool1 ] fisheye DBEditHelper-migrateToDB - Database migration failed com.atlassian.activeobjects.spi.ActiveObjectsImportExportException: There was an error during import/export with plugin Atlassian Navigation Links Plugin(com.atlassian.plugins.atlassian-nav-links-plugin) #3.3.21 (table AO_38321B_CUSTOM_CONTENT_LINK):Error executing update for SQL statement 'CREATE SEQUENCE "AO_38321B_CUSTOM_CO518521787" INCREMENT BY 1 START WITH 1 NOMAXVALUE MINVALUE 1' at com.atlassian.activeobjects.backup.ImportExportErrorServiceImpl.newImportExportSqlException(ImportExportErrorServiceImpl.java:26) [?:?] at com.atlassian.activeobjects.backup.SqlUtils.onSqlException(SqlUtils.java:46) [?:?] at com.atlassian.activeobjects.backup.SqlUtils.executeUpdate(SqlUtils.java:37) [?:?] at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.create(ActiveObjectsTableCreator.java:73) [?:?] at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.create(ActiveObjectsTableCreator.java:57) [?:?] at com.atlassian.dbexporter.importer.TableDefinitionImporter.doImportNode(TableDefinitionImporter.java:50) [?:?] at com.atlassian.dbexporter.importer.AbstractImporter.importNode(AbstractImporter.java:44) [?:?] at com.atlassian.dbexporter.DbImporter.importData(DbImporter.java:69) [?:?] at com.atlassian.activeobjects.backup.ActiveObjectsBackup.restore(ActiveObjectsBackup.java:151) [?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.8.0_60] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [?:1.8.0_60] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) [?:1.8.0_60] at com.atlassian.applinks.host.OsgiServiceProxyFactory$DynamicServiceInvocationHandler.invoke(OsgiServiceProxyFactory.java:110) [applinks-host-5.1.0.jar:?] at com.sun.proxy.$Proxy137.restore(Unknown Source) [?:?] at com.atlassian.crucible.actions.admin.database.DBEditHelper.migrateToDB(DBEditHelper.java:339) [fisheye.jar:?] at com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$AsynchronousMigrater.migrateToDB(MigrateDatabaseAction.java:83) [fisheye.jar:?] at com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$1$1.perform(MigrateDatabaseAction.java:141) [fisheye.jar:?] at com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$1$1.perform(MigrateDatabaseAction.java:139) [fisheye.jar:?] at com.atlassian.crucible.maintenance.MaintenanceManager.doMaintenance(MaintenanceManager.java:111) [fisheye.jar:?] at com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$1.run(MigrateDatabaseAction.java:139) [fisheye.jar:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_60] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_60] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_60] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_60] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_60] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_60] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60] Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:30) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:931) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1707) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1670) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:310) [ojdbc7-12cR1.jar:12.1.0.2.0] at com.jolbox.bonecp.StatementHandle.executeUpdate(StatementHandle.java:536) [bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE] at sun.reflect.GeneratedMethodAccessor437.invoke(Unknown Source) [?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) [?:1.8.0_60] at com.cenqua.crucible.hibernate.trackingstatements.TrackingStatementFactory$1.handleInvocation(TrackingStatementFactory.java:25) [fisheye.jar:?] at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87) [guava-18.0.jar:?] at com.sun.proxy.$Proxy901.executeUpdate(Unknown Source) [?:?] at com.atlassian.activeobjects.backup.SqlUtils.executeUpdate(SqlUtils.java:34) [?:?] ... 25 more {noformat} This is potentially only related to the Oracle DB, where sequences are created immediately with tables. Threads taking part in the race are {{ThreadPool1}} and {{active-objects-init-compatibility-tenant-0}}. *This affects not only migration, but also restore from a backup file.* h1. Workaround If this occurs, the non ActiveObjects data is migrated already, and FishEye is already switched to using the DB. The user can manually finish the migration, by stopping the instance, and copying over the AO_* tables if needed.

    Atlassian JIRA | 8 months ago | Kamil Cichy [Atlassian]
    com.atlassian.activeobjects.spi.ActiveObjectsImportExportException: There was an error during import/export with plugin Atlassian Navigation Links Plugin(com.atlassian.plugins.atlassian-nav-links-plugin) #3.3.21 (table AO_38321B_CUSTOM_CONTENT_LINK):Error executing update for SQL statement 'CREATE SEQUENCE "AO_38321B_CUSTOM_CO518521787" INCREMENT BY 1 START WITH 1 NOMAXVALUE MINVALUE 1'
  2. 0

    In {{com.atlassian.crucible.actions.admin.database.DBEditHelper#migrateToDB}} we start Active Objects in {{changeDB()}}. This eventually causes AO writing to the DB and creating tables/sequences should these not exist (in {{net.java.ao.EntityManager#migrate}}). Then we start restoring the backup. There is a race between the DB restore and AO starting. If AO creates an {{AO_*}} sequence by the time we try to restore it from the backup, we fail with the following message: {noformat}2016-04-06 12:21:11,880 INFO [ThreadPool1 ] fisheye DefaultDBControl-stop - Shutdown in progress... 2016-04-06 12:21:11,888 INFO [ThreadPool1 ] fisheye DefaultDBControl-start - Starting database... 2016-04-06 12:21:11,924 DEBUG [ThreadPool1 ] fisheye HibernateUtil-setUp - Configuring db pools with (min/max connections): main(5,17), retriable(3,3). 2016-04-06 12:21:12,112 INFO [ThreadPool1 ] fisheye Config-setUpStatementTracking - BoneCP - tracking statements enabled for pool [mainPool] 2016-04-06 12:21:12,688 INFO [ThreadPool1 ] fisheye Config-setUpStatementTracking - BoneCP - tracking statements enabled for pool [retriablePool] 2016-04-06 12:21:13,155 INFO [ThreadPool1 ] fisheye DefaultDBControl-start - Database started. 2016-04-06 12:21:17,051 ERROR [ThreadPool1 ] fisheye DBEditHelper-migrateToDB - Database migration failed com.atlassian.activeobjects.spi.ActiveObjectsImportExportException: There was an error during import/export with plugin Atlassian Navigation Links Plugin(com.atlassian.plugins.atlassian-nav-links-plugin) #3.3.21 (table AO_38321B_CUSTOM_CONTENT_LINK):Error executing update for SQL statement 'CREATE SEQUENCE "AO_38321B_CUSTOM_CO518521787" INCREMENT BY 1 START WITH 1 NOMAXVALUE MINVALUE 1' at com.atlassian.activeobjects.backup.ImportExportErrorServiceImpl.newImportExportSqlException(ImportExportErrorServiceImpl.java:26) [?:?] at com.atlassian.activeobjects.backup.SqlUtils.onSqlException(SqlUtils.java:46) [?:?] at com.atlassian.activeobjects.backup.SqlUtils.executeUpdate(SqlUtils.java:37) [?:?] at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.create(ActiveObjectsTableCreator.java:73) [?:?] at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.create(ActiveObjectsTableCreator.java:57) [?:?] at com.atlassian.dbexporter.importer.TableDefinitionImporter.doImportNode(TableDefinitionImporter.java:50) [?:?] at com.atlassian.dbexporter.importer.AbstractImporter.importNode(AbstractImporter.java:44) [?:?] at com.atlassian.dbexporter.DbImporter.importData(DbImporter.java:69) [?:?] at com.atlassian.activeobjects.backup.ActiveObjectsBackup.restore(ActiveObjectsBackup.java:151) [?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.8.0_60] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [?:1.8.0_60] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) [?:1.8.0_60] at com.atlassian.applinks.host.OsgiServiceProxyFactory$DynamicServiceInvocationHandler.invoke(OsgiServiceProxyFactory.java:110) [applinks-host-5.1.0.jar:?] at com.sun.proxy.$Proxy137.restore(Unknown Source) [?:?] at com.atlassian.crucible.actions.admin.database.DBEditHelper.migrateToDB(DBEditHelper.java:339) [fisheye.jar:?] at com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$AsynchronousMigrater.migrateToDB(MigrateDatabaseAction.java:83) [fisheye.jar:?] at com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$1$1.perform(MigrateDatabaseAction.java:141) [fisheye.jar:?] at com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$1$1.perform(MigrateDatabaseAction.java:139) [fisheye.jar:?] at com.atlassian.crucible.maintenance.MaintenanceManager.doMaintenance(MaintenanceManager.java:111) [fisheye.jar:?] at com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$1.run(MigrateDatabaseAction.java:139) [fisheye.jar:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_60] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_60] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_60] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_60] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_60] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_60] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60] Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:30) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:931) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1707) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1670) [ojdbc7-12cR1.jar:12.1.0.2.0] at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:310) [ojdbc7-12cR1.jar:12.1.0.2.0] at com.jolbox.bonecp.StatementHandle.executeUpdate(StatementHandle.java:536) [bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE] at sun.reflect.GeneratedMethodAccessor437.invoke(Unknown Source) [?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) [?:1.8.0_60] at com.cenqua.crucible.hibernate.trackingstatements.TrackingStatementFactory$1.handleInvocation(TrackingStatementFactory.java:25) [fisheye.jar:?] at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87) [guava-18.0.jar:?] at com.sun.proxy.$Proxy901.executeUpdate(Unknown Source) [?:?] at com.atlassian.activeobjects.backup.SqlUtils.executeUpdate(SqlUtils.java:34) [?:?] ... 25 more {noformat} This is potentially only related to the Oracle DB, where sequences are created immediately with tables. Threads taking part in the race are {{ThreadPool1}} and {{active-objects-init-compatibility-tenant-0}}. *This affects not only migration, but also restore from a backup file.* h1. Workaround If this occurs, the non ActiveObjects data is migrated already, and FishEye is already switched to using the DB. The user can manually finish the migration, by stopping the instance, and copying over the AO_* tables if needed.

    Atlassian JIRA | 8 months ago | Kamil Cichy [Atlassian]
    com.atlassian.activeobjects.spi.ActiveObjectsImportExportException: There was an error during import/export with plugin Atlassian Navigation Links Plugin(com.atlassian.plugins.atlassian-nav-links-plugin) #3.3.21 (table AO_38321B_CUSTOM_CONTENT_LINK):Error executing update for SQL statement 'CREATE SEQUENCE "AO_38321B_CUSTOM_CO518521787" INCREMENT BY 1 START WITH 1 NOMAXVALUE MINVALUE 1'
  3. 0

    executeUpdate throws error when writing to openfire db

    Stack Overflow | 3 years ago | Mercenary
    java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SQL Query Error in Java

    Stack Overflow | 1 year ago | CAFC_Sam
    java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
  6. 0

    h3. Steps to replicate: # Set-up Confluence 5.9.1 # Upgrade to Confluence 5.9.2, the following error will show-up (Oracle example): {code} 2015-12-08 17:14:57,332 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute Unsuccessful: alter table USER_RELATION add constraint u2u_relation_unique unique (SOURCEUSER, TARGETUSER, RELATIONNAME) 2015-12-08 17:14:57,333 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute ORA-02261: such unique or primary key already exists in the table 2015-12-08 17:14:57,335 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute could not complete schema update java.sql.SQLSyntaxErrorException: ORA-02261: such unique or primary key already exists in the table at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:30) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:931) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150) at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1707) at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1670) at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:310) at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:410) at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:167) at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:206) at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:181) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:160) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:136) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:86) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:586) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1777) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 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:745) {code} Embedded H2 database example: {code} 2015-12-09 15:01:54,821 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute Unsuccessful: alter table USER_RELATION add constraint u2u_relation_unique unique (SOURCEUSER, TARGETUSER, RELATIONNAME) 2015-12-09 15:01:54,822 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute a UNIQUE constraint already exists on the set of columns in statement [alter table USER_RELATION add constraint u2u_relation_unique unique (SOURCEUSER, TARGETUSER, RELATIONNAME)] 2015-12-09 15:01:54,822 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute could not complete schema update java.sql.SQLSyntaxErrorException: a UNIQUE constraint already exists on the set of columns in statement [alter table USER_RELATION add constraint u2u_relation_unique unique (SOURCEUSER, TARGETUSER, RELATIONNAME)] at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.executeUpdate(Unknown Source) at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:410) at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:167) at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:206) at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:181) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:160) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:136) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:86) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4738) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5181) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 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:745) 2015-12-09 15:01:54,836 ERROR [localhost-startStop-1] [atlassian.confluence.plugin.PluginFrameworkContextListener] launchUpgrades Upgrade failed, application will not start: com.atlassian.config.ConfigurationException: Cannot update schema com.atlassian.confluence.upgrade.UpgradeException: com.atlassian.config.ConfigurationException: Cannot update schema at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:180) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:136) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:86) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4738) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5181) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 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:745) Caused by: com.atlassian.config.ConfigurationException: Cannot update schema at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:210) at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:181) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:160) ... 11 more Caused by: java.sql.SQLSyntaxErrorException: a UNIQUE constraint already exists on the set of columns in statement [alter table USER_RELATION add constraint u2u_relation_unique unique (SOURCEUSER, TARGETUSER, RELATIONNAME)] at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.executeUpdate(Unknown Source) at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:410) at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:167) at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:206) ... 13 more {code} h3. Workaround # Stop Confluence # Drop the {{u2u_relation_unique}} constraint from the USER_RELATION table. # Start Confluence and let the upgrade run again.

    Atlassian JIRA | 12 months ago | William Zanchet [Atlassian]
    java.sql.SQLSyntaxErrorException: ORA-02261: such unique or primary key already exists in the table

    1 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. java.sql.SQLSyntaxErrorException

      ORA-00955: name is already used by an existing object

      at oracle.jdbc.driver.T4CTTIoer.processError()
    2. Oracle jdbc
      OracleStatementWrapper.executeUpdate
      1. oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)[ojdbc7-12cR1.jar:12.1.0.2.0]
      2. oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)[ojdbc7-12cR1.jar:12.1.0.2.0]
      3. oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059)[ojdbc7-12cR1.jar:12.1.0.2.0]
      4. oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)[ojdbc7-12cR1.jar:12.1.0.2.0]
      5. oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)[ojdbc7-12cR1.jar:12.1.0.2.0]
      6. oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587)[ojdbc7-12cR1.jar:12.1.0.2.0]
      7. oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)[ojdbc7-12cR1.jar:12.1.0.2.0]
      8. oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:30)[ojdbc7-12cR1.jar:12.1.0.2.0]
      9. oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:931)[ojdbc7-12cR1.jar:12.1.0.2.0]
      10. oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150)[ojdbc7-12cR1.jar:12.1.0.2.0]
      11. oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1707)[ojdbc7-12cR1.jar:12.1.0.2.0]
      12. oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1670)[ojdbc7-12cR1.jar:12.1.0.2.0]
      13. oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:310)[ojdbc7-12cR1.jar:12.1.0.2.0]
      13 frames
    3. BoneCP :: Core Library
      StatementHandle.executeUpdate
      1. com.jolbox.bonecp.StatementHandle.executeUpdate(StatementHandle.java:536)[bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE]
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor437.invoke(Unknown Source)[?:?]
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[?:1.8.0_60]
      3. java.lang.reflect.Method.invoke(Method.java:497)[?:1.8.0_60]
      3 frames
    5. com.cenqua.crucible
      TrackingStatementFactory$1.handleInvocation
      1. com.cenqua.crucible.hibernate.trackingstatements.TrackingStatementFactory$1.handleInvocation(TrackingStatementFactory.java:25)[fisheye.jar:?]
      1 frame
    6. Guava
      AbstractInvocationHandler.invoke
      1. com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)[guava-18.0.jar:?]
      1 frame
    7. com.sun.proxy
      $Proxy901.executeUpdate
      1. com.sun.proxy.$Proxy901.executeUpdate(Unknown Source)[?:?]
      1 frame
    8. com.atlassian.activeobjects
      ActiveObjectsTableCreator.create
      1. com.atlassian.activeobjects.backup.SqlUtils.executeUpdate(SqlUtils.java:34)[?:?]
      2. com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.create(ActiveObjectsTableCreator.java:73)[?:?]
      3. com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.create(ActiveObjectsTableCreator.java:57)[?:?]
      3 frames
    9. com.atlassian.dbexporter
      DbImporter.importData
      1. com.atlassian.dbexporter.importer.TableDefinitionImporter.doImportNode(TableDefinitionImporter.java:50)[?:?]
      2. com.atlassian.dbexporter.importer.AbstractImporter.importNode(AbstractImporter.java:44)[?:?]
      3. com.atlassian.dbexporter.DbImporter.importData(DbImporter.java:69)[?:?]
      3 frames
    10. com.atlassian.activeobjects
      ActiveObjectsBackup.restore
      1. com.atlassian.activeobjects.backup.ActiveObjectsBackup.restore(ActiveObjectsBackup.java:151)[?:?]
      1 frame
    11. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[?:1.8.0_60]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[?:1.8.0_60]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[?:1.8.0_60]
      4. java.lang.reflect.Method.invoke(Method.java:497)[?:1.8.0_60]
      4 frames
    12. com.atlassian.applinks
      OsgiServiceProxyFactory$DynamicServiceInvocationHandler.invoke
      1. com.atlassian.applinks.host.OsgiServiceProxyFactory$DynamicServiceInvocationHandler.invoke(OsgiServiceProxyFactory.java:110)[applinks-host-5.1.0.jar:?]
      1 frame
    13. com.sun.proxy
      $Proxy137.restore
      1. com.sun.proxy.$Proxy137.restore(Unknown Source)[?:?]
      1 frame
    14. com.atlassian.crucible
      MigrateDatabaseAction$1.run
      1. com.atlassian.crucible.actions.admin.database.DBEditHelper.migrateToDB(DBEditHelper.java:339)[fisheye.jar:?]
      2. com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$AsynchronousMigrater.migrateToDB(MigrateDatabaseAction.java:83)[fisheye.jar:?]
      3. com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$1$1.perform(MigrateDatabaseAction.java:141)[fisheye.jar:?]
      4. com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$1$1.perform(MigrateDatabaseAction.java:139)[fisheye.jar:?]
      5. com.atlassian.crucible.maintenance.MaintenanceManager.doMaintenance(MaintenanceManager.java:111)[fisheye.jar:?]
      6. com.atlassian.crucible.actions.admin.database.MigrateDatabaseAction$1.run(MigrateDatabaseAction.java:139)[fisheye.jar:?]
      6 frames
    15. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[?:1.8.0_60]
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)[?:1.8.0_60]
      3. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[?:1.8.0_60]
      4. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[?:1.8.0_60]
      5. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[?:1.8.0_60]
      6. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[?:1.8.0_60]
      7. java.lang.Thread.run(Thread.java:745)[?:1.8.0_60]
      7 frames