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

pgmetrics 1.4.0 failed to support scram authentication #17

Closed xianwum closed 6 years ago

xianwum commented 6 years ago

I have a database (PostgreSQL 10.3) with password of dbuser encrypted with scram-sha-256. The entry in pg_hba.conf is "host [database] [user] [ip] md5"

When running pgmetrics for the database, it got an error

pgmetrics: pq: unknown authentication response: 10

This indicates scram authentication is not supported.

I have to change the password encryption of dbuser with md5 or disable authentication method in pg_hba.conf by adding entry "host trust" to overcome the error.

In production environment, neither of the above workaround is allowed.

Can you please check and resolve the above issue?

mdevan commented 6 years ago

Needs scram support in Go lib/pq driver, there is a pending PR: https://github.com/lib/pq/pull/608. Will see if it can be worked around in pgmetrics.

mdevan commented 6 years ago

Fixed in release v1.4.2 with commit 3352310. Release available here.

SCRAM auth support was added to lib/pq -- currently forked as rapidloop/pq, but also submitted to lib/pq as PR lib/pq#788.

Neustradamus commented 2 years ago

@xianwum, @mdevan: Attention another PR has been merged in lib/pq: