charts icon indicating copy to clipboard operation
charts copied to clipboard

[bitnami/postgresql] Error with Postgres custom user

Open ktw1016 opened this issue 2 years ago • 9 comments

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"

ktw1016 avatar Mar 07 '23 20:03 ktw1016

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

corico44 avatar Mar 14 '23 14:03 corico44

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.

github-actions[bot] avatar Mar 30 '23 01:03 github-actions[bot]

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.

github-actions[bot] avatar Apr 04 '23 01:04 github-actions[bot]

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?

ktw1016 avatar Apr 12 '23 16:04 ktw1016

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.

corico44 avatar Apr 14 '23 10:04 corico44

Hi @corico44, I don't permissions to create namespaces in the cluster..

ktw1016 avatar Apr 14 '23 18:04 ktw1016

@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?

corico44 avatar Apr 19 '23 16:04 corico44

@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..

ktw1016 avatar Apr 20 '23 13:04 ktw1016

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!

corico44 avatar Apr 27 '23 15:04 corico44