Diagnosing the Issue

POSTGESQL FOR HELM: Getting SQLSTATE 28P01 password authentication failed for user in PostgreSQL

AuthorFullName__c
Brian Wood
articleNumber
000006095
ft:sourceType
Salesforce
FirstPublishedDate
2024-05-16T07:48:37Z
lastModifiedDate
2024-05-16T07:48:37Z
VersionNumber
1
If we are receiving an error in the log that we are unable to connect to the database such as:
server error (FATAL: password authentication failed for user "<user name>" (SQLSTATE 28P01))
then we need to validate the database password. We can do this by running the following kubernetes command to get the password from the secret:
kubectl get secret -n <namespace> <postgres secret name> -o jsonpath="{.data.postgresql-password}" | base64 --decode

Once we have the password we can enter the postgresql pod by doing the following:
kubectl exec -it <postgres pod name> -n <namespace> -- bash

Once we are in the pod do the following to verify the password:
psql -h xray-postgresql -U <user_name> -d <database_name>

If we can log in then we need to verify that the correct password was in the secret at the time the pods were starting up. If the password is invalid and we need to reset please follow the next section.