1

I am getting below error, when trying to connect to enterprise DB, any information is appreciated.

psycopg2.OperationalError: FATAL:  client authentication failed
DETAIL:  no pool_hba.conf entry for host "xxx.xx.xx.xxx", user "enterprisedb", database "enterprisedb", SSL off
HINT:  see pgpool log for details


import psycopg2

conn = psycopg2.connect(database="enterprisedb", user = "enterprisedb", password = "wifimsdp", host = "xx.xxx.xx.xxx", port = "5431")



have the below entry in pool_hba.conf

"local" is for Unix domain socket connections only

local all all trust

1 Answers1

0

pg_hba.conf configuration file hods the authentication information for example, which hosts/IP addresses are allowed by postgresql using which user and connect to which database. The IP address from which you are tying to make connection to your database has no entry in the pg_hba.conf file of your database system. The basic entry on pg_hba.conf for a particular host is like following:

host       database  user  address  auth-method  [auth-options]

address portion have to mention IP address with mask, for example in 192.168.0.100/32 format. For more details follow the official documentation.

arryph
  • 2,725
  • 10
  • 15
  • Already have the configuration added: "local" is for Unix domain socket connections only local all all trust – Sayantan Indu Feb 11 '19 at 10:50
  • `no pool_hba.conf entry for host "xxx.xx.xx.xxx"` check this message closely, you are not using local unix socket domain, else you wouldn't have this error about authenticating a host. You are using `127.0.0.1 or localhost` as your host while connecting to database, which causes IP connection instead of local unix socket connection. Try using `host=False`. – arryph Feb 11 '19 at 12:13