while setting up jira confluence with postgres in my windows server im getting this error kindly suggest
Problem connecting to your database
SQLState - 28000
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.1.7", user "postgres", database "confluence", SSL off
Welcome to Community!
This error message indicates that you don't have a properly configured PostgreSQL server. In PostgreSQL there is a file pg_hba.conf that control from which computer, which user can connect to which database. You are trying to connect to the PostgreSQL server from 192.168.1.7 using the user postgres and use confluence database and you don't have such entry in this file.
If your database is on the same server as Confluence try to provide localhost in DB configuration instead of PostgreSQL IP address.
If you are using different servers for Confluence and database you need to add something similar to pg_hba.conf file on PostgreSQL server:
host confluence postgres 192.168.1.7/32 md5
You can read more about it here: https://www.postgresql.org/docs/current/auth-pg-hba-conf.html
IMPORTANT NOTICE: You should connect to your database using another user (other than postgres). To do so beneficial would be to create a dedicated user like:
1. Create a user:
CREATE USER confluencedbuser WITH PASSWORD 'my_password';
2. Grant privileges on the database to the user:
GRANT ALL PRIVILEGES ON DATABASE "confluence" to confluencedbuser;
3. Add the following line to pg_hba.conf:
host confluence confluencedbuser 192.168.1.7/32 md5
4. Make sure that port 5432 (default PostgreSQL port) is open on the firewall and that your DB server listen on all IP addresses (you can check it on the PostgreSQL.conf file on the DB server)
Best regards,
Piotr
Hello Sharath and welcome to the Community!
Thanks for sharing the error you are seeing along with the steps you took to get to this point. The error you're getting does have a KB to help resolve and is caused by your postgres og_hba.conf not being correctly configured. Please review the following: Error Connecting to database FATAL : no pg_hba.conf entry for host"x.x.x.x", user"jiradbuser", database"jiradb", SSL off
To save time, the KB reports the following to resolve the issue:
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 toreject
. You need to modify the xxx.xxx.xxx.xxx and put the IP address to allow connections.# 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.
# 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.
SELECT pg_reload_conf()
Regards,
Stephen Sifers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.