-
Bug
-
Resolution: Fixed
-
High
-
6.1.0
-
50
-
Severity 2 - Major
-
184
-
This is the same issue as
- https://jira.atlassian.com/browse/BAM-18278
- https://confluence.atlassian.com/bamkb/the-component-of-the-database-name-of-the-object-qualifier-must-be-the-name-of-the-current-database-879008646.html
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
- Create a Microsoft SQL Server database named Confluence.
- Install Confluence lower than 6.1.0.
- Connect Confluence to the Microsoft SQL Server database using the connection string url as confluence (instead of Confluence with an uppercase letter C).
- 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
- Get the name of the Microsoft SQL Server database using the following SQL statement:
SELECT name, database_id, create_date FROM sys.databases;
- 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>
- Or in the server.xml file if you are using data source connection.
- Update the database name so it matches the exact name of the database from the SQL statement.
- Restart Confluence.
- is related to
-
BAM-18278 Validate database configuration on Microsoft SQL Server
- Gathering Impact
- relates to
-
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
- Gathering Impact
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...