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

Upgrading to Confluence 6.15.x using Microsoft SQL Server fails with the 'The database name component of the object qualifier must be the name of the current database' error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 6.13.0
    • None

      Summary

      • Confluence throws a database error while trying to upgrade to 6.15.x when using Microsoft SQL Server database:
        2019-05-08 09:30:36,696 ERROR [Catalina-utility-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:135)
        	at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:119)
        	at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:79)
        	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4682)
        	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5150)
        	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377)
        	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        	at java.lang.Thread.run(Thread.java:748)
        Caused by: com.atlassian.config.ConfigurationException: Cannot update schema
        	at com.atlassian.confluence.impl.core.persistence.hibernate.schema.ConfluenceSchemaHelper.validateSchemaUpdateIfNeeded(ConfluenceSchemaHelper.java:117)
        	at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.validateSchemaUpdateIfNeeded(DefaultUpgradeManager.java:73)
        	at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:120)
        	... 14 more
        Caused by: org.hibernate.exception.SQLGrammarException: Error accessing table metadata
        	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106)
        	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
        	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:98)
        	at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:463)
        	at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTable(InformationExtractorJdbcDatabaseMetaDataImpl.java:228)
        	at org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.getTableInformation(DatabaseInformationImpl.java:111)
        	at org.hibernate.tool.schema.internal.IndividuallySchemaMigratorImpl.performTablesMigration(IndividuallySchemaMigratorImpl.java:69)
        	at com.atlassian.confluence.impl.hibernate.ConfluenceHibernateSchemaManagementTool$3.performTablesMigration(ConfluenceHibernateSchemaManagementTool.java:110)
        	at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:203)
        	at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:110)
        	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:87)
        	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:58)
        	at com.atlassian.confluence.impl.core.persistence.hibernate.schema.ConfluenceSchemaHelper.validateSchemaUpdateIfNeeded(ConfluenceSchemaHelper.java:114)
        	... 16 more
        Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The database name component of the object qualifier must be the name of the current database.
        	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:260)
        	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1547)
        	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:528)
        	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:461)
        	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7342)
        	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2688)
        	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:224)
        	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:204)
        	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQueryInternal(SQLServerPreparedStatement.java:396)
        	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetFromStoredProc(SQLServerDatabaseMetaData.java:301)
        	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetWithProvidedColumnNames(SQLServerDatabaseMetaData.java:316)
        	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getTables(SQLServerDatabaseMetaData.java:481)
        	at com.mchange.v2.c3p0.impl.NewProxyDatabaseMetaData.getTables(NewProxyDatabaseMetaData.java:2962)
        	at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.locateTableInNamespace(InformationExtractorJdbcDatabaseMetaDataImpl.java:448)
        	... 25 more
        

      Steps to Reproduce

      1. Create a database in Microsoft SQL Server with the Confluence name
      2. Install Confluence 6.13
      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.13 to 6.15.x

      Expected Results

      • Confluence updates successfully

      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 your database by running the following query:
        SELECT name, database_id, create_date FROM sys.databases;  
        
      2. Compare it with the name of the database located in your <confluence_home>/confluence.cfg.xml file
      3. Update the database name so it matches the exact name of the database from the SQL statement.
      4. Restart Confluence

              Unassigned Unassigned
              rbueno Renata Bueno
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: