Skip to content
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

Unable to login without password #5

Closed
MichaelDBA opened this issue Mar 7, 2018 · 6 comments
Closed

Unable to login without password #5

MichaelDBA opened this issue Mar 7, 2018 · 6 comments

Comments

@MichaelDBA
Copy link

pgmetrics -h 127.0.0.1 -p 5441 -U postgres --no-password example
pgmetrics: pq: unexpected error: "setting PGSYSCONFDIR not supported"

I have the right entries in .pgpass so this works:

psql -h 127.0.0.1 -p 5441 -U postgres example
psql (10.2 (Ubuntu 10.2-1.pgdg14.04+1))
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
@mdevan
Copy link
Contributor

mdevan commented Mar 7, 2018

Thanks for reporting. Can you try:

PGSYSCONFDIR= pgmetrics -h 127.0.0.1 -p 5441 -U postgres --no-password example

Is PGSYSCONFDIR set usually?

Also, if SSL connection is required, then:

PGSSLMODE=require PGSYSCONFDIR= pgmetrics -h 127.0.0.1 -p 5441 -U postgres --no-password example

@MichaelDBA
Copy link
Author

echo $PGSYSCONFDIR
/etc/postgresql-common

@mdevan
Copy link
Contributor

mdevan commented Mar 7, 2018

Thanks. Fixed in f7d944f. As a workaround, you've to unset (not just clear like I said above) the env. var.:

unset PGSYSCONFDIR
pgmetrics -h 127.0.0.1 -p 5441 -U postgres --no-password example

@MichaelDBA
Copy link
Author

That gets around the problem, but creates another side issue: pg_createcluster will not be able to find cluster defaults (create_cluster.conf) in the /etc/postgresql-common directory.

So I guess the workaround is unset PGSYSCONFDIR, and then set it again after executing pgmetrics.

@mdevan
Copy link
Contributor

mdevan commented Mar 7, 2018

Yes. You could also have a script:

#!/bin/bash
unset PGSYSCONFDIR
pgmetrics $@

or run it in parenthesis:

(unset PGSYSCONFDIR; pgmetrics -h 127.0.0.1 -p 5441 -U postgres --no-password example)

to avoid setting it back again.

@MichaelDBA
Copy link
Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants