Jira Data center nodes are not able to connect to Amazon Aurora RDS

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

Summary

Upon restarting a cluster node in Jira Data Center, Jira is not able to connect to the Amazon Aurora RDS Database.

Environment

Jira 8.x an above connected to clustered Amazon Aurora RDS

Diagnosis

  • Upon starting Jira on a node, the following error can be seen in the $JIRA_HOME/logs/atlassian-jira.log:

    1 2 3 4 5 6 2021-12-04 05:30:39,266+0100 localhost-startStop-1 ERROR c.a.config.bootstrap.DefaultAtlassianBootstrapManager Could not successfully test your database: org.postgresql.util.PSQLException: Could not find a server with specified targetServerType: primary at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:330) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51) at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223) at org.postgresql.Driver.makeConnection(Driver.java:465)
  • If Jira was able to start before, we would be able to see previous successful restarts:

    1 2 3 4 5 6 7 8 9 10 11 12 13 2021-11-03 18:43:37,221+0100 localhost-startStop-1 INFO c.a.jira.startup.JiraStartupLogger Database configuration OK ___ Database Configuration _________________ Loading entityengine.xml from : file:/opt/atlassian/jira/atlassian-jira/WEB-INF/classes/entityengine.xml Entity model field type name : postgresaurora96 Entity model schema name : public Database Version : PostgreSQL - 11.11 Database Driver : PostgreSQL JDBC Driver - 42.2.23 Database URL : jdbc:postgresql://path.to.amazon.rds:5432/jiradb?targetServerType=master Database JDBC config : postgresaurora96 jdbc:postgresql://path.to.amazon.rds:/jiradb?targetServerType=master
  • At the same time, connecting from the command line PSQL client is successful.

Cause

The key here is the "Could not find a server with specified targetServerType: primary" error quoted above. That effectively means there's an underlying issue with the backend Amazon Aurora RDS, whereby the Database URL points to the reader instead of the writer. Under normal circumstances, the Database URL should automatically fallback to the writer instance, but sometimes, this might not occur.

Solution

Please check the backend AWS to make sure the database URL points to the writer and not the reader. Engage AWS support for further assistance if needed.

Updated on March 11, 2025

Still need help?

The Atlassian Community is here for you.