Confluence won't start after upgrading to from 6.4 to 6.5
Asked by Jim Tanner:

Server 2012R2. SQL 2014. Update to 6.5 appeared to flow and gave no errors. However when trying to open Confluence I get;

Errors

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Pre-upgrade validation failed. Check the Confluence application logs for more details. You'll need to fix these problems and restart Confluence before you can upgrade. Upgrade error message: Cannot update schema |


Answers:
author: MoroSystems Support
body: Hi Jim

In order to better find the problem, we would need a whole error message from the log. Perhaps [this is the problem](https://confluence.atlassian.com/confkb/upgrade-failed-application-will-not-start-due-to-cannot-update-schema-300813762.html) or [Confluence Upgrade Fails because Oracle could not Complete Schema Update](https://confluence.atlassian.com/kb/confluence-upgrade-fails-because-oracle-could-not-complete-schema-update-838275652.html).

Best Regards

Pavel

MoroSystems Support

comments: author: Jim Tanner
body: Hi Pavel,

What logs are required? I have done a quick search in logs modified today and nothing jumps out. Can they just be copy and pasted here?


author: MoroSystems Support
body: Hi Jim,

The error should be recorded at the end of the file \<\<Confluence Home folder\>\> */log/atlassian-confluence.log*

I'm looking for something like:

    2016-08-05 11:29:18,381 ERROR [localhost-startStop-1] [atlassian.confluence.plugin.PluginFrameworkContextListener] launchUpgrades 1 errors were encountered during upgrade:2016-08-05 11:29:18,381 ERROR [localhost-startStop-1] [atlassian.confluence.plugin.PluginFrameworkContextListener] launchUpgrades 1: Cannot update schema

Yes, they can be inserted here, but only as a code (use text formatting).

Thanks


author: Jim Tanner
body: Hi,

Those two errors are in the log file exactly as ayou have described them.

```
2017-11-14 17:24:38,891 ERROR [localhost-startStop-1] [atlassian.confluence.plugin.PluginFrameworkContextListener] launchUpgrades 1 errors were encountered during upgrade:
2017-11-14 17:24:38,892 ERROR [localhost-startStop-1] [atlassian.confluence.plugin.PluginFrameworkContextListener] launchUpgrades 1: Cannot update schema
```

Thanks for you help with this.


author: MoroSystems Support
body: OK,

this looks exactly like the problem described here - [Confluence Upgrade Fails because Oracle could not Complete Schema Update](https://confluence.atlassian.com/kb/confluence-upgrade-fails-because-oracle-could-not-complete-schema-update-838275652.html?_ga=2.253013514.208007614.1510493717-1872825338.1503896572)

Please look at the attached link, here is a bug diagnosis and a way to solve it.

Please check whether your environment is still relevant [Confluence Supported platforms](https://confluence.atlassian.com/doc/supported-platforms-207488198.html)

Thanks

Pavel


author: Jim Tanner
body: Hi Pavel,

I am using MS SQL 2014.

Larger sample of the log

```
2017-11-14 17:32:59,896 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-11-14 17:32:59,908 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:135)
?? ?at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:119)
?? ?at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:78)
?? ?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:1149)
?? ?at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
?? ?at java.lang.Thread.run(Thread.java:748)
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:120)
?? ?... 11 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 bucket.core.persistence.hibernate.schema.SchemaHelper.validateSchemaUpdateIfNeeded(SchemaHelper.java:171)
?? ?... 12 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)
?? ?... 21 more
```


author: MoroSystems Support
body: Hi Jim,

Thank you for delivering the entire error message - it helps me to fix the problem. Based on this error:

```
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The database name component of the object qualifier must be the name of the current database.
```

And the information that you use MS SQL 2014 I think your problem is described in [https://confluence.atlassian.com/confkb/the-component-of-the-database-name-of-the-object-qualifier-must-be-the-name-of-the-current-database-error-on-upgrade-to-confluence-6-1-902076143.html](https://confluence.atlassian.com/confkb/the-component-of-the-database-name-of-the-object-qualifier-must-be-the-name-of-the-current-database-error-on-upgrade-to-confluence-6-1-902076143.html "The component of the database name of the object qualifier must be the name of the current database error on upgrade")

Please try the above procedure.

Please let me know.

Pavel


author: Jim Tanner
body: Hi Pavel,

That was the issue. Corrected the name in the xml and all works again.

Once again, thanks for helping with this. Very much appreciated.

Jim