4

Unable to connect to a postgreSQL database on a LAN. (No problems connecting to the db on the server locally)

Error shown in pgAdmin.app:

Unable to connect to server: connection to server at "xxx.local" ([ipv6]), port 5432 failed: could not imitiate GSSAPI security context: Miscellaneous failure (see text): Matching credential (krbtgt/LOCAL@LKDC:SHA1.[long hex number] not found (negative cache) connection to server at "[server name]" ([ipv6]), port 5432 failed:

Error shown in log: /usr/local/var/log/postgresql@14.log

FATAL: no pg_hba.conf entry for host "[ipv6]", user "[user]", database "postgres", no encryption

So the pg server sees the attempted connecting and records it, but rejects.

Here's the pg_hba.conf (Confirmed active -- changes do affect the service, but so far unable to connect over LAN

# TYPE  DATABASE        USER            ADDRESS                 METHOD
local   all             all                                     trust #Also tried md5 & peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust #Also tried md5 & peer
# IPv6 local connections:
host    all             all             ::1/128                 trust #Also tried md5 & peer
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     trust #Also tried md5 & peer
host    replication     all             127.0.0.1/32            trust #Also tried md5 & peer
host    replication     all             ::1/128                 trust #Also tried md5 & peer

NOTE: All changes implemented are followed by brew services restart postgresql@14 And confirmed implemented by monitoring /usr/local/var/log/postgresql@14.log

in postgresql.conf:

listen_addresses = '*'

Server MacOS Monterey 12.5 psql (PostgreSQL) 14.6 (Homebrew)

Client MacOS Ventura 13.0.1

WhatsYourFunction
  • 151
  • 1
  • 1
  • 3

1 Answers1

1

Solution here was to drill down on the Address column of pg_hba.conf and understand how the entries there allow/block traffic.

Thanks to @a_horse_with_no_name for helping clarify & @mustaccio for the postgres page on this.

WhatsYourFunction
  • 151
  • 1
  • 1
  • 3