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

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

      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.

          Form Name

            [CONFSERVER-60515] Connections to Azure PostgreSQL fail due to org.postgresql.util.PSQLException: The connection attempt failed

            A fix for this issue is available to Server and Data Center customers in Confluence 7.12.0
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Franco Skrzypczak added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.12.0 Upgrade now or check out the Release Notes to see what other issues are resolved.

            If you're running the Confluence 6.13 Enterprise release, a fix for this issue is now available in Confluence 6.13.20, which you can find in the Download Archives.

            James Whitehead added a comment - If you're running the Confluence 6.13 Enterprise release, a fix for this issue is now available in Confluence 6.13.20, which you can find in the Download Archives .

            If you're running the Confluence 7.4 Enterprise release, a fix for this issue is now available in Confluence 7.4.8, which you can find in the Download Archives.

            James Whitehead added a comment - If you're running the Confluence 7.4 Enterprise release, a fix for this issue is now available in Confluence 7.4.8, which you can find in the Download Archives .

            EDAG Group added a comment - - edited

            Hello,

            I can't believe that. It's a well known problem of postgresql-42.2.16.jar occured in Confluence since 7.4.x. LTS. I have to replace the driver with postgresql-42.2.18.jar manually for every of our 30 systems. Now, I found out, that this postgresql-42.2.16.jar buggy driver is newly bundled in in Jira 8.13.4 LTS, too.

            BTW: we are running postgresql 9.6 DB on premise.

            Thanks Guys for figting against my boredom

            Thomas

             

            EDAG Group added a comment - - edited Hello, I can't believe that. It's a well known problem of postgresql-42.2.16.jar occured in Confluence since 7.4.x. LTS. I have to replace the driver with postgresql-42.2.18.jar manually for every of our 30 systems. Now, I found out, that this postgresql-42.2.16.jar buggy driver is newly bundled in in Jira 8.13.4 LTS , too. BTW: we are running postgresql 9.6 DB on premise. Thanks Guys for figting against my boredom Thomas  

            @Branno, it is also exist in 7.4.7.

            Nirmani.Kalakheti added a comment - @Branno, it is also exist in 7.4.7.

            The affected PostgreSQL driver is also included in the latest version of the LTS, 7.4.6. The issue with the Driver also affects servers using AWS serverless aurora postgres as their database. Our confluence site is run using the official docker image on the 7.4 LTS tag. After docker pulled the latest 7.4 image our confluence stopped working until we update the tag to 7.4.4 the version we had previously been running.

            Alan Sherman added a comment - The affected PostgreSQL driver is also included in the latest version of the LTS, 7.4.6. The issue with the Driver also affects servers using AWS serverless aurora postgres as their database. Our confluence site is run using the official docker image on the 7.4 LTS tag. After docker pulled the latest 7.4 image our confluence stopped working until we update the tag to 7.4.4 the version we had previously been running.

            Instead of creating a new bug, I have updated this request to bundle the new driver version and turned it into a bug.

            Branno (Inactive) added a comment - Instead of creating a new bug, I have updated this request to bundle the new driver version and turned it into a bug.

              96a63ffc20f5 jthompson2 (Inactive)
              sbrannen@atlassian.com Branno (Inactive)
              Affected customers:
              12 This affects my team
              Watchers:
              23 Start watching this issue

                Created:
                Updated:
                Resolved: