0

When I am trying to install patroni , I can initialize database with md5 , all the cluster is working well. .

But when i tried to install patroni with initializing scram-sha 256 . It is not starting also status stay

"replica" for all database instancess in cluster. Also on patroni logs i can see this error ""postgres" does not have a valid SCRAM verifier" . What is the solution for this ?

Info : password_encryption is scram-sha 256 All hba.conf entries are scram-sha 256.

curios
  • 1
  • 1

1 Answers1

0

You have to set the configuration parameter password_encryption to scram-sha-256 before setting a password for the user PostgreSQL.

If you don't know how to do that initially, use trust authentication for the setup and modify that later, when you have set the SCRAM password.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • On my patroni yml ; on parameters; password_encryption : "scram-sha-256" on pg_hba: local all postgres scram-sha-256 host database user xxxx scram-sha-256 but when initialize the db i got a error : ""postgres" does not have a valid SCRAM verifier". It is easy to do trust and continue . I don't want to do it . I want to start patroni with scram-sha-256 . But I couldn't find the way. – curios May 07 '21 at 11:24
  • Did you set a password for the user? – Laurenz Albe May 07 '21 at 11:27
  • I am setting password in yml file like superuser: username: postgres password: STRONGPASSWORD , Am i doing it wrong ? – curios May 07 '21 at 12:09
  • Try the following experiment: use trust authentication and do everything else like you are doing it now. Then connect to the database and look at the password in `pg_authid`. Is there one? Is it MD5 hashed or SCRAM hashed? That should give you important information. – Laurenz Albe May 07 '21 at 12:14
  • It is hashed as SCRAM Laurenz,Thanks – curios Feb 11 '22 at 12:48