1

My application uses the blazer gem for visualizing DB queries.

During the setup I've encountered the following error:

FATAL: no pg_hba.conf entry for host "111.22.33.44", user "blazer", database "my_db", SSL off

My application is hosted on EngineYard and uses PostgreSQL.

How can I find and modify the pg_hba.conf on EngineYard?

upd

I do have SSH access to EngineYard cloud.

Instance: General Purpose (M3) Large.

OS: EngineYard's Gentoo.

olegflo
  • 1,105
  • 3
  • 17
  • 26

1 Answers1

2

You can try the following steps. I've assumed that your DB name is my_db.

  • Connect to the instance via SSH (the link can be found on the EngineYard environment page)
  • Connect to the database as superuser psql -U postgres -h localhost -d my_db. If you don't have the password, check your database secrets here /data/my_db/current/config/database.yml

  • After connecting to DB identify location of hba file by typing SHOW hba_file;

  • Quit psql by typing \q
  • Use previously identified path to open the hba_file file and add the missing user. E.g via vim sudo vim /db/postgresql/9.5/data/pg_hba.conf. Note the sudo command
  • The use should be added under # IPv4 postgres user for 10.x with md5:
  • Connect to the database again
  • Reload the configuration via select pg_reload_conf(); command

After all steps are performed, Blazer queries should be accessible.

k_shil
  • 2,108
  • 1
  • 20
  • 25
  • 1
    I've followed the steps above but I'm still getting the same error. I'd be really gratefully if someone added a sample hba entry to the answer above. Otherwise the answer is excellent. – keoghpe Apr 20 '18 at 09:53