[bitnami/postgresql] Error with Postgres custom user
Name and Version
bitnami/postgresql:12.1.6
What architecture are you using?
None
What steps will reproduce the bug?
Deployed bitnami/postgresql:12.1.6 with this config for auth:
auth:
enablePostgresUser: true
username: antimatter_users
existingSecret: antimatter-iceberg-catalog-db
secretKeys:
adminPasswordKey: postgresql-password
userPasswordKey: postgresql-unprivileged-password
primary:
extraEnvVars:
- name: POSTGRES_MAX_CONNECTIONS
value: "500"
- name: PGPASSWORD
valueFrom:
secretKeyRef:
key: postgresql-password
name: antimatter-iceberg-catalog-db
Needed PGPASSWORD environment variable as I'm running a init sql script using postStart lifecycle hook
I can access postgres fine and do all of my operations as expected. Problem is that, in the logs, I'm getting errors:
2023-03-07 20:03:10.162 GMT [452] FATAL: password authentication failed for user "antimatter_users"
2023-03-07 20:03:10.162 GMT [452] DETAIL: Connection matched pg_hba.conf line 1: "host all all 0.0.0.0/0 md5"
What is the expected behavior?
Log from Postgresql does not contain any errors
What do you see instead?
2023-03-07 20:03:10.162 GMT [452] FATAL: password authentication failed for user "antimatter_users"
2023-03-07 20:03:10.162 GMT [452] DETAIL: Connection matched pg_hba.conf line 1: "host all all 0.0.0.0/0 md5"
Hello @ktw1016,
Could you try setting the following value to see if the behavior changes, please?
volumePermissions.enabled=true
I have also found a similar ticket from a while ago in case it can help you:
- https://github.com/bitnami/charts/issues/14683
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
Hi @corico44, sorry for late response.
I tried volumePermissions.enabled=true, however, running into issues as the cluster I'm working on prohibits running container as root. Do you have any possible workarounds in mind for this?
Hello @ktw1016,
Have you tried the different solutions that are proposed in #14683? Like this one for example:
What happens if you install the Helm chart by adding --namespace test --create-namespace so everything is deployed in a brand new namespace: test.
Hi @corico44, I don't permissions to create namespaces in the cluster..
@ktw1016,
I have found this other similar issue (#8469) where the following is said:
Could you ensure that you are not reusing persistent volumes from other PostgreSQL installations? Make sure that there are no PostgreSQL PVCs because then the password will not match (it will be using a random-generated password from another installation).
Could you check this, please?
@ktw1016,
I have found this other similar issue (#8469) where the following is said:
Could you ensure that you are not reusing persistent volumes from other PostgreSQL installations? Make sure that there are no PostgreSQL PVCs because then the password will not match (it will be using a random-generated password from another installation).
Could you check this, please?
Hi @corico44, I checked and the correct PVC is being used. Also followed the instructions on the linked issue which didn't fix my problems..
Hello @ktw1016,
I have opened an internal task to handle this problem. We will notify you in this ticket with any updates of the task. Thank you!