Error Connecting to database FATAL : no pg_hba.conf entry for host"x.x.x.x", user"jiradbuser", database"jiradb", SSL off
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
Symptom
When testing database connectivity and performing a test connection, the following error appears
1
Error Connecting to database FATAL : no pg_hba.conf entry for host"x.x.x.x", user"jiradbuser", database"jiradb", SSL off
Cause
Client authentication is controlled by a configuration file, which traditionally is named pg_hba.conf and is stored in the database cluster's data directory. For more information on postgres configuration file details:
http://www.postgresql.org/docs/9.2/static/auth-pg-hba-conf.html
Resolution
Add the IP address of the application (e.g., Jira) server to the pg_hba.conf
and make sure that the method is not set to reject
. You need to modify the xxx.xxx.xxx.xxx and put the IP address to allow connections.
1
2
3
4
5
6
7
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all xxx.xxx.xxx.xxx md5
# IPv6 local connections:
host all all ::1/128 md5
Another example, 192.168.132.17/24 where 24 is the mask which would be 255.255.255.0. If it was 255.255.0.0 then the number would be 16. For more information consult the pg_hba.conf documentation page.
1
2
3
4
5
6
7
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 192.168.132.17/24 trust
# IPv6 local connections:
host all all ::1/128 md5
After pg_hba.conf has been updated, run the following command in the database to reload the new information added.
1
SELECT pg_reload_conf()
Was this helpful?