Using a Docker instance of Confluence, Installation Fails When Attempting to Install Database
Asked by europoint:

I have installed a Docker container of Confluence 6.7.1 on a Linux-based NAS with the the CONF_HOME routed to a volume on the host. The installation is behind a reverse proxy, with the appropriate variables applied. It connects to the host network over a bridge. I have ensured that the volume on the host has read/write permissions for "everyone".

I can connect successfully to the URL and apply my DB settings (MYSQL). The installation correctly finds the existing database and starts the db installation.

However, at setup/setupdbtype.action, it fails with the following Java bean error:

com.atlassian.config.ConfigurationException: Error creating bean with name 'exporter' defined in class path resource \[jmxContext.xml\]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate \[com.atlassian.confluence.jmx.MBeanExporterWithUnregisterImpl\]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.atlassian.confluence.jmx.MBeanExporterWithUnregisterImpl.\<init\>()  
at com.atlassian.confluence.setup.actions.AbstractSetupAction.transitionFromColdToVacantState(AbstractSetupAction.java:162)

I know that generally the solution is to ensure read write permissions on the CONF_HOME, which I have set both on the host, and also attempted to carry out a CHOWN -R /var/atlassian/confluence from bash on the docker container itself, but it fails to change permissions on a number of directories.

Is anyone able to assist?


Answers:
author: David Binder
body: Hi,

We just had a very similar problem which we managed to resolve. None of the existing articles or problem solutions solved our problem.

We managed to set up a docker container with confluence (also behind a reverse proxy) and complete the first steps of the configuration of the confluence instance, up to the point where you have to configure the database. After we entered the details of the database, confluence would compute for \~2-3 minutes and then we would get a 504 Timeout error.

The important point is to **wait for another approx. 5 minutes** before you reload or try to access the base url. If you reload or access the base url before, confluence would break down with the mentioned errors (Java Beans). But if you wait 5 minutes and reload after that you can proceed with the configuration.

The problem seems to be that the configuration of the database continues in the background on the container, but is interrupted if confluence receives another http request.

Best regards,

David

comments: author: europoint
body: David,

Many thanks for this! I tried it and it resolved the issue! Having tried variant of Java and installation, I can't believe it was as simple as waiting five minutes!


author: Chenlei Ma
body: I encounter the same problem, and tried everything mentioned above, and still not working.

comments: author: David Binder
body: Hi,

The solution I proposed above was only a shortterm fix. A proper solution consists in changing the configuration of the reverse proxy. You have to increase the time limit the reverse proxy uses before it terminates an open session to something like 5 minutes instead of one minute. We used an nginx reverse proxy and, If I recall correctly, we applied the solution proposed here: <https://stackoverflow.com/questions/24453388/nginx-reverse-proxy-causing-504-gateway-timeout>

Regards,


author: Chenlei Ma
body: Thanks David.

It works.


author: Shannon S
body: Hi Matthew,

Can you have a look at this article and see if it resolves your issue,

[Unable to start Confluence due to JMX](https://confluence.atlassian.com/confkb/unable-to-start-confluence-due-to-jmx-182158269.html)

If not, can you stop Confluence, remove the following directories, and then restart and see if you still have the error?

* \<confluence-home\>/bundled-plugins  
  \<confluence-home\>/plugins-cache  
  \<confluence-home\>/plugins-osgi-cache  
  \<confluence-home\>/plugins-temp  
  \<confluence-home\>/bundled-plugins_language

If that does not work, another user stated they had a similar issue, and [explained their resolution in this response](https://community.atlassian.com/t5/Confluence-questions/Re-Confluence-Server-install-in-Docker-falure/qaq-p/607121/comment-id/81241#M81241).

Regards,

Shannon

comments: author: europoint
body: Hi Shannon,

The error I reported was due to me attempting to resolve the initial "Spring Context has not been set" error I was received by adding the jmxContext.xml file as directed.

I have deleted those directories and restarted with no change in the resolution.

I have also changed the owner as directed in the third resolution both to "root" (the owner of the directory) and "daemon" (the owner of the files) in an attempt to resolve the issue.

The error I am getting following all those three is:

com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: Spring Application context has not been set  
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)

caused by: java.lang.IllegalStateException: Spring Application context has not been set  
at com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:48)


author: Shannon S
body: Hi Matthew,

Thank you for confirming.

That Spring Application error can have many different causes, and 10 of them are outlined on this article: [Confluence does not start due to Spring Application context has not been set](https://confluence.atlassian.com/confkb/confluence-does-not-start-due-to-spring-application-context-has-not-been-set-218278311.html).

Could you review that page and try the fixes that you haven't yet explored (if any) and if you still have trouble, please let me know. I will be able to create a support ticket for you so we can obtain your full support zip.

Regards,

Shannon


author: europoint
body: Hi Shannon,

I have tried the solutions for 1,3,5,8 and 10 (the issues that could potentially be relevant) and still do not have any resolution.

Regards,

Matthew


author: Shannon S
body: Thank you, Matthew.

I've created a support ticket for this now.

Could you please upload a copy of your log files to [transfer.atlassian.io](https://transfer.atlassian.io)? This will automatically get added to your open support ticket so the team will be able to look at your issue.

Regards,

Shannon


Tags: docker