Uploaded image for project: 'Confluence Server and Data Center'
  1. Confluence Server and Data Center
  2. CONFSERVER-60515

Connections to Azure PostgreSQL fail due to org.postgresql.util.PSQLException: The connection attempt failed

    XMLWordPrintable

    Details

      Description

      Summary

      PostgreSQL updated the default fallback behavior in the 42.2.16 driver in a way that breaks support for PostgreSQL instances in Microsoft Azure. This version of the driver was bundled into Confluence as of 7.8.3.

      Environment

      • Azure Postgres
      • AWS serverless Aurora Postgres (reported in comments)

      Steps to Reproduce

      1. Setup an Azure PostgreSQL instance
      2. Attempt to test a connection in the Confluence setup wizard to this instance

      Expected Results

      Confluence is able to connect to the database

      Actual Results

      The test fails
      The below exception is thrown in the xxxxxxx.log file:

      2021-01-06 19:17:56,961 ERROR [http-nio-8090-exec-8] [atlassian.config.bootstrap.DefaultAtlassianBootstrapManager] getTestDatabaseConnection Could not successfully test your database: 
       -- referer: http://localhost:7000/setup/setupdbtype-start.action | url: /setup/setupstandarddb-testconnection.action | traceId: 004f898b296e23d7 | userName: anonymous | action: setupstandarddb-testconnection
      org.postgresql.util.PSQLException: The connection attempt failed.
      	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315)
      	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
      	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
      	at org.postgresql.Driver.makeConnection(Driver.java:465)
      	at org.postgresql.Driver.connect(Driver.java:264)
      	at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
      	at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
      	at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.getTestDatabaseConnection(DefaultAtlassianBootstrapManager.java:347)
      

      Notes

      Workaround

      1. Download the new driver from the following link: https://jdbc.postgresql.org/download/postgresql-42.2.18.jar
      2. Stop Confluence
      3. Rename the current driver
        1. Navigate to <confluence-install>/confluence/WEB-INF/lib
        2. Rename postgresql-42.2.16.jar to postgresql-42.2.16.jar.old
      4. Move the new driver into <confluence-install>/confluence/WEB-INF/lib
      5. Start Confluence

      At this point, you should be able to create a connection.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              96a63ffc20f5 jthompson2
              Reporter:
              sbrannen@atlassian.com Branno
              Votes:
              12 Vote for this issue
              Watchers:
              23 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: