No longer runs 'atlassian-confluence-5.10.8' on localhost:809 using macOS 11.5.1
Asked by Roger Lee:

Have been running for many years a local version of Atlassian Confluence 5.10.8 using on localhost:8091 using:

    macOS (Big Sur 11.5.1)

with:

    java version "1.8.0_202-ea"

After rebooting (11.08.21) macOS I can no longer run Atlassian Confluence.

Was planning to migrate to the cloud version but now stuck!

Errors:

    HTTP Status 500 - Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.GenericJDBCException: Cannot open connection

> type Exception report
>
> message Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.GenericJDBCException: Cannot open connection
>
> description The server encountered an internal error that prevented it from fulfilling this request.
>
> exception
>
> org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.GenericJDBCException: Cannot open connection org.springframework.orm.hibernate.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:473) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) com.sun.proxy.$Proxy32.getTransaction(Unknown Source) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:427) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) com.sun.proxy.$Proxy130.findById(Unknown Source) com.atlassian.seraph.service.rememberme.DefaultRememberMeService.getRememberMeCookieAuthenticatedUsername(DefaultRememberMeService.java:49) com.atlassian.seraph.auth.DefaultAuthenticator.getUserFromCookie(DefaultAuthenticator.java:430) com.atlassian.seraph.auth.DefaultAuthenticator.getUser(DefaultAuthenticator.java:330) com.atlassian.confluence.user.ConfluenceAuthenticator.getUser(ConfluenceAuthenticator.java:122) com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:138) com.atlassian.confluence.web.filter.ConfluenceSecurityFilter.doFilter(ConfluenceSecurityFilter.java:25) com.atlassian.confluence.web.filter.ThreadLocalCacheFilter.doFilter(ThreadLocalCacheFilter.java:25) com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:103) com.atlassian.confluence.util.AbstractBootstrapHotSwappingFilter.doFilter(AbstractBootstrapHotSwappingFilter.java:32) com.atlassian.confluence.util.AbstractBootstrapHotSwappingFilter$SwapOnBootstrapFilter.doFilter(AbstractBootstrapHotSwappingFilter.java:53) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.confluence.util.AbstractBootstrapHotSwappingFilter.doFilter(AbstractBootstrapHotSwappingFilter.java:32) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:148) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:39) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:70) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:58) com.atlassian.confluence.util.ClusterHeaderFilter.doFilter(ClusterHeaderFilter.java:56) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.core.filters.cache.AbstractCachingFilter.doFilter(AbstractCachingFilter.java:33) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:39) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:31) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) com.atlassian.confluence.web.filter.HttpRequestStatsFilter.doFilter(HttpRequestStatsFilter.java:47) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) com.atlassian.gzipfilter.GzipFilter.doFilterInternal(GzipFilter.java:121) com.atlassian.gzipfilter.GzipFilter.doFilter(GzipFilter.java:92) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) com.atlassian.confluence.web.filter.ConfluenceTimingFilter.doFilter(ConfluenceTimingFilter.java:46) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:61) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) com.atlassian.confluence.extra.webdav.servlet.filter.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:467) com.atlassian.confluence.extra.webdav.servlet.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:34) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:70) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:58) com.atlassian.confluence.internal.web.filter.spring.IgnoreWebAsyncManagerFilter.doFilter(IgnoreWebAsyncManagerFilter.java:59) com.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter.doFilter(RequestParamValidationFilter.java:51) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.confluence.web.filter.TranslationModeFilter.doFilter(TranslationModeFilter.java:39) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.confluence.plugin.servlet.filter.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:72) com.atlassian.confluence.web.filter.LanguageExtractionFilter.doFilter(LanguageExtractionFilter.java:45) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.confluence.impl.vcache.VCacheRequestContextFilter.lambda$doFilter$3(VCacheRequestContextFilter.java:44) com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:82) com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:72) com.atlassian.confluence.impl.vcache.VCacheRequestContextFilter.doFilter(VCacheRequestContextFilter.java:43) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.confluence.util.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:65) com.github.kristofa.brave.servlet.BraveServletFilter.doFilter(BraveServletFilter.java:59) com.atlassian.confluence.web.filter.ZipkinTracingFilter.doFilter(ZipkinTracingFilter.java:52) com.atlassian.confluence.web.filter.ResponseOutputStreamFilter.doFilter(ResponseOutputStreamFilter.java:23) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.confluence.web.ConfluenceJohnsonFilter.doFilter(ConfluenceJohnsonFilter.java:31) com.atlassian.confluence.impl.servlet.HoldingUntilStartedFilter.doFilter(HoldingUntilStartedFilter.java:88) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44) com.atlassian.confluence.servlet.FourOhFourErrorLoggingFilter.doFilter(FourOhFourErrorLoggingFilter.java:64) com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:46) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)

**# 2**

The last time I had 'Atlassian Confluence 5.10.8' working fine was July 21 2021 on macOS 11.5.

'Confluence' stopped working after I upgraded to macOS 11.5.1 on July 26 2021. Now using macOS 11.5.2 on August 11th 2021.

    macOS Big Sur 11.5.2 includes bug fixes for your Mac.macOS Big Sur 11.5.1 provides important security updates and is recommended for all users.


Answers:
author: Roger Lee
body: Looks like 'Time Machine' for the past 12 months hasn't been backing:

atlassian-confluence-5.10.8/confluence/database

Everything else in 'atlassian-confluence-5.10.8' except the 'database'!

<br />

When I upgraded 'macOS 11.5' it started to backup a empty/null version of:

atlassian-confluence-5.10.8/confluence/database/h2db.h2.db.mv.db  
atlassian-confluence-5.10.8/confluence/database/h2db.h2.db.mv.db.mv.db

<br />

Lesson learnt.


author: Nic Brough -Adaptavist-
body: The error is about the connection to the database, but there's no information in the error about what the database is, or the versions of connectors. My initial thought is that the database driver you've got to retain compatibility with an old Confluence is not supported by the version of Java your OS upgrade has landed you on, but there's no way to be sure about that without seeing more information on the database connection you've got for it.


author: Roger Lee
body: I'm using the H2 JAR that came with 'atlassian-confluence-5.10.8': h2-1.3.176.jar

I downloaded H2 version 1.4.199 (2019-03-13), Last Stable' and tried to use that on:

```
atlassian-confluence-5.10.8/confluence/WEB-INF/lib/h2-1.4.199.jar
```

I get the same error when I try:

```
http://localhost:8091/
```

```
HTTP Status 500 - Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.GenericJDBCException: Cannot open connection
```

I've Google'd for utilities etc. to import my 'atlassian-confluence-5.10.8' on 'localhost:8091' to:

```
https://myxyz.atlassian.net/
```

Do know of anything? TIA

comments: author: Nic Brough -Adaptavist-
body: Ok, there's two things here

* More out of curiosity, why did you download h2? The relevant version of it is part of the Confluence install already, and trying to get Confluence to use a separate independent install of it is a nightmare, and pretty much guaranteed to fail, especially if it's not the version that was distributed with Confluence.
* H2 is not suitable for long term or scaled usage. It is prone to catastrophic failure without any warning, especially when you do things like upgrade. I suspect you may have wrecked it beyond repair with what you've been doing.

I am not sure there is much you can do here. I would look in the Confluence home directory for the "database" directory first, get a copy of that to work from. Then I would install a new, clean copy of Confluence 5.10.8, choosing the embedded database option. Make sure that works, and then try swapping the database directory out for the old one you took a copy of (stopping and restarting of course)

If that does not work, I'm afraid you are likely to be stuck. The only other option is to revert to a backup. Confluence does a simple one regularly, take a look in \<confluence home\>/export (possibly backup - I don't remember the file structure that far back) for xml or zipped xml files - they should be restorable into an empty Confluence.


author: Roger Lee
body: **"More out of curiosity, why did you download h2?"**

To see if 'h2-1.3.176' on macOS 11.5.2 was causing the error. So I downloaded H2 1.4.200 from mvn:

<https://mvnrepository.com/artifact/com.h2database/h2/1.4.200>

**"H2 is not suitable for long term or scaled usage"**

I started using 'atlassian-confluence' \~6+ years ago to store all my Java/Kotlin/Scala/MongoDB/MySQL notes, facts, details etc.

Always planning to move to MySQL but as usual I had some other priority to do. I was planning this week to move to the Cloud version of '\<My\>.atlassian.net' ...

When I upgraded macOS I then got my first error with Confluence and occurred the error I've listed.

**"I suspect you may have wrecked it beyond repair with what you've been doing"**

Not at all. H2 is only a JAR and can copy an earlier version. I've also upgrade from an older version of Confluence. The last copy that was working on July 21 2021 using mac 'Time Machine".

I suspect you're a Windows user rather than macOS or Linux.

I'm 99% sure that the cause is because of 'atlassian-confluence-5.10.8' or H2 1.4.199 on macOS 1.5 on July 21, 2021.

IMO - I think I either to use Time Machine to go back to macOS 11.4 from July 20th. Run 'atlassian-confluence-' and move to Cloud version.

Or use someone else's older version of macOS and do as I've described.

Thanks for your suggestions.


author: Roger Lee
body: Also "atlassian-confluence" is only a WAR.


author: Nic Brough -Adaptavist-
body: Ok, so there's a few clarifications here:

\>**"More out of curiosity, why did you download h2?"**

\>To see if 'h2-1.3.176' on macOS 11.5.2 was causing the error

It won't be that directly, if you didn't wire it into your install of Confluence as Confluence expects (and you can't do that with a different version), it won't be the problem!

\>**"H2 is not suitable for long term or scaled usage"**

\> I Always planning to move to MySQL but as usual I had some other priority to do. I was planning this week to move to the Cloud version of '\<My\>.atlassian.net' ...

We've all done that one way or another ;-)

("We" meaning those of us who happily fire up a Confluence for something immediate with no intention of using it long term and then find it's still useful months or years later. Usually we don't find it until it falls over! My main Confluence is still on 6 because I haven't found time to upgrade or migrate it. I will. Honest...)

**\>"I suspect you may have wrecked it beyond repair with what you've been doing"**

Not the h2 itself, I mean the physical data in the h2 database. It's prone to being easily damaged, and when it is, it just fails dead, rather than just failing on bits of the data. (One obvious failure is that it can randomly truncate the whole lot - if you imagine an h2 database as a text file with one line per row in every table, imagine what happens when it writes the first 42 lines of the file and stops because of a crash - the other 424,200 lines are gone, as well as the terminators that make it readable!)

\>I suspect you're a Windows user rather than macOS or Linux.

Nope, stopped using Windows for anything other than games and minimal work demands in the late 90s. I'm a VMS/\*nix person through and through.

\>IMO - I think I either to use Time Machine to go back to macOS 11.4 from July 20th. Run 'atlassian-confluence-' and move to Cloud version.

That would be another very good option - it should be able to get your database back.   

I'm still feeling that you've damaged the h2 data, but let's see how the backup suggestions get on!