Jira Operation Fails due to 'Communications link failure'
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Jira fails on startup when trying to establish a connection to a MySQL database
Project imports fail.
Other, seemingly random, problems with Jira (usually correlating to large database queries).
The following appears in the atlassian-jira.log
:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2022-02-18 17:43:20,856+0100 JIRA-Bootstrap ERROR [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database:
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
...
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
...
OR
1
2
3
4
5
6
7
8
9
10
11
12
2022-03-07 10:48:44,030+0000 JIRA-Bootstrap ERROR [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 161 milliseconds ago. The last packet sent successfully to the server was 155 milliseconds ago.
....
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at java.base/sun.security.ssl.HandshakeContext.<init>(Unknown Source)
at java.base/sun.security.ssl.ClientHandshakeContext.<init>(Unknown Source)
at java.base/sun.security.ssl.TransportContext.kickstart(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
... 46 more
OR
1
The driver was unable to create a connection due to an inability to establish the client portion of a socket.
Causes
MySQL 5.7 driver - If you have recently upgraded your MySQL database to 5.7.6 or above, it's important to know that there have been changes in the MySQL Driver which now use SSL as a preferred mode. See also
MySQL 8.0 driver - If you have recently upgraded your MySQL driver to 8.0.13 or above, it's important to know that there have been changes in the MySQL Driver which now use SSL as a preferred mode. See also
Linux limits - This is usually caused by a limit on the number of sockets imposed by the operating system. This limit is usually configurable.
Resolution
dbconfig for MySQL 5.7+:
You would either need to import the certificates into the truststore: MySQL :: MySQL Connector/J 5.1 Developer Guide :: 5.7 Connecting Securely Using SSL
Or just disable SSL to get it working as it did previously i.e. set
useSSL=false
in thedbconfig.xml
, example:dbconfig.xml snippet
1
<url>jdbc:mysql://localhost:3306/jiradb?useUnicode=true&characterEncoding=UTF8&sessionVariables=default_storage_engine=InnoDB&useSSL=false</url>
dbconfig for MySQL 8.0:
You would either need to import the certificates into the truststore: MySQL :: MySQL Connector/J 8.0 Developer Guide :: 6.9 Connecting Securely Using SSL
Or just disable SSL to get it working as it did previously i.e. set
s
slMode=DISABLED
in thedbconfig.xml
, example:dbconfig.xml snippet
1
<url>jdbc:mysql://localhost:3306/jiradb?useUnicode=true&characterEncoding=UTF8&sessionVariables=default_storage_engine=InnoDB&sslMode=DISABLED</url>
Sockets
For Unix-based platforms, see the manual page for the 'ulimit' command. Kernel or system reconfiguration may also be required.
For Windows-based platforms, see Microsoft Knowledge Base Article 196271 (Q196271). Specifically, please investigate the 'MaxUserPort' and 'TcpWaitTimeDelay' parameters.
Was this helpful?