My confluence installation failed
Asked by hengerlu:

![WX20170802-121830@2x.png](/t5/image/serverpage/image-id/3935iC96169421BADE7D3/image-size/large?v=v2&px=999 "WX20170802-121830@2x.png")


Answers:
author: Nic Brough -Adaptavist-
body: There are several possible causes

1. The confluence user doesn't own and have full access to the file system under the installation and home directories
2. A virus scanner is blocking access to files
3. You are running it as "root".
4. A an application blocker is stopping it - SELinux for example
5. You've set a JAVA_HOME and pointed it at the wrong version of Java for it
6. The database driver is missing from the installation (Check \<install\>/confluence/WEB-INF/lib for a driver jar)
7. The hostname of the server can not be resolved by itself
8. The server does not have enough memory during installation to set up the database

comments: author: petritis
body: \*\*\* Is there a place where I can find a log that might point to the failure that causes issue to happen? \*\*\*

I am having the same problem, so far I have done these steps:

1. I run the install via sudo

2. I did chmod a+x (it was only u+x before)

3. I upped the database user confluence uses all the way to dbadmin to take that variable out of the mix

4. I added the ip address I am using when configuring to /etc/hosts so that I was reaching it at an address it knew.

5. I have a very recent vanilla Ubuntu Server headless system I am installing it onto (the headless is why I am configuring from a browser on another machine)

6. After each failure I uninstall confluence, delete both of these directories:

/opt/atlassian

/var/atlassian/application-data

And drop the database that it was using.

7. I will keep working through your suggestions and hopefully stumble on the answer.


author: petritis
body: FYI here is part of my postgres log, these are the first messages as the install happens:

2017-09-21 17:14:10 EDT \[1315-1\] confluenceuser@confluence ERROR: relation "attachments" does not exist at character 22  
2017-09-21 17:14:10 EDT \[1315-2\] confluenceuser@confluence STATEMENT: select count(\*) from ATTACHMENTS  
2017-09-21 17:14:10 EDT \[1315-3\] confluenceuser@confluence ERROR: relation "bodycontent" does not exist at character 22  
2017-09-21 17:14:10 EDT \[1315-4\] confluenceuser@confluence STATEMENT: select count(\*) from BODYCONTENT  
2017-09-21 17:14:10 EDT \[1315-5\] confluenceuser@confluence ERROR: relation "content" does not exist at character 22  
2017-09-21 17:14:10 EDT \[1315-6\] confluenceuser@confluence STATEMENT: select count(\*) from CONTENT  
2017-09-21 17:14:10 EDT \[1315-7\] confluenceuser@confluence ERROR: relation "contentlock" does not exist at character 22  
2017-09-21 17:14:10 EDT \[1315-8\] confluenceuser@confluence STATEMENT: select count(\*) from CONTENTLOCK  
2017-09-21 17:14:10 EDT \[1315-9\] confluenceuser@confluence ERROR: relation "extrnlnks" does not exist at character 22


author: Nic Brough -Adaptavist-
body: That tells us the database is damaged. But not really why.


author: petritis
body: Followup: I have finally gotten it to install on Ubuntu Server.

The only things I did different seem to be of no consequence.

1. I installed using the default config ( instead of custom )

2. I did NOT let the installer start the server (this is the BIGGEST difference)

3. I upped the postgresql logging a bunch.

4. I manually started confluence (with sudo start-confluence.sh)

5. I opened confluence in a web browser.

6. When it was time for it to set up the database, I found I messed up and hadn't dropped the DB from the last attempt at configuring.

7. I deleted the DB and recreated it.

8. I backed up a step on the config web page, reentered DB info

9. The config worked after that


author: AnnWorley
body: It was very considerate of you to type up the specific steps taken to get the install to work. Thank you for following up.


author: Peter Heubeck
body: Here's another take on the problems. It still exists in Confluence 7.4.5 server (VM) and DC 7.9.3-4 (Azure cloud), both Linux, both using PostgreSQL database.

There are actually several interesting messages during startup. The ones I encountered are (so many logs of this exists in multiple forum entries so just pasting the interesting parts):

```
ERROR sendError Could not execute action
url: /docs/bootstrap/selectsetupstep.action
Error creating bean with name 'i18NBean'
defined in class path resource [i18NContext.xml]
Error creating bean with name 'tenantedTransactionManager'
defined in class path resource [databaseSubsystemContext.xml]:
Error creating bean with name 'tenantedLocalSessionFactoryBean5'
defined in class path resource [productionDatabaseContext.xml]:
Hibernate properties have not yet been persisted in confluence.cfg.xml

WARN Failed to read entry from cache 'com.atlassian.bandana.BandanaPersister':
Failed due to UNCLASSIFIED_FAILURE
url: /docs/bootstrap/selectsetupstep.action

ERROR Could not get swap target filter
?url: /docs/bootstrap/selectsetupstep.action

WARN Failed to read entry from cache 'com.atlassian.bandana.BandanaPersister'
?Failed due to UNCLASSIFIED_FAILURE
?url: /docs/bootstrap/selectsetupstep.action
```

As I could find no problems with any of the possible sources of this problem (according to [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)) I just renamed confluence.cfg.xml to kickstart the setup process again and restarted Confluence. **Nothing else was changed!**

And now Confluence setup finalized without any problems after I specified same settings regarding installation type, licenses and database settings...

So, after this I compared the confluence.cfg.xml with the one I saved after the first failed setup, and below are the differences (server id and jwt private and publik key differs but not listed here).

Xml from succesful startup contains:

```
?? <setupStep>complete</setupStep>
```

and from failed startup contains:

```
?? <setupStep>setupdbchoice-start</setupStep>
```

Xml from failed startup is missing these entries:

```
? <property name="admin.ui.allow.daily.backup.custom.location">false</property>
? <property name="admin.ui.allow.manual.backup.download">false</property>
? <property name="admin.ui.allow.site.support.email">false</property>


? <property name="attachments.dir">${confluenceHome}/attachments</property>


? <property name="hibernate.database.lower_non_ascii_supported">true</property> <property name="hibernate.setup">true</property>

```

Xml from failed startup contains this (*which is NOT present in the successful startup*), and note that in both cases I selected the team calendars plugin in the setup and added licenses for both confluence and the team calendar in next step:

```
? <property name="setup.selectedBundlePluginKeys">{"com.atlassian.confluence.extra.team-calendars":{"key":"com.atlassian.confluence.extra.team-calendars","namespace":"team_calendars","name":"Team Calendars","description":"setup.selectbundle.team-calendars","license":"************","remoteUrl":"https://marketplace.atlassian.com/download/plugins/com.atlassian.confluence.extra.team-calendars","localUrl":"file:/data/confluence-application/confluence/WEB-INF/packages/team-calendars-6.0.48.obr","logo":"tc-logo.png","label":"license.tc.key","generateLicenseLink":"license.tc.generate.link"}}</property>
```

So, all of this makes me think there is either some sort of timing issues in the Confluence configuration startup threads, perhaps some resource limitations that causes this, but it is not any of the causes listed by Nic above or any of the causes listed on the "Confluence does not start due to Spring Application context has not been set" page I referred to above. Well, except perhaps for nr 8, "confluence.cfg.xml is corrupt", but that is not a cause, that is a result of something else failing...


author: hengerlu
body: HTTP Status 500 - com.atlassian.spring.container.ComponentNotFoundException: Failed to find component: Error creating bean with name 'i18NBean' defined in class path resource \[i18NContext.xml\]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate \[com.atlassian.confluence.util.i18n.I18NBean\]: Factory method 'getI18NBean' threw exception; nested exception is java.util.concurrent.CompletionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantedTransactionManager' defined in class path resource \[databaseSubsystemContext.xml\]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantedLocalSessionFactoryBean5' defined in class path resource \[productionDatabaseContext.xml\]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: premature SessionFactory initialisation, Hibernate properties have not yet been persisted in confluence.cfg.xml {#toc-hId-1956775069}
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================