Question

I'm trying to deploy my Rails application through Capistrano 3. On my own server everything was working but with my new one, I have some problem to access to the database :

DEBUG [05c115bf]        FATAL:  no pg_hba.conf entry for host "ip.address.of.the.server", user "postgres", database "my_database", SSL on
DEBUG [05c115bf]        FATAL:  no pg_hba.conf entry for host "ip.address.of.the.server", user "postgres", database "my_database", SSL off

I know that the problem comes form pg_hba but I cannot find where exactly.

This is what I've tried :

# Database administrative login by Unix domain socket
local   all             postgres                                md5

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
hostssl    all             all             ip.address.of.the.server/24          md5
hostnossl    all             all             ip.address.of.the.server/24          md5

# IPv6 local connections:
host    all             all             ::1/128                 md5

# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

Currently I'm blocked at this point.

Was it helpful?

Solution 2

The problem came from my deploy.rb where I made a mistake on the host... Simply.

After hours of researches, this problem is finally fixed. Thank you for your help.

OTHER TIPS

put real IP address of the server with which you want to connect instead if ip.address.of.the.server for more info visit pg_hba.conf

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top