Updating Jira on MariaDB and Running Into Database Driver Problems
See what problem you can run into when updating Jira on MariaDB.
We run a public instance of Jira (jira.mariadb.com). Since it's public, it's good to keep it pretty up-to-date so that no known vulnerabilities are open. A couple of weeks back, we started a routine update where we first update the operating system and the libraries available through the repositories configured in the operating system.
The operating system update (apt update and apt upgrade) updated a whole lot of system libraries, but also nginx and MariaDB Server. We use nginx as a reverse proxy in front of Jira. The MariaDB Server update was a minor one; it took MariaDB Server from version 10.3.12 to 10.3.13. At this point, everything worked as normal.
It was time to upgrade Jira itself to its latest 7 version, 7.13.1. We haven't yet moved to Jira 8. We want to wait a couple of minor versions before doing that, which I think is a good idea since there are pretty major changes in it and there have been several releases of it 8.0.0, 8.0.1, and 8.0.2 within a month.
When you install Jira, you, of course, need to backup both your database and your Jira configuration. The Jira installer can do the latter for you, but I usually make sure to copy the main configuration files server.xml and dbconfig.xml separately. For the database and all issue attachments and other artifacts, we have backups running all the time. The Jira installer will overwrite your changes in server.xml, and depending on your choice in the installer, also the dbconfig.xml.
Once the Jira installer finished, I did the usual logical step and downloaded the latest MariaDB Connector/J to use as the database driver. I wish I would have tested with the old version first. We were using 2.3.0 and I upgraded it to 2.4.0. Then with my fingers crossed, I started Jira and BOOM; I got an awkward database manager error in the log:
JIRA-Bootstrap ERROR [c.a.jira.startup.DefaultJiraLauncher] JIRA has failed to start because of the following errors: [(Event: Level = (EventLevel: fatal) , Key = (EventType: startup-unexpected) , Desc = We couldn't start JIRA , Exception = An error occurred while trying to start JIRA. We can't give you any more detail right now, we suggest checking the logs for more detail and contacting our support team.<br/>See our documentation for more information on contacting our support team and creating a support zip.), (Event: Level = (EventLevel: fatal) , Key = (EventType: database) , Desc = Could not execute health check, DatabaseConfigurationManager not available. , Exception = ]
It took a while to figure out where the problem was. I rolled back MariaDB, I rolled back Jira, I redid the installation a couple of times. I verified a lot of settings. Finally, I realized that I hadn't tested to rollback MariaDB Connector/J. I did that and everything started working. Our Connector/J developer took a look at the problem and quickly realized what was going on.
Connector/J 2.4.0 is smarter than its predecessors and includes in connection metadata information on what type of a database server it's connected to. Before, it was always "mysql," but now, it says "MariaDB" if the underlying database is MariaDB. This caused a hiccup for Jira that relied on getting "MySQL" as before.
The thing is, Atlassian, the company behind Jira, does not support MariaDB as the database server for Jira, although we, for example, have been running Jira with MariaDB for about four years. There is great demand for this, and I really hope Atlassian will add official support very soon. The demand is getting enormous, see https://jira.atlassian.com/browse/JRASERVER-32347.
MariaDB Connector/J 2.4.1, which is available now, has an option for setting the metadata information to "MySQL," although it's talking to MariaDB. You can download it here. Then make sure to use the new option useMysqlMetadata.
If you're interested in the topic of running Jira with MariaDB, you might be interested in my other topics about running Jira with MariaDB: