rapidloop / pgmetrics

Collect and display information and stats from a running PostgreSQL server
https://pgmetrics.io
Apache License 2.0
960 stars 65 forks source link

no pg_hba.conf entry for host #24

Closed daxhuiberts closed 5 years ago

daxhuiberts commented 5 years ago

I'm trying to run pgmetrics against our Heroku postgres database, but I'm receiving the following error message: pgmetrics: pq: no pg_hba.conf entry for host "xxx.xxx.xx.xx", user "xxxxxxxx", database "xxxxxxxx", SSL off

The the host ip in the error message is not the public ip of the database instance, but looks like the private ip. Connecting to the database using psql from the same terminal with the same credentials works as expected. pgmetrics runs succesfully against my localhost database. I'm using the darwin build of v1.6.3 from https://github.com/rapidloop/pgmetrics/releases I also tried running the docker image version but there I get the same error message.

Is there a setting I need to provide on the command line for it to work with a Heroku postgres database?

mdevan commented 5 years ago

Can you try with SSL enabled? With Heroku, you probably also want to include the --only-listed flag too.

PGSSLMODE=require pgmetrics --only-listed -h ec2-a-b-c-d.compute-1.amazonaws.com -U yourusername yourdbname
daxhuiberts commented 5 years ago

Yes, those changes make it work properly! Thank you.