FATAL: no pg_hba.conf entry for host when setting up blazer gem

2.7k Views Asked by At

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.

1

There are 1 best solutions below

1
k_shil On BEST ANSWER

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.