Problem connecting to database error while setting up database in Confluence
Asked by SACHIN MENON:

Hello, I am getting this error while configuring POSTGRESQL parameters when setting up the database in confluence.

I am getting the following error. I have verfied the database configuration multiple times and the configuration seems to be ok in PostGreSQL. Need your support here. Thanks.

**Problem connecting to your database**

SQLState - 28000  
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "X.X.X.X", user "confluenceadmin", database "postgresdb", SSL off


Answers:
author: AnnWorley
body: [@SACHIN MENON](/t5/user/viewprofilepage/user-id/1151345) you may edit the pg_hba.conf file from pgAdmin by using the Tools menu and choosing Server Configuration\>pg_hba.conf:

![Screen Shot 2017-11-21 at 1.17.45 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/9842i4F5A9D90FEB956E8/image-dimensions/297x491?v=v2 "Screen Shot 2017-11-21 at 1.17.45 PM.png")

To add a new line, double click the blank line:

![Screen Shot 2017-11-21 at 1.18.09 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/9843iDB9FE863C6197E9C/image-dimensions/487x219?v=v2 "Screen Shot 2017-11-21 at 1.18.09 PM.png")

comments: author: SACHIN MENON
body: ![pgadmin tools page.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/9855iD939F4779FFAE65E/image-size/large?v=v2&px=999 "pgadmin tools page.JPG")


author: SACHIN MENON
body: Thanks Ann for your response. I fear I am not seeing the server configuration option under tools as you can see in the snapshot which I have shared. The one which I have is pgadmin ver4 on windows and I believe the snapshot which you shared is based on non-Windows platform.


author: Gonchik Tsymzhitov
body: Hi!

Sorry, have you read a documentation from PostgreSQL?

<https://www.postgresql.org/docs/9.4/static/auth-pg-hba-conf.html>

For me just interesting how did you check a configuration multiple times?

As I understand you are check on "app" level, I mean you just check for user about access to DB.

But "network" level have you test? like (telnet postgreshost 5432) from confluence. (short instruction <https://blog.bigbinary.com/2016/01/23/configure-postgresql-to-allow-remote-connection.html> , normal documentation

<https://www.postgresql.org/docs/9.4/static/runtime-config-connection.html>)

And double check "auth" level? like (psql -h postgreshost -d postgresdb -U confluenceadmin -W ) (for more info <https://www.postgresql.org/docs/9.4/static/auth-pg-hba-conf.html>)

I hope it helps for troubleshooting. And please, try to use cli, therefore you will fix so faster

Cheers,

Gonchik Tsymzhitov

comments: author: SACHIN MENON
body: Thanks Gonchik. I will try this out and will let you know early next week. Sorry I had been traveling this week and couldn't access the system.


author: Gonchik Tsymzhitov
body: You are welcome.

I will wait your follow up after checks and reconfigure.


author: Nic Brough -Adaptavist-
body: Your database is not set up to allow connections from your server, so I'm afraid your "configuration seems to be ok in PostGreSQL" is not right.

Have a look at the database's pg_hba.conf file - it needs a rule in there to allow confluenceuser to connect from x.x.x.x and use the databases.

comments: author: SACHIN MENON
body: Thanks Nic for your response May I know how to verify this in GUI PGAdmin tool?


author: Nic Brough -Adaptavist-
body: I'm not sure, I've always edited the file by hand.

What works for my server here is

host confluenceuser confdb x.x.x.4/32 md5

host jirauser jiradb x.x.x.8/32 md5

Replace the x.x.x.my-number with your server's ip address obviously.


author: SACHIN MENON
body: Hi Nic, I am not an expert in CLI. I tried looking at this option in PGAdmin, but not sure where to change this. May I know how to do this in CLI?


author: SACHIN MENON
body: ![snapshot.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/9254i88206B641CAE13CF/image-size/large?v=v2&px=999 "snapshot.JPG")![snapshot2.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/9253i751F79DE3AFFBABC/image-size/large?v=v2&px=999 "snapshot2.JPG")I have attached the snapshots as well.


author: Nic Brough -Adaptavist-
body: Are you sure you should be connecting Confluence to postgresdb? Is that not the admin database in there? Should it not be confluencedb?

That may be a diversion though, just something I would want to check.

Going back to the error message: There are no pg_hba.conf settings in that GUI I can see, you're going to have to edit it directly to allow the connection.