1
votes

I have added in pg_hba.conf on the server side this line :

host     all         all    host_ip             md5

But i am still getting the error

DBI connect('database=databasename;host=server_host_ip','username',...) failed: FATAL: no pg_hba.conf entry for host "host_ip", user "username", database "databasename", SSL off at /usr/local/share/perl/5.10.1/DBIx/DataStore.pm line 1983.
[Fri Aug 24 11:01:03 2012] /usr/local/share/perl/5.10.1/DBIx/DataStore.pm,1029: Validation of connection to primary database failed!
Died at /usr/local/share/perl/5.10.1/DBIx/DataStore.pm line 1029.`

what i am missing?

UPDATE
perl merge_infos.pl

DBI connect('database=diamas;host=67.23.10.243','dia',...) failed: FATAL:  no pg_hba.conf entry for host "38.104.59.18", user "dia", database "diamas", SSL off at /usr/local/share/perl/5.10.1/DBIx/DataStore.pm line 1983.  

pg_hba.conf (remote sever)

host    all         all         38.104.59.18/32       trust  

THE CALL (local machine)
(in script) merge_infos.pl

use DBIx::DataStore ( config => 'yaml' );
my $olddb = DBIx::DataStore->new('www');

datastore.yml

www:
primary:
driver: Pg
database: diamas
user: dia
password: ***
host: 67.23.10.243
schemas:
  - public
1
Soooo many possible issues: you're connecting to a different server than the one you edited the configuration on; you're actually connecting from a different IP address than you though you were; you didn't reload PostgreSQL after editing; you edited the wrong pg_hba.conf file (e.g. for a different cluster on a Debian/Ubuntu system)... - Moritz Bunkus
@Moritz Bunkus: i am connecting to the right server, the ip address is the same, PostgreSQL has been restarted after change. How do i make sure it is the right cluster? - mamesaye
Check your process list for instances of the postgres daemon. Note that only the instances that don't currently handle connections are interesting. On one of my Debian systems I have these two processes running: /usr/lib/postgresql/8.3/bin/postgres -D /var/lib/postgresql/8.3/latin9 -c config_file=/etc/postgresql/8.3/latin9/postgresql.conf and /usr/lib/postgresql/8.3/bin/postgres -D /var/lib/postgresql/8.3/unicode -c config_file=/etc/postgresql/8.3/unicode/postgresql.conf; those are two clusters/instances running on different ports, each with its own pg_hba.conf configuration file. - Moritz Bunkus
@Moritz Bunkus: i only have 1 on the server: /usr/lib/postgresql/8.3/bin/postgres -D /var/lib/postgresql/8.3/main -c config_file=/etc/postgresql/8.3/main/postgresql.conf. and that is his pg_hba that i changed... - mamesaye
Please modify your post to include actual output. Meaning the unedited versions, pure copy & paste, of your line in pg_hba.conf, the DBI->connect(...) call (remove the actual password) and the error message printed by Perl. If possible also include the output of /sbin/ip address list or, if ip isn't installed, the output of ifconfig. - Moritz Bunkus

1 Answers

0
votes

i edited the wrong pg_hba.conf file