I'm unable to install jira-software due to the error message "You have specified a database that is not empty, please specify an empty database."
I've tried a complete fresh install after deleting the directories /opt/atlassian/jira/ and /var/atlassian with a new database.
The server is running Ubuntu Linux 20.04
MySQL connector 8.0.21
I can see that you are trying to install Jira server with a MySQL database. The error message would appear to indicate that the database selected might not be setup correctly for Jira to use.
I would want to make sure that you are following our version specific guide for both setting up MySQL and Jira over in Connecting Jira applications to MySQL 8.0. There are a couple of different ways in which that dbconfig.xml file can be properly filled out. My preferred method is to use the Jira Config tool to do this, after Jira has been installed, but before Jira has been started.
This is a setup utility that is also using Java. It has both a terminal interface for headless machines and a gui for other environments. But the thing I like best about this utility is that once you have your connection details filled out, there is also a 'Test Connection' button you can use to try to confirm that this other utility can also connect to your database as expected. Saving the changes here and then starting/restarting Jira will still launch the setup wizard for Jira, but at least this way you do not have to try to configure the database in the setup wizard.
Try these steps, if you're still running into problems here, I'd be interested to see any screenshots of errors you might get, or even any log entries you might find in the $JIRAINSTALL/logs/catalina.out file. These should help provide us additional clues here if we run into problems.
I am having an issue where the web setup interface incorrectly failed on DB setup telling me my database was not empty. I opened a mysql shell to the database (Mysql 8, Jira Software 8.16.0, mysql connector 8.0.23) and checked the database with the following output:
mysql> use jira_software
mysql> show tables;
Empty set (0.00 sec)
So after searching around for a bit online I found this thread. I tried doing a fresh install and used config.sh to configure the database before starting Jira and now Jira is unusable and showing the following error in the log output:
2021-04-16 10:24:52,825+0100 JIRA-Bootstrap INFO [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from /opt/atlassian/application-data/jira/dbconfig.xml 2021-04-16 10:24:52,855+0100 JIRA-Bootstrap INFO [c.a.j.config.database.DatabaseConfigHandler] Trying to get encrypted password from xml and decrypt it 2021-04-16 10:24:52,857+0100 JIRA-Bootstrap INFO [c.a.j.config.database.DatabaseConfigHandler] Database password decryption not performed. 16-Apr-2021 10:24:52.881 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 4110 ms 2021-04-16 10:24:53,404+0100 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running Jira startup checks. 2021-04-16 10:24:53,404+0100 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Jira pre-database startup checks completed successfully. 2021-04-16 10:24:56,152+0100 JIRA-Bootstrap INFO [c.a.j.config.database.DatabaseConfigurationManagerImpl] The database is configured. Now running Database Checklist Launcher 2021-04-16 10:24:56,154+0100 JIRA-Bootstrap INFO [c.a.jira.startup.DatabaseChecklistLauncher] Jira database startup checks completed successfully. 2021-04-16 10:24:56,155+0100 JIRA-Bootstrap INFO [c.a.j.config.database.DatabaseConfigurationManagerImpl] The database is configured. Now running Post database-configuration launchers 2021-04-16 10:24:57,820+0100 JIRA-Bootstrap INFO [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from /opt/atlassian/application-data/jira/dbconfig.xml 2021-04-16 10:24:57,822+0100 JIRA-Bootstrap INFO [c.a.j.config.database.DatabaseConfigHandler] Trying to get encrypted password from xml and decrypt it 2021-04-16 10:24:57,822+0100 JIRA-Bootstrap INFO [c.a.j.config.database.DatabaseConfigHandler] Database password decryption not performed. 2021-04-16 10:24:58,145+0100 JIRA-Bootstrap ERROR [c.a.jira.startup.ComponentContainerLauncher] A fatal error occurred during initialisation. JIRA has been locked. com.opensymphony.module.propertyset.PropertyImplementationException: Unable to load values for CacheKey[entityName=jira.properties,entityId=1] at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.propEx(CachingOfBizPropertyEntryStore.java:374) at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.resolve(CachingOfBizPropertyEntryStore.java:128) at com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore.getEntry(CachingOfBizPropertyEntryStore.java:151) at com.atlassian.jira.propertyset.CachingOfBizPropertySet.get(CachingOfBizPropertySet.java:189)
The $JIRAHOME/dbconfig.xml file will contain the settings that Jira is trying to use to connect to that database. So yes, it could be a configuration there.
But this kind of error could also be caused by the sql user/permissions that was setup here (that Jira is trying to use to connect to that database). The Connecting to MySQL documentation explains what SQL commands we expect you to have to run to setup the database in a manner that Jira will be able to read/write/create tables/etc.
Also if you did a fresh install, don't forget that you need to copy the mysql jdbc .jar file back into the $JIRAINSTALL/lib/ directory before you run the config.sh, or else Jira can't really connect to that database type. Check this again, and when you are in the config tool, there should be an option for you to Test Connection to the database. Try that and see what output it comes back with. This should give us another clue if Jira is able to connect to that database.
> The Connecting to MySQL documentation explains what SQL commands we expect you to have to run to setup the database in a manner that Jira will be able to read/write/create tables/etc.
This db host already has one perfectly working JIRA servicedesk instance running on it.
> Also if you did a fresh install, don't forget that you need to copy the mysql jdbc .jar file back into the $JIRAINSTALL/lib/
Yes, I did that.
> Test Connection to the database
I did that too and it worked.
However starting JIRA still fails.
Is it possible that you are connecting this new Jira installation to an existing database that is use by another Jira application that is currently running? That would explain the setup wizard's error in regards to your database not being empty and could explain the startup problem here. When Jira is started, there tends to be a flag of sorts in the database that goes up to prevent other sites from corrupting the database with two different servers trying to write to the same database. Data Center deployments have a differing means to get around this, but if sounds like this might be the case.
Creating a new database with a unique name should help avoid this problem. If you're still seeing this problem, then try starting Jira again and then look into the $JIRAINSTALL/logs/catalina.out file. This is another log file that tends to capture some more detailed information about the startup that might not always be in the $JiraHome/log/atlassian-jira.log file.
Here are the dbconfig.xml files for comparison. Above is the config for our servicedesk instance which works, and was installed first. Below is the Software instance I'm trying to get working. They're identical except for the database name:
Both databases are running in a single mysql 8 instance and use the same login credentials.
It doesn't look like the problem is in the dbconfig file itself, at least from what I can see. Which would then suggest that the problem lies in the way the database is configured. There is another thread with a very similar error message to this over in https://community.atlassian.com/t5/Jira-Core-questions/Error-when-installing-Jira/qaq-p/1114909
The solution in that case was to recreate the database because it had been created with an unsupported collation. Perhaps the same problem exists here as well.
This usually means what it has says - the installer expects an empty database and you have pointed it to one that has data in it.
I'd log into the database and do a "show tables" type thing to see what might be there. Does that list no tables, tables related to Atlassian stuff or unrelated tables?
I don't know what "returns empty set" means, you've not told us what you are doing to get that.
The problem here really is that there are tables in the target database and Jira won't try to insert itself into a database that is already there for something else.
Did you know that penalties up to 4 % of the yearly company turnover are possible in case of GDPR violations? GDPR regulations are currently mainly relevant for companies in the EU, but countries lik...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events