Confluence had problems starting up ,Could not load bootstrap from environment, NullPointerException
Asked by medcynyc:

Hello,

I have been working with confluence since months now, and suddenly today I was unable to launch it, I fear that months of work is lost and this is terrible.

I run confluence server in Docker Desktop on Mac, could you please assist me asap ??

Why is this issue suddenly happening ? I need to get it fixed asap.

Thanks,

Cyril


Answers:
author: Yevgen Lasman
body: Unfortunately only application logs could reveal the problem, because what you mentioned in the topic summary is the consequence but not the root cause.

If you had a crash and were using H2 database (built-in), it is most likely that you experience Confluence data corruption, blocking application's ability to start.

comments: author: medcynyc
body: here it is:

2020-11-06 18:27:50,096 INFO \[Catalina-utility-1\] \[com.atlassian.confluence.lifecycle\] contextInitialized Starting Confluence 7.6.2 \[build 8501 based on commit hash 824f149d70ae2ad1d29a82a2fd43b16cca383892\] - synchrony version 3.1.0-master-022ca438

2020-11-06 18:27:58,624 ERROR \[Catalina-utility-1\] \[atlassian.confluence.setup.ConfluenceConfigurationListener\] contextInitialized An error was encountered while bootstrapping Confluence (see below):

Cannot connect to h2db

java.lang.RuntimeException: Cannot connect to h2db

at com.atlassian.h2.DatabaseCreatingServerLifecycle.start(DatabaseCreatingServerLifecycle.java:57)

at com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateConfig.getHibernateProperties(ConfluenceHibernateConfig.java:51)

at com.atlassian.confluence.setup.DefaultBootstrapManager.getHibernateProperties(DefaultBootstrapManager.java:634)

at com.atlassian.confluence.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:318)

at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:81)

at com.atlassian.confluence.setup.DefaultBootstrapManager.init(DefaultBootstrapManager.java:188)

at com.atlassian.config.util.BootstrapUtils.init(BootstrapUtils.java:36)

at com.atlassian.confluence.setup.ConfluenceConfigurationListener.initialiseBootstrapContext(ConfluenceConfigurationListener.java:146)

at com.atlassian.confluence.setup.ConfluenceConfigurationListener.contextInitialized(ConfluenceConfigurationListener.java:65)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4690)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5151)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.base/java.lang.Thread.run(Thread.java:834)

Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.NullPointerException" \[50000-196\]

at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)


author: medcynyc
body: I did not make any changes to confluence, so how could I fix this issue ?


author: Daniel Ebers
body: Like Yevgen outlined earlier it most likely was not a change that you would have done.  

It's rather caused by circumstances that happened to your computer.
> If you had a crash and were using H2 database (built-in), it is most likely that you experience Confluence data corruption, blocking application's ability to start.

Please see the postings above for some things you could do now including trying to repair the database and/or check for the presence of backups you could restore from.


author: medcynyc
body: Thanks for your answers, but I tried to simply reinstall confluence, and I still have the same issue with the H2 DB not being able to be connected to, the error is unrelated to Bootstrap this time... I suspect a bug with the latest version of confluence ? Can someone from Atlassian come back to me please ? It has nothing to do with my DB or my computer, JIRA was working fine when confluence was failing and is still working fine now that I am reinstalling everything. So I would appreciate if Atlassian could investigate this possible (probable )bug.


author: tokcum
body: Dear Cyril,

could you please be more specific on the error you experience in the log file? Maybe you can upload some logs here for further investigation.

Which database was used by your Confluence? Had the container crashed before you started to experience this issue?

Kind regards,

Tobias

comments: author: medcynyc
body: Thanks Tobias for getting back to me, I really appreciate it.

I am not using any external database, it runs locally in a docker.

My computer did crash, but it happened in the past and I was able to relaunch confluence by restarting my computer every time.

I tried to backup and restore my confluence image and unfortunately I cannot see it in my docker at the moment, so I do not have access to the logs from the container.


author: medcynyc
body: Tobias, this is the full log:

NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

\[0.001s\]\[warning\]\[gc\] -Xloggc is deprecated. Will use -Xlog:gc:/opt/atlassian/confluence/logs/gc-2020-11-06_18-27-45.log instead.

06-Nov-2020 18:27:46.087 WARNING \[main\] org.apache.catalina.startup.SetAllPropertiesRule.begin \[SetAllPropertiesRule\]{Server/Service/Connector} Setting property 'proxyPort' to '' did not find a matching property.

06-Nov-2020 18:27:46.124 WARNING \[main\] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match \[Server/Service/Engine\] failed to set property \[debug\] to \[0\]

06-Nov-2020 18:27:46.132 WARNING \[main\] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match \[Server/Service/Engine/Host\] failed to set property \[debug\] to \[0\]

06-Nov-2020 18:27:46.200 WARNING \[main\] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match \[Server/Service/Engine/Host/Context\] failed to set property \[debug\] to \[0\]

06-Nov-2020 18:27:46.233 WARNING \[main\] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match \[Server/Service/Engine/Host/Context\] failed to set property \[debug\] to \[0\]

06-Nov-2020 18:27:46.238 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/9.0.33

06-Nov-2020 18:27:46.238 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 11 2020 09:31:38 UTC

06-Nov-2020 18:27:46.239 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.33.0

06-Nov-2020 18:27:46.240 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux

06-Nov-2020 18:27:46.240 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.4.39-linuxkit

06-Nov-2020 18:27:46.241 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64

06-Nov-2020 18:27:46.241 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /opt/java/openjdk

06-Nov-2020 18:27:46.242 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 11.0.8+10

06-Nov-2020 18:27:46.242 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: AdoptOpenJDK

06-Nov-2020 18:27:46.243 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/atlassian/confluence

06-Nov-2020 18:27:46.243 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/atlassian/confluence

06-Nov-2020 18:27:46.250 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED

06-Nov-2020 18:27:46.250 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED

06-Nov-2020 18:27:46.250 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

06-Nov-2020 18:27:46.251 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/atlassian/confluence/conf/logging.properties

06-Nov-2020 18:27:46.251 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

06-Nov-2020 18:27:46.252 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048

06-Nov-2020 18:27:46.252 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources

06-Nov-2020 18:27:46.252 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027

06-Nov-2020 18:27:46.252 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:ReservedCodeCacheSize=256m

06-Nov-2020 18:27:46.253 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseCodeCacheFlushing

06-Nov-2020 18:27:46.253 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.server.protocols=TLSv1.1,TLSv1.2

06-Nov-2020 18:27:46.253 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.client.protocols=TLSv1.1,TLSv1.2

06-Nov-2020 18:27:46.254 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dconfluence.context.path=

06-Nov-2020 18:27:46.254 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Datlassian.plugins.startup.options=-fg

06-Nov-2020 18:27:46.254 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.locale.providers=JRE,SPI,CLDR

06-Nov-2020 18:27:46.254 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768

06-Nov-2020 18:27:46.254 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsynchrony.enable.xhr.fallback=true

06-Nov-2020 18:27:46.254 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms1024m

06-Nov-2020 18:27:46.254 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1024m

06-Nov-2020 18:27:46.255 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dconfluence.home=/var/atlassian/application-data/confluence

06-Nov-2020 18:27:46.255 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseG1GC

06-Nov-2020 18:27:46.255 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Datlassian.plugins.enable.wait=300

06-Nov-2020 18:27:46.255 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true

06-Nov-2020 18:27:46.255 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:G1ReservePercent=20

06-Nov-2020 18:27:46.255 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xloggc:/opt/atlassian/confluence/logs/gc-2020-11-06_18-27-45.log

06-Nov-2020 18:27:46.255 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseGCLogFileRotation

06-Nov-2020 18:27:46.256 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:NumberOfGCLogFiles=5

06-Nov-2020 18:27:46.256 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:GCLogFileSize=2M

06-Nov-2020 18:27:46.256 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xlog:gc+age=debug:file=/opt/atlassian/confluence/logs/gc-2020-11-06_18-27-45.log::filecount=5,filesize=2M

06-Nov-2020 18:27:46.256 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:-PrintGCDetails

06-Nov-2020 18:27:46.256 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+PrintGCDateStamps

06-Nov-2020 18:27:46.256 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:-PrintTenuringDistribution

06-Nov-2020 18:27:46.257 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+IgnoreUnrecognizedVMOptions

06-Nov-2020 18:27:46.257 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=

06-Nov-2020 18:27:46.258 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/atlassian/confluence

06-Nov-2020 18:27:46.258 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/atlassian/confluence

06-Nov-2020 18:27:46.258 INFO \[main\] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/atlassian/confluence/temp

06-Nov-2020 18:27:46.259 INFO \[main\] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: \[/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib\]

06-Nov-2020 18:27:46.763 INFO \[main\] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler \["http-nio-8090"\]

06-Nov-2020 18:27:46.796 INFO \[main\] org.apache.catalina.startup.Catalina.load Server initialization in \[974\] milliseconds

06-Nov-2020 18:27:46.882 INFO \[main\] org.apache.catalina.core.StandardService.startInternal Starting service \[Catalina\]

06-Nov-2020 18:27:46.883 INFO \[main\] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: \[Apache Tomcat/9.0.33\]

06-Nov-2020 18:27:49.208 INFO \[Catalina-utility-2\] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.

06-Nov-2020 18:27:49.257 INFO \[Catalina-utility-2\] org.apache.catalina.core.ApplicationContext.log 1 Spring WebApplicationInitializers detected on classpath

06-Nov-2020 18:27:49.611 INFO \[Catalina-utility-2\] org.apache.catalina.core.ApplicationContext.log Initializing Spring DispatcherServlet 'dispatcher'

2020-11-06 18:27:50,096 INFO \[Catalina-utility-1\] \[com.atlassian.confluence.lifecycle\] contextInitialized Starting Confluence 7.6.2 \[build 8501 based on commit hash 824f149d70ae2ad1d29a82a2fd43b16cca383892\] - synchrony version 3.1.0-master-022ca438

2020-11-06 18:27:58,624 ERROR \[Catalina-utility-1\] \[atlassian.confluence.setup.ConfluenceConfigurationListener\] contextInitialized An error was encountered while bootstrapping Confluence (see below):

Cannot connect to h2db

java.lang.RuntimeException: Cannot connect to h2db

at com.atlassian.h2.DatabaseCreatingServerLifecycle.start(DatabaseCreatingServerLifecycle.java:57)

at com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateConfig.getHibernateProperties(ConfluenceHibernateConfig.java:51)

at com.atlassian.confluence.setup.DefaultBootstrapManager.getHibernateProperties(DefaultBootstrapManager.java:634)

at com.atlassian.confluence.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:318)

at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:81)

at com.atlassian.confluence.setup.DefaultBootstrapManager.init(DefaultBootstrapManager.java:188)

at com.atlassian.config.util.BootstrapUtils.init(BootstrapUtils.java:36)

at com.atlassian.confluence.setup.ConfluenceConfigurationListener.initialiseBootstrapContext(ConfluenceConfigurationListener.java:146)

at com.atlassian.confluence.setup.ConfluenceConfigurationListener.contextInitialized(ConfluenceConfigurationListener.java:65)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4690)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5151)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.base/java.lang.Thread.run(Thread.java:834)

Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.NullPointerException" \[50000-196\]

at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)


author: tokcum
body: In case of crashes it is very likely that the built in H2DB is corrupted. I think this is also the root cause of the failing startup in your case.

Sometimes it is possible to repair H2DB. There are tools available to support you in this. It could be tricky though.

From my experience it might be more promising to restore the Confluence content from a backup. Please have a look under \<jira home\>/export. Are there any files available?


author: medcynyc
body: thanks for your time; where do I look for that ?


author: Daniel Ebers
body: The base error seems to be the message "Cannot connect to h2db" why the suggestion was to repair it which is in many cases reported here just not possible.  

Therefore you could check for the presence of backups like described here:  
<https://confluence.atlassian.com/doc/site-backup-and-restore-163578.html>

In case all fails (database cannot be repaired and backup not available) the data must be considered lost.


author: tokcum
body: Dear Cyril,

you wrote your Confluence was based on a Docker container. When looking for the database or backup files, please check the persistent disk of that container.

All the best.

Tobias


Tags: confluence-server

docker

mac

null-pointer-exception

server