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

On upgrade to Confluence 6.1, an error 'The database name component of the object qualifier must be the name of the current database' occurs

XMLWordPrintable

      This is the same issue as

      Summary

      Confluence throws a database error while trying to upgrade to 6.1.0 when using Microsoft SQL Server database:

      2017-03-29 23:28:01,077 ERROR [localhost-startStop-1] [engine.jdbc.spi.SqlExceptionHelper] logExceptions The database name component of the object qualifier must be the name of the current database.
      2017-03-29 23:28:01,105 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:239)
      	at org.hibernate.tool.schema.internal.exec.ImprovedDatabaseInformationImpl.getTableInformation(ImprovedDatabaseInformationImpl.java:110)
      	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.performMigration(SchemaMigratorImpl.java:251)
      	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: The database name component of the object qualifier must be the name of the current database.
      	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
      	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
      	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
      	at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:677)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
      	at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1032)
      	at net.sourceforge.jtds.jdbc.JtdsDatabaseMetaData.getTables(JtdsDatabaseMetaData.java:1836)
      	at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:337)
      	... 21 more
      

      Steps to Reproduce

      1. Create a Microsoft SQL Server database named Confluence.
      2. Install Confluence lower than 6.1.0.
      3. Connect Confluence to the Microsoft SQL Server database using the connection string url as confluence (instead of Confluence with an uppercase letter C).
      4. Upgrade Confluence 6.1.0

      Expected Results

      • Upgrade is successful.

      Actual Results

      • Upgrade fails with
        Caused by: java.sql.SQLException: The database name component of the object qualifier must be the name of the current database.
        

      Workaround

      1. Get the name of the Microsoft SQL Server database using the following SQL statement:
        SELECT name, database_id, create_date FROM sys.databases;
        
      2. Compare it with the database name configured inside the <confluence_home>/confluence.cfg.xml file:
        • Or in the server.xml file if you are using data source connection.
          jdbc:jtds:sqlserver://<host>:<port>/<database name>
          
      3. Update the database name so it matches the exact name of the database from the SQL statement.
      4. Restart Confluence.

              jxie Chii (Inactive)
              jrichards@atlassian.com James Richards
              Votes:
              3 Vote for this issue
              Watchers:
              17 Start watching this issue

                Created:
                Updated:
                Resolved: