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

      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.

          Form Name

            [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

            David added a comment -

            This issue occurred for us on Confluence Server 6.6 to 6.7.1. Updating the JDBC connection string to the proper, case-sensitive database name worked for us.

            David added a comment - This issue occurred for us on Confluence Server 6.6 to 6.7.1. Updating the JDBC connection string to the proper, case-sensitive database name worked for us.

            Same with upgrade from 6.2.3 to 6.3.2. Workaround with capital letters from above comments helps.

            Alex Khomenko added a comment - Same with upgrade from 6.2.3 to 6.3.2. Workaround with capital letters from above comments helps.

            A fix for this issue is now available for Confluence Server customers.
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Feng Xu (Inactive) added a comment - A fix for this issue is now available for Confluence Server customers. Upgrade now or check out the Release Notes to see what other issues are resolved.

            I just upgraded from 6.0.4 to 6.2.0 and experienced the same.

            Case sensitivity mismatches between the confluence.cfg.xml file and the name of the database, which were present in this file from our initial install over 2 years ago to today, finally burned me. Maybe Atlassian added something that's more strongly verifying the DB name vs this file?

            Maybe worth adding a note to the upgrade notes about this if we can verify this is the case.

            Casey Daniell added a comment - I just upgraded from 6.0.4 to 6.2.0 and experienced the same. Case sensitivity mismatches between the confluence.cfg.xml file and the name of the database, which were present in this file from our initial install over 2 years ago to today, finally burned me. Maybe Atlassian added something that's more strongly verifying the DB name vs this file? Maybe worth adding a note to the upgrade notes about this if we can verify this is the case.

            Rik Perry added a comment -

            Upgrading from 6.0.1 to 6.1.3 and had the same issue... my SQL database had a capital letter in it, where my confluence.cfg.xml didn't.. Once I fixed this up and I restarted the service, the upgrade finished successfully.

            Rik Perry added a comment - Upgrading from 6.0.1 to 6.1.3 and had the same issue... my SQL database had a capital letter in it, where my confluence.cfg.xml didn't.. Once I fixed this up and I restarted the service, the upgrade finished successfully.

            Allan Buck added a comment -

            I had this problem, the DB was called "confDB" in MSSQL and I had "confdb" in the confluence.cfg.xml file.

            I upgraded from 6.0.1 to to 6.1.2

             

            Allan Buck added a comment - I had this problem, the DB was called "confDB" in MSSQL and I had "confdb" in the confluence.cfg.xml file. I upgraded from 6.0.1 to to 6.1.2  

            Please mention that the database info will be in the server.xml file instead of confluence.cfg.xml if you use a datasource connection. And this should be added to the known issues page for the upgrade to 6.1 notes. Would have saved me lots of time had it been there.

            Jeff Lahaie added a comment - Please mention that the database info will be in the server.xml file instead of confluence.cfg.xml if you use a datasource connection. And this should be added to the known issues page for the upgrade to 6.1 notes. Would have saved me lots of time had it been there.

              jxie Chii (Inactive)
              jrichards@atlassian.com James Richards
              Affected customers:
              3 This affects my team
              Watchers:
              17 Start watching this issue

                Created:
                Updated:
                Resolved: