So I attempted an updated of JIRA from 8.18.0 to 8.20.1 in response to CVE-2021-42574
It ended with me not being able to connect to the database and having to revert to the volume snapshot I made.
Has anyone had any luck with the this type of upgrade? I can't imagine it's too rare to be using MySQL.
Methodology
Get:
Database: We've found an error in MySQL supported version!
The database type in your dbconfig.xml is set up to MySQL 5.7 and your MySQL version is different. Consider using MySQL 5.7 database type instead
See our documentation for more information on changing database type.
Applied these changes to dbconfig.xml:
That error goes away.
Also getting:
Database: JIRA couldn't connect to your database
JIRA failed to establish a connection to your database.
This could be because:
-Your database isn't running
-The configuration of your dbconfig.xml file is incorrect (user, password, or database URL etc.)
-There is a network issue between JIRA and your database (e.g. firewall, database doesn't allow remote access etc.)There are several other solutions you can try, review our documentation and see what works for you."
Get this garbage in the log:
The last packet successfully received from the server was 26 milliseconds ago. The last packet sent successfully to the server was 22 milliseconds ago.
2021-11-02 11:16:34,110-0400 JIRA-Bootstrap ERROR [c.a.jira.health.HealthChecks] JIRA failed to establish a connection to your database.
Attempted fixes:
Still getting the connection error.
We run Confluence on the same instance and it had no db connection issues.
Server is MySQL 5.7.33 running on Amazon RDS. We run JIRA on Amazon Linux AMI.
Unable to resolve.
Exceeded maintenance window by an hour and had to revert and continue to run unsafe software.
Whole morning wasted. Thanks Atlassian!
I resolved the error by adding the parameter "useSSL=false&" in the dbconfig.xml file and restarting the JIRA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
we had this parameter already since update to 8.13.x -
update to 8.20.x still failed on Prod, while it was succesful in Staging.
we have no indication what could be the reason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding a link to my solution documented in another discussion in case it helps anyone. For me it was both mysql-java-connector upgrade to Connector/J 8.0.28 and changes to dbconfig.xml that got me up and running again on LTS 8.20.7
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My working solution was a combination with the hint from John Allison (see above) and fixing an error I found in the startup logfile of my server:
Error I found in my installation was:
19-Nov-2021 18:21:59.983 SCHWERWIEGEND [Catalina-startStop-1] org.apache.catalina.startup.HostConfig.beforeStart Unable to create directory for deployment: [/opt/atlassian/jira/conf/Catalina/localhost]
2
So my solution for fixing this issue is:
1) Create 2 Directorys:
a) Below /opt/atlassian/jira/conf/ creat a directory named Catalina
b) After that creat a directory inside the directory you created in step a) /opt/atlassian/jira/conf/Catalina/ create localhost
c) check for the right group and ownsership and modes for the dirs you just created
2) Apply solution from John Allison:
a) Find location of your dbconfig.xml file by entering find / -name dbconfig.xml
b) cd to that location
c) Edit this file by nano ./dbconfig.xml (in my case: nano /var/atlassian/application-data/jira/dbconfig.xml )
d) adding the parameter "useSSL=false&" to the connection string - but beware, you have to use the notation like the other parameters, so in real you have to add useSSL=false& after one ; in the connection string.
e) save your work
After that restart your server. Now it should work.
I verified it on 4 different installations and it worked for me in any case. Doing only one ofe the steps will not work (I tried a lot).
Hope this will help
Best regards,
Kai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Kai! Your solution worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm also having same issue. We are using MySQL 5.7.29 on Jira 8.11.
I tried upgrading Jira to 8.20 and it's throwing database cannot be connected.
I'm looking at this doc: https://confluence.atlassian.com/kb/how-to-fix-the-collation-and-character-set-of-a-mysql-database-manually-744326173.html
and our Jira database is in utf8 collation.
I'm wondering if this can be reason because from that doc, after Jira 8.12, database collation must be utf8mb4. So, maybe I may need to change Jira DB to utf8mb4 collation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is what we are using successfully for 8.13.5:
mysql> SELECT @@character_set_database, @@collation_database;
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
| utf8mb4 | utf8mb4_general_ci |
+--------------------------+----------------------+
1 row in set (0.00 sec)
mysql> SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'jira';
+----------------------------+------------------------+
| DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME |
+----------------------------+------------------------+
| utf8mb4 | utf8mb4_bin |
+----------------------------+------------------------+
1 row in set (0.00 sec)
But this is not working when we attempted to upgrade to version 8.20.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have followed this and it resolved our mysql DB converting all table's collation to UTF8MB4.
and I was able to upgrade our Jira 8.12 or higher.
Our Jira is now on 8.20.2.
The link that Atlassian has provided: https://confluence.atlassian.com/kb/how-to-fix-the-collation-and-character-set-of-a-mysql-database-744326173.html
Did not convert mysql DB collation fully.
So if anyone has issue with mysql db connection on Jira after 8.12, look at the blog that I have provided.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Having the same issue as yourself. Upgrading MySQL from v5.6 to v.5.7, and Jira from v8.2.4 to long term support v.8.20. Running RHEL 7.9 and Java 8 on MS Azure. I have the luxury of doing this in a test environment before applying to production.
Upgrading MySQL to v.5.7 worked fine. Skim tested Jira v.8.2.4 and it seemed to work ok. After upgrading JIRA to v.8.20, that is when I get the same error as yourself. Nothing special logged in any log files.
Makes note of the fact that for Jira 8.12 or later, you must use utf8mb4. I followed the steps on that web page, did not resolve my issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check your mysql log. We were seeing 'bad handshake' messages on Jira startup. As it turns out, the JDBC does not enable TLS1.2 by default so the connection was failing. Nothing was showing up in the Jira logs except that the database couldn't be connected to. The message about the mysql version was a red herring and just wrong. Was able to work around this by adding the following to the JDBC connection string in dbconfig.xml:
'enabledTLSProtocols=TLSv1.2'
Why this became an issue only now with more recent versions I have to guess it's a regression and Atlassian doesn't actually test their software releases with all the things they claim it works with.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Even though I don't get this error logged in the MySQL logs, I tried this in my test environment and it did not resolve the issue for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @mbingaman - unlike other solutions of just disabling the SSL check which I didn't want to do, this fixed the issue for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same problem here, upgrading from 8.15.0 to 8.20.1. Produces "Database: JIRA couldn't connect to your database"
checked logs (nothing useful)
double checked content of server.xml and setenv.sh, found nothing suspect
Confirmed mysql DB is running, and we can connect from the server.
upgrades fine, but Jira wont connect to the DB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We experienced the same issue but on a different version. We were attempting an upgrade from 8.13.4 to 8.13.13. Please let us know if you hear from Atlassian about this topic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.