yandex / odyssey

Scalable PostgreSQL connection pooler
BSD 3-Clause "New" or "Revised" License
3.18k stars 161 forks source link

Unable to login to console with specific user #112

Open ruimarinho opened 4 years ago

ruimarinho commented 4 years ago

There seems to be an issue authenticating to the console which might be affecting other storage access as well.

Using the default user config:

database "console" {
  user default {
    authentication "scram-sha-256"
    pool "session"
    storage "local"
    password "SCRAM-SHA-256$4096:GLAdwVrwJbBWuelDVpk08A==$gWDLvs77eKR+d+3qvGoUtDvqCLDBxL5MrOpoDD9OBWY=:o0mJmT12PA8A1pCyGtKufaKFVkS6vVgPbb8cTZYNK70="
  }
}
❯ psql -h 127.0.0.1 -p 6432 -U pgbouncer -d console
Password for user pgbouncer:
psql (12.1, server 9.6.0)
Type "help" for help.

127.0.0.1 pgbouncer@console=> \q

Using the specific user with the same config:

database "console" {
  user "pgbouncer" {
    authentication "scram-sha-256"
    pool "session"
    storage "local"
    password "SCRAM-SHA-256$4096:GLAdwVrwJbBWuelDVpk08A==$gWDLvs77eKR+d+3qvGoUtDvqCLDBxL5MrOpoDD9OBWY=:o0mJmT12PA8A1pCyGtKufaKFVkS6vVgPbb8cTZYNK70="
  }
}
❯ psql -h 127.0.0.1 -p 6432 -U pgbouncer -d console
Password for user pgbouncer:
psql: error: could not connect to server: ERROR:  odyssey: c3d64ee2d11a8: password authentication failed
ruimarinho commented 3 years ago

@x4m using the most recent commit, the behaviour is different now.

database "console" {
  user "admin" {
    authentication "scram-sha-256"
    pool "session"
    storage "local"
    password "SCRAM-SHA-256$4096:L1dG5V1xHF/qBJTT3zXPrQ==$KWWhyusPu9Exb76O13xmRwijxbtObhK583t3pBBrBJM=:De1WJ/Vz641RyXAFxHPh8F1X6ZwOBUcsKNfCljlDicE="
  }
}

Using

❯ psql -h localhost -p 6432 -U admin -d console
psql (13.1, server 9.6.0)
Type "help" for help.

localhost admin@console=>

...does not ask for a password. With md5, it asks for the password.

pratikbin commented 2 years ago

@ruimarinho Can you print storage stanza please