/admin

No Pg_hba.conf Entry For Host

FATAL: no pghba.conf entry for host 'xxxx.xx.xxx.xxx', user 'readonly', database 'workgroup', SSL off. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more Azure Postgres: no pghba.conf entry for host “0.0.0.0”, user “UserName”, database “orders”, SSL on.

Join GitHub today

GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

Sign up New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments

commented Nov 12, 2014

Case mate pro windows 7 download free. Since upgrading to Yosemite I'm getting an intermittent error when restarting my web application:

It only happens maybe 1/4 of the time, and if I hit refresh in the browser, the problem has cleared itself up (i.e. it never lasts more than a few seconds). Any idea what's causing this or what I can tweak to fix it?

commented Nov 12, 2014

The problem is that the name 'localhost' by default resolves to multiple different loopback addresses on OS X:

  • 127.0.0.1 (IPv4 loopback)
  • ::1 (IPv6 loopback)
  • fe80::1%lo0 (IPv6 loopback on a specific interface)

The PostgreSQL client tries connecting to each address in turn. The order of the addresses is determined by the getaddrinfo system call, and more or less random.

Once the client is connected, the server checks which address the client is connecting from (in the case of loopback that's the same as the effective server address). So if your client ends up connecting to fe80::1%lo0, the server wont find a corresponding entry in pg_hba.conf.

I can think of a few workarounds. Each of them should fix the issue:

  1. Set your server to listen only on 127.0.0.1 to avoid connections via IPv6 in postgresql.conf
  2. Edit /etc/hosts to remove the fe80::1%lo0 address (might have unknown sideeffects, this is probably there for a reason, even if I don't know why)
  3. Change your connection settings to connect to host 127.0.0.1 or ::1 instead of localhost
  4. Add a line for fe80::1%lo0 to pg_hba.conf

You can find the config files in the data directory (see prefs, or the installation docs)

commented Nov 12, 2014

Very interesting. And makes sense. My web app was configured to talk to localhost for the db, but I was browsing it on 127.0.0.1. Resolving that difference internally must take some time (especially with the random order resolution). If I hit refresh too quickly after the app restarted, it fell down.

I've reconciled those two settings and at first blush, it seems better. I'll report back.

Thanks!

closed this Nov 12, 2014
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment