D. Durant
D. Durant

Reputation: 21

Heroku Postgresql pg:psql No Route to host

For now I am just trying to make the heroku pg:psql command work but my final purpose is to copy a database that I have on my computer (localhost) to the heroku postgresql database with the pg:push command.

For now when I simply try to access the database that I created on heroku, the heroku pg:psql command returns:

psql: could not connect to server: No route to host
    Is the server running on host "ec*-**-***-***-**.eu-west-1.compute.amazonaws.com" (**.***.***.**) and accepting
    TCP/IP connections on port 5432?

postgresql.conf: (the lines are not commented)

listen_address ='*'
port = 5432
ssl = true

and host all all **.***.***.** trust in pg_hba.conf

I also tried to add rules to iptables in order to give access to the database from the host IP address provided by heroku.

I am on a Debian computer, how can I solve this?

Upvotes: 2

Views: 2245

Answers (1)

Adrian Hartanto
Adrian Hartanto

Reputation: 465

psql: could not connect to server: No route to host

It means your PostgreSQL server is not starting up or is starting up on a different port.

Solutions you may try:

  1. Check PostgreSQL service by command ps -ef | grep Postgres.
  2. Check the port which PostgreSQL is listening to by command netstat -tupln | grep Postgres.
  3. Make sure your server enables UDP port because PostgreSQL needs UDP port loopback for stats collector service.
  4. Check the startup logs or database logs at pg_log about the problem.

Upvotes: 2

Related Questions