Powered by Syntax Highlighter scripts!

getting error FATAL no pg_hba.conf entry for host user database SSL off

Getting the error below when I try to run the sql-maven-plugin for the project;

getting error FATAL no pg_hba.conf entry for host <host:ip:addr>, user <dbuser>, database <dbname>, SSL off

After searching through net I've added my local IP address to the hba.conf file using PGAdmin III tool
Tools Menu -> Server Configuration -> pg_hba.conf
Inserted one more row as below
Type: host
Database: all
user: all
IP Address: <my system IP address> <eg:  99.999.99.999 >
method: password   (I was using password as clear text in my build script).

Even after this I was getting the same error as above, after some more time of debugging, multiple trials and observations, I observed that a '/32' was present in IP Address column.

I've added '/32' as suffix for my IP address also in pg_hba.conf file and it resolved the connection issue.
In pg_hba.conf file a new row is inserted as below:
host    all             all             99.999.99.999/32            password

This solved only half of my problem as my IP address is not a static IP, so instead of adding multiple IP address entries, we can use 'samenet' literal as an IP address to accept all IP address in the same subnet.
host    all             all             samenet            password

No comments: