Confluence tables already exist in the selected database on first installation
Asked by fnkr:

Hello,

today I tried to install Confluence on a Debian Linux Server with MySQL. I enter the MySQL username/password/database, click next and then (after \~30 seconds) I get this:

* Confluence tables already exist in the selected database

The database was definitely empty before. After there are 59 tables in the database.

I tried this multiple times now.


Answers:
author: fnkr
body: I downloaded the Confluence 5.4.2 standalone tar.gz archive, unpacked it, modified the conf/server.xml as needed, downloaded the mysql-driver into the lib folder, and set confluence.home in the WEB-INF/classes/confluence-init.properties file. Then I created a database (CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;) and a user (GRANT ALL PRIVILEGES ON confluence.\* TO 'confluence'@'localhost' IDENTIFIED BY 'pass';).

After that I started Confluence (bin/start-confluence.sh -fg) and tried to install Confluence using the web installer.


author: Nic Brough -Adaptavist-
body: Confluence creates the tables it needs - before you try again, drop EVERY table in the target database to make sure it is definitely empty.

Then, read the log file to find out where it is failing, if it does fail again. (If it helps, I've seen this happen when I've accidentally run two confluences at the same time - one of them falls over quickly and it took me ages to realise it had started up and then broken the other one)

comments: author: fnkr
body: Sure I emptied the database after every try.

Here is the log-file from the data-dir: <https://fs.fnkr.net/Ery6fGCi>


author: Nic Brough -Adaptavist-
body: Hmm, there's a lot missing from that, it should be echoing out system information. It looks like there is something very wrong in the environment or config for Confluence, but I'm not sure what.

Could you tell us what version you're installing and how (I can see it's 5.2, but which installer and what docs are you following, if any)


author: fnkr
body: I downloaded the Confluence 5.4.2 standalone tar.gz archive, unpacked it, modified the conf/server.xml as needed, downloaded the mysql-driver into the lib folder, and set confluence.home in the WEB-INF/classes/confluence-init.properties file. Then I created a database (CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;) and a user (GRANT ALL PRIVILEGES ON confluence.\* TO 'confluence'@'localhost' IDENTIFIED BY 'pass';).

After that I started Confluence (bin/start-confluence.sh -fg) and tried to install Confluence using the web installer.


author: Kyosuke Nakajima
body: I got the exact same problem with Confluence 5.7. I've also tried with mysql5.1, 5.5 and postgres9.3 but got the same error. Anybody have any clues??


author: Nic Brough -Adaptavist-
body: Have you dropped all the tables and started again?What does the log file say (in full) when you start it up?


author: Kyosuke Nakajima
body: Yes, I dropped my database and created again by \`CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_general_ci;\` (mysql5.5)----After I click "Next" on the database configuration page, I get "Confluence tables already exist in the selected database" error page, and if I click the override option, I get the following error.\`\`\`org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheStatisticsManager' defined in class path resource \[services/cacheServiceContext.xml\]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheStatisticsManager' defined in URL \[jar:file:/opt/www/atlassian-confluence-5.7/confluence/WEB-INF/lib/confluence-cache-ehcache-5.7.jar!/cacheProviderContext.xml\]: Cannot resolve reference to bean 'userI18NBeanFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userI18NBeanFactory' defined in class path resource \[i18NContext.xml\]: Cannot resolve reference to bean 'localeManager' while setting bean property 'localeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'localeManager' defined in class path resource \[i18NContext.xml\]: Cannot resolve reference to bean 'settingsManager' while setting bean property 'settingsManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'settingsManager' defined in class path resource \[applicationContext.xml\]: Cannot resolve reference to bean 'upgradeManager' while setting bean property 'upgradeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'upgradeManager' defined in class path resource \[upgradeSubsystemContext.xml\]: Cannot resolve reference to bean 'attachmentToCeoConversionUpgradeTask' while setting bean property 'schemaUpgradeTasks' with key \[4\]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'attachmentToCeoConversionUpgradeTask' defined in class path resource \[upgradeSubsystemContext.xml\]: Cannot resolve reference to bean 'luceneConnection' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'luceneConnection' defined in class path resource \[indexingSubsystemContext.xml\]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class \[com.atlassian.bonnie.LuceneConnection\]: Constructor threw exception; nested exception is com.atlassian.bonnie.LuceneException: org.apache.lucene.store.LockReleaseFailedException: Cannot forcefully unlock a NativeFSLock which is held by another indexer component: /opt/www/atlassian-confluence-5.7/index/write.lock\`\`\`


author: Nic Brough -Adaptavist-
body: Ah, well, that error is typical of using an incompatible version of Java.You have said you're on Confluence 5.7 - what version of java are you using? (The exact version, as I seem to remember that there are a couple of specific releases that cause problems)


author: Kyosuke Nakajima
body: echo $JAVA_HOMEgives me/usr/lib/jvm/jre-1.7.0-openjdk.x86_64By the way, thank you for helping out :)


author: Nic Brough -Adaptavist-
body: No problem.You can make some versions of Confluence work with Openjdk, but it's not supported at all. Could you swap to using Oracle's Java? 1.7 or 1.8


author: Kyosuke Nakajima
body: I tried with Oracle JAVA 1.8 but nothing changes.----$ . start-confluence.sh -fgServer startup logs are located in /opt/www/confluence/logs/catalina.outUsing CATALINA_BASE: /opt/www/confluenceUsing CATALINA_HOME: /opt/www/confluenceUsing CATALINA_TMPDIR: /opt/www/confluence/tempUsing JRE_HOME: /usr/java/jdk1.8.0_40Using CLASSPATH: /opt/www/confluence/bin/bootstrap.jar:/opt/www/confluence/bin/tomcat-juli.jarUsing CATALINA_PID: /opt/www/confluence/work/catalina.pid----Receive the following error, after clicking "Continue and override existing data" on "Confluence tables already exist in the selected database" error page.\`\`\`Error creating bean with name 'cacheStatisticsManager' defined in class path resource \[services/cacheServiceContext.xml\]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheStatisticsManager' defined in URL \[jar:file:/opt/www/atlassian-confluence-5.7/confluence/WEB-INF/lib/confluence-cache-ehcache-5.7.jar!/cacheProviderContext.xml\]: Cannot resolve reference to bean 'userI18NBeanFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userI18NBeanFactory' defined in class path resource \[i18NContext.xml\]: Cannot resolve reference to bean 'localeManager' while setting bean property 'localeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'localeManager' defined in class path resource \[i18NContext.xml\]: Cannot resolve reference to bean 'settingsManager' while setting bean property 'settingsManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'settingsManager' defined in class path resource \[applicationContext.xml\]: Cannot resolve reference to bean 'upgradeManager' while setting bean property 'upgradeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'upgradeManager' defined in class path resource \[upgradeSubsystemContext.xml\]: Cannot resolve reference to bean 'attachmentToCeoConversionUpgradeTask' while setting bean property 'schemaUpgradeTasks' with key \[4\]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'attachmentToCeoConversionUpgradeTask' defined in class path resource \[upgradeSubsystemContext.xml\]: Cannot resolve reference to bean 'luceneConnection' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'luceneConnection' defined in class path resource \[indexingSubsystemContext.xml\]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class \[com.atlassian.bonnie.LuceneConnection\]: Constructor threw exception; nested exception is com.atlassian.bonnie.LuceneException: org.apache.lucene.store.LockReleaseFailedException: Cannot forcefully unlock a NativeFSLock which is held by another indexer component: /opt/www/atlassian-confluence-5.7/index/write.lock\`\`\`----Receive the following error, after reloading (any page).\`\`\`Error creating bean with name 'i18NBean' defined in class path resource \[i18NContext.xml\]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method \[public com.atlassian.confluence.util.i18n.I18NBean com.atlassian.confluence.util.i18n.UserI18NBeanFactory.getI18NBean()\] threw exception; nested exception is com.atlassian.cache.CacheException: java.lang.IllegalStateException: The com.atlassian.confluence.util.i18n.I18NBeanFactory.by.locale Cache is not alive (STATUS_SHUTDOWN)\`\`\`


author: Kyosuke Nakajima
body: I still have not figured out the reason (and still couldn't use MySQL), but I reinstalled with the following environments and it worked this time.---CentOS 6.6Confluence 5.7.1 Server - Standalone (TAR.GZ Archive)PostgreSQL 9.3.6Oracle JRE 1.8.0_40---Thank you for the help :)


Tags: confluence-administration