문제

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.

도움이 되었습니까?

해결책 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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top