Setting up new Confluence on AWS
Asked by Steve Boydon:

Hi I am trying to set up a new Confluence instance on AWS using

1 X EC2 running Nginx

1 x EC2 running Tomcat / Confluence

1 x RDS Postgres

Everything seems to be working in the set up as Nginx successfully proxies to Confluence on the private subnet.

Confluence can also connect to Postgres as the test connection works fine.

However, I get 504 errors due to gateway timeout. When I click on refresh the database has installed as it errors. On restarting Confluence I get the following error

A system error has occurred --- our apologies!

For immediate troubleshooting, consult our **[knowledge base](http://confluence.atlassian.com/display/CONFKB/Confluence+Knowledge+Base+Home)** for a solution.

The SystemInformationService could not be retrieved from the container. Therefore very limited information is available in this error report.   
The SystemInformationService could not be retrieved due to the following error: java.lang.IllegalStateException: Spring Application context has not been set

### Cause {#toc-hId-1059631346}

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)

#### Stack Trace:\[hide\] {#toc-hId-1750192820}

```
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)	at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)	at com.atlassian.confluence.setup.webwork.ConfluenceXWorkTransactionInterceptor.getTransactionManager(ConfluenceXWorkTransactionInterceptor.java:29)	at com.atlassian.xwork.interceptors.XWorkTransactionInterceptor.intercept(XWorkTransactionInterceptor.java:56)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.atlassian.confluence.xwork.SetupIncompleteInterceptor.intercept(SetupIncompleteInterceptor.java:52)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.atlassian.confluence.security.interceptors.SecurityHeadersInterceptor.intercept(SecurityHeadersInterceptor.java:39)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.atlassian.confluence.setup.actions.SetupCheckInterceptor.intercept(SetupCheckInterceptor.java:27)	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)	at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:115)	at com.atlassian.confluence.servlet.ConfluenceServletDispatcher.serviceAction(ConfluenceServletDispatcher.java:56)	at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:199)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:46)	at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:51)	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:45)	at com.atlassian.johnson.plugin.servlet.filter.JohnsonServletFilterModuleContainerFilter.doFilter(JohnsonServletFilterModuleContainerFilter.java:50)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at com.atlassian.confluence.util.message.MessagesDecoratorFilter.doFilter(MessagesDecoratorFilter.java:64)	at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:65)	at com.atlassian.confluence.util.profiling.ProfilingSiteMeshFilter.doFilter(ProfilingSiteMeshFilter.java:50)	
```


Answers:
author: Steve Boydon
body: I installed default-jre which installed an incompatible version.

So this issue has been resolved

I've had many errors since then :)

thx


author: Alexis Robert
body: Hi [@Steve Boydon](/t5/user/viewprofilepage/user-id/538331) ,

have you checked on the [Supported Platforms](https://confluence.atlassian.com/conf613/supported-platforms-964961686.html) page for Confluence that you are using a compatible version for PostgreSQL and for you Java JRE ?

Also, based on [this page](https://confluence.atlassian.com/confkb/confluence-does-not-start-due-to-spring-application-context-has-not-been-set-218278311.html) it could be an issue with your install directory permissions, or a missing driver for postgre for example.

Let me know if this helps,

--Alexis

comments: author: Steve Boydon
body: I'm using Postgres 9.6 (the database installs)

Checking the permissions, some were not as expected, updated so hopefully this will fix

Strange I've never had a problems installing on Ubuntu before with permissions.

Surely upon install and creation of files and folders the install package should already do this.

Rgds

Steve