Confluence fails to start with error message "can't initalise container - corrupt project.cfg.xml"
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Confluence fails to start and we see the following error messages in atlassian-confluence.log
2021-06-11 03:05:23,073 INFO [Catalina-utility-1] [com.atlassian.confluence.lifecycle] contextInitialized Starting Confluence 7.4.7 [build 8402 based on commit hash 6b68a70068820413941dbe78233b871f8d3c0c6e] - synchrony version 3.1.0-release-confluence_7.4-1af8f87b
2021-06-11 03:05:28,118 ERROR [Catalina-utility-1] [atlassian.config.bootstrap.BootstrappedContextLoaderListener] canInitialiseContainer Hibernate not yet set up, but setup is complete - can't initalise container - corrupt project.cfg.xml?
.
2021-06-11 01:03:00,576 FATAL [https-jsse-nio-443-exec-24] [atlassian.spring.container.SpringContainerContext] getComponent Spring Application context has not been set
Environment
It can happen in any version of Confluence with any database.
Diagnosis
- Check if
<confluence-home>/confluence.cfg.xml
contains a line for thehibernate.setup
property and it is set to true. - Check if anything has been manually updated in
<confluence-home>/confluence.cfg.xml
file. Any corruption in this file will stop Confluence from starting up and cause this error.
Solution
If
<confluence-home>/confluence.cfg.xml
does not contain a line for thehibernate.setup
property or it is currently set to false, try to have the line below added/changed and restart Confluence. We have seen cases where this line was missing on the file and adding enabled to instance to start without issues.Edit confluence.cfg.xml file and find the hibernate.dialect property, as below:
... <property name="hibernate.connection.username">Sanitized by Support Utility <property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.PostgreSQLDialect</property> ...
Add the line <property name="hibernate.setup">true</property>' right below the hibernate.dialect property, as below:
... <property name="hibernate.connection.username">Sanitized by Support Utility <property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.PostgreSQLDialect</property> <property name="hibernate.setup">true</property> ...
- If the change above does not enable Confluence to start successfully and it shows the same error on logs, revert any changes previously done to confluence.cfg.xml file. If changes are unknown, install another instance of Confluence with same database. Then copy over confluence.cfg.xml from that instance and retro fit changes.