Confluence will not start up because the build number in the home directory [8801] doesn't match the
Asked by Leena Bakshi:

We just now upgraded our confluence from 7.12.5 to 7.18.7 to address the latest security vulnerability. Upon starting confluence getting this error:

Confluence will not start up because the build number in the home directory \[8801\] doesn't match the build number in the database \[8703\]

Since the build number of home directory is higher than the build number in database, I found below article and thinking if it would be Resolution 3 that needs to be applied to correct the problem:

<https://confluence.atlassian.com/confkb/confluence-will-not-start-up-because-the-build-number-in-the-home-directory-doesn-t-match-the-build-number-in-the-database-after-upgrade-376834096.html>

Thanks


Answers:
author: Nic Brough -Adaptavist-
body: Yes, this happens when you just point a different Confluence installation at a database from another version.

You should upgrade your Confluence, not point a new install at an old database.

comments: author: Leena Bakshi
body: I am getting this error post upgrade. We cloned our prod and marked it as dev so that I could upgrade the dev environment first .. and now I tried second time to upgrade from 7.12.5 to 7.14.3 instead of 7.18.1 and it is still the same error upon launching the confluence once upgrade finished . I verified the supported platform article and our configuration is supported.

Confluence will not start up because the build number in the home directory \[8801\] doesn't match the build number in the database \[8703\].


author: Nic Brough -Adaptavist-
body: So, again, this happens when you point a new version of Confluence at an older database, rather than running an upgrade. This can be a valid way to upgrade, but it only works for versions that are closely compatible.

Could you try upgrading your 7.12 to 7.18 by running the upgrade process instead of creating a new 7.18 install and pointing it to your old database?


author: Leena Bakshi
body: I believe I am not able to make my scenario clear.

I am doing an in place upgrade from7.12.5 to 7.18.1 and as soon as upgrade finishes I get the build number mismatch.

I ll update this thread once I hear back from atlassian support with a resolution. Thanks for your prompt reply.


author: Nic Brough -Adaptavist-
body: Ok, so you're trying to run an upgrade. What errors do you see when you run it? It's obviously failing, so the question is actually where it is going wrong.

Bear in mind that if it fails after upgrading the database, it will have upgraded the database, so the old version will not work any more. You can't just re-do the upgrade, you must restore the old database.


author: Leena Bakshi
body: Yes Nic the upgrade and now it failed again :

```
ERROR [Catalina-utility-1] [atlassian.confluence.plugin.PluginFrameworkContextListener] launchUpgrades Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.MigrateTrashDateUpgradeTask@21501942 failed during the UPGRADE phase due to: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.MigrateTrashDateUpgradeTask@21501942 failed during the UPGRADE phase due to: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:270)
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runUpgradeTasks(AbstractUpgradeManager.java:235)
at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.runUpgradeTasks(DefaultUpgradeManager.java:316)
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:168)
at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:122)
at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:82)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:195)
at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:374)
at org.springframework.orm.hibernate5.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:334)
at org.springframework.orm.hibernate5.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:958)
at org.springframework.orm.hibernate5.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:946)
at com.atlassian.confluence.core.persistence.hibernate.HibernateVersionHistoryDao.getVersionHistory(HibernateVersionHistoryDao.java:56)
at com.atlassian.confluence.core.persistence.hibernate.HibernateVersionHistoryDao.addBuildToHistory(HibernateVersionHistoryDao.java:133)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at com.sun.proxy.$Proxy97.addBuildToHistory(Unknown Source)
at com.atlassian.confluence.core.persistence.hibernate.CachingVersionHistoryDao.addBuildToHistory(CachingVersionHistoryDao.java:50)
at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.setDatabaseBuildNumber(DefaultUpgradeManager.java:151)
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeTask(AbstractUpgradeManager.java:287)
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:264)
... 16 more
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
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.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:69)
at org.hibernate.loader.Loader.getResultSet(Loader.java:2168)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1931)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1893)
at org.hibernate.loader.Loader.doQuery(Loader.java:938)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
at org.hibernate.loader.Loader.doList(Loader.java:2692)
at org.hibernate.loader.Loader.doList(Loader.java:2675)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2507)
at org.hibernate.loader.Loader.list(Loader.java:2502)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:502)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:392)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1490)
at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1445)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1414)
at org.springframework.orm.hibernate5.HibernateTemplate.lambda$findByNamedQueryAndNamedParam$34(HibernateTemplate.java:966)
at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:367)
... 40 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'FINALIZED'.
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.executeQuery(SQLServerPreparedStatement.java:383)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:1471)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60)
... 57 more
```


author: Leena Bakshi
body: Please note that since our database is on SQL 2016 SP3.

I am now trying to upgrade from 7.12.5 to 7.14.3 as MSSQL 2016 is the supported database for 7.14.3 and I am still getting above error.


author: Nic Brough -Adaptavist-
body: It looks like your previous attempt to upgrade has broken your database.

You'll need to restore it from a backup and re-do the upgrades.


author: Leena Bakshi
body: Yes I am in the process of doing that and also my database has hyphen in its name so removed that and now its still going on.. hopefully this time it will go through

Was hitting below bug :

<https://jira.atlassian.com/browse/CONFSERVER-65134>

Thanks


Tags: confluence-server

server