Upgrade Fails Due to Previously Failed Upgrade Attempt on Same Instance
Symptoms
An upgraded Confluence instance fails to start up and displays the following message:
Upgrade failed. Please consult the system logs for details. You will need to fix these problems, restore your database and confluence home directory to the pre upgrade state. Then retry the upgrade.
A similar error appears in the atlassian-confluence.log
:
2012-05-09 02:52:33,697 ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.AtlassianUserToEmbeddedCrowdConfigurationUpgradeTask@e805af4 failed during the UPGRADE phase due to: Hibernate operation: could not insert: [com.atlassian.crowd.model.directory.DirectoryImpl#30900225]; SQL []; Duplicate entry 'upgraded atlassian-user ldap (ldaprepository)' for key 2; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'upgraded atlassian-user ldap (ldaprepository)' for key 2
com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.AtlassianUserToEmbeddedCrowdConfigurationUpgradeTask@e805af4 failed during the UPGRADE phase due to: Hibernate operation: could not insert: [com.atlassian.crowd.model.directory.DirectoryImpl#30900225]; SQL []; Duplicate entry 'upgraded atlassian-user ldap (ldaprepository)' for key 2; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'upgraded atlassian-user ldap (ldaprepository)' for key 2
Cause
The instance you are attempting to upgrade has already had one upgrade attempt against it. What has happened is that the database has not been properly rolled back to the state prior to the original upgrade attempt which causes a conflict when creating new tables.
Resolution
Ensure that the home directory and database are returned to the state from before the original upgrade attempt.