Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-52353

Upgrade Confluence to version 6.1.x Failed with "ORA-01000: maximum open cursors exceeded" Error

    XMLWordPrintable

Details

    Description

      Summary

      Upgrade Confluence (connected to Oracle 12c) to version 6.1.x failed with the following error in the logs (atlassian-confluence.log) :

      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:133)
      	at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:118)
      	at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:77)
      	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      	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.validateSchemaUpdateIfNeeded(SchemaHelper.java:174)
      	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:119)
      	... 11 more
      Caused by: org.hibernate.exception.GenericJDBCException: Error accessing table metadata
      	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
      	at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.convertSQLException(InformationExtractorJdbcDatabaseMetaDataImpl.java:97)
      	at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:352)
      	at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTable(InformationExtractorJdbcDatabaseMetaDataImpl.java:226)
      	at org.hibernate.tool.schema.internal.exec.ImprovedDatabaseInformationImpl.getTableInformation(ImprovedDatabaseInformationImpl.java:110)
      	at org.hibernate.tool.schema.internal.exec.ImprovedDatabaseInformationImpl.locateTableInformation(ImprovedDatabaseInformationImpl.java:142)
      	at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getForeignKeys(InformationExtractorJdbcDatabaseMetaDataImpl.java:655)
      	at org.hibernate.tool.schema.extract.internal.TableInformationImpl.foreignKeys(TableInformationImpl.java:88)
      	at org.hibernate.tool.schema.extract.internal.TableInformationImpl.getForeignKey(TableInformationImpl.java:99)
      	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.findMatchingForeignKey(SchemaMigratorImpl.java:529)
      	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applyForeignKeys(SchemaMigratorImpl.java:505)
      	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.performMigration(SchemaMigratorImpl.java:314)
      	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:136)
      	at com.atlassian.confluence.impl.hibernate.ConfluenceHibernateSchemaManagementTool$3.doMigration(ConfluenceHibernateSchemaManagementTool.java:105)
      	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:109)
      	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:87)
      	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:58)
      	at bucket.core.persistence.hibernate.schema.SchemaHelper.validateSchemaUpdateIfNeeded(SchemaHelper.java:171)
      	... 12 more
      Caused by: java.sql.SQLException: ORA-01000: maximum open cursors exceeded
      
      	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)
      
      Analysis

      Running the following query in the database found out that Confluence is taking up ~600 open cursors :

      select a.value, s.username, s.sid, s.serial#
      from v$sesstat a, v$statname b, v$session s
      where a.statistic# = b.statistic#  and s.sid=a.sid
      and b.name = 'opened cursors current'
      and USERNAME='<INSERT-USERNAME-HERE>'
      
      Cause

      This is a known bug with Oracle JDBC driver version 12.1.0.2, which leaks database cursors. See this Oracle Community forum post for more information: https://community.oracle.com/thread/3682300.

      Workarounds

      See this KnowledgeBase article for detailed instructions.

      There are two known workarounds for this issue:

      1. Update the Oracle JDBC Driver to the latest version (12.2.0.1)
      There is a new version of the Oracle JDBC driver which fixes the cursor leak. Updating your driver prior to upgrading Confluence to 6.1.x will prevent this issue.
      To update the driver:

      1. Stop Confluence, and create a backup of the installation and home directory.
      2. Download version 12.2.0.1 (or later) of the driver from the Oracle JDBC Driver page.
      3. Replace the existing ojdbc7.jar in <Confluence installation>/confluence/WEB-INF/lib with the new driver. For detailed instructions, follow step 6 in the database setup for oracle page.
      4. Start Confluence.
      5. Re-attempt upgrade.

      2. Increase Maximum Open Cursors
      Increase the maximum open cursor in the database :

      ALTER SYSTEM SET open_cursors = 1000 SCOPE=BOTH;

      The query above is obtained from Side Bar Is Not Visible Due To Not Sufficient Open Cursors In Oracle. You may change the value of '1000' as required.

      Attachments

        Issue Links

          Activity

            People

              jxie Chii
              jwaihou Jonathan Soo
              Votes:
              4 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: