Password authentication failed with PostgreSQL 9

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

When integrating Bitbucket Server with PostgreSQL 9, the connection with the database is refused and you see a reported exception similar to this:

1 org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "<username>")

Cause

This problem is caused because Bitbucket Server has not been added to the PostgreSQL pg_hba.conf file, without which PostgreSQL 9 will not allow the connection.

Resolution

Add Bitbucket Server to the PostgreSQL pg_hba.conf file, so that PostgreSQL 9 will allow bitbucket to connect. The pg_hba.conf file enables client authentication between the PostgreSQL server and a client application, such as Bitbucket Server. The file defines a database host and its associated permissions (for example, the database it is allowed to connect to, the authentication method to use, and so on). For details of the file contents, see the PostgreSQL documentation at http://www.postgresql.org/docs/9.2/static/auth-pg-hba-conf.html.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.