-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
None
-
Affects Version/s: 6.1.1
-
Component/s: Server - Installer / Setup
-
1
-
Severity 2 - Major
Summary
AWS Confluence CloudFormation template creates install and home directory as root so the setup assistant will not load and users get the error documented in the Knowledge Base article Confluence does not start due to Spring Application context has not been set.
Environment
AWS Confluence CloudFormation DataCenter template:
https://bitbucket.org/atlassian/atlassian-aws-deployment
Steps to Reproduce
- Install using the Confluence CloudFormation template from AWS
Expected Results
The Confluence Setup Assistant will launch properly.
Actual Results
The below exception is thrown after entering the license and the setup assistant does not complete the process:
2010-06-18 21:54:45,432 INFO [main] [com.atlassian.confluence.lifecycle] init Confluence is ready to serve
2010-06-18 21:55:20,515 FATAL [http-8080-1] [atlassian.spring.container.SpringContainerContext] getComponent Spring Application context has not been set
2010-06-18 21:55:20,528 ERROR [http-8080-1] [[Standalone].[localhost].[/].[action]] log Servlet.service() for servlet action threw exception
java.lang.IllegalStateException: Spring Application context has not been set
at com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:48)
at com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:32)
at com.atlassian.confluence.security.seraph.ConfluenceElevatedSecurityGuard.getCaptchaManager(ConfluenceElevatedSecurityGuard.java:115)
Notes
In the CloudFormation template it appears the permissions are being set to root and not the confluence user because the root user is creating the directories (line 164):
"inline": "sudo mkdir -p /opt/atlassian/bin && sudo mv /tmp/atl-update-host-name.sh /opt/atlassian/bin/atl-update-host-name.sh && sudo chmod +x /opt/atlassian/bin/atl-update-host-name.sh && sudo chown root:root /opt/atlassian/bin/atl-update-host-name.sh"
However, we see here the confluence user is created and the directories defined:
"user": "confluence",
"user_id": "1001",
"home_dir": "/var/atlassian/application-data/confluence",
"install_dir": "/opt/atlassian/confluence",
Workaround
- Stop Confluence
- Move the confluence-home directory and it's contents to /tmp (don't delete it until you confirm the application works)
- As root, impersonate the confluence user using: sudo su - confluence
- As the confluence user, start Confluence back up via: <confluence-install>/bin/start-confluence.sh
- Doing this will cause the confluence-home directory to be recreated with the proper permissions
- Complete the setup process
If you have further permissions issues:
- Stop Confluence
- Confirm the confluence user is the owner and has 755 permissions, by doing these:
$ ls -la /path/to/confluence-home $ ls -la /path/to/confluence-install
- If the user doesn't have full read/write permissions and/or is not the owner, change the permissions for the install and home directory using the commands below
chown -R confluence.confluence <confluence-install-folder> chown -R confluence.confluence <confluence-home-folder> chmod -R u=rwX,go-rwx <confluence-install-folder> chmod -R u=rwX,go-rwx <confluence-home-folder>
- Restart Confluence as the confluence user