bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.01k stars 9.22k forks source link

Error messages from prometheus-exporter container #27858

Closed jankoh closed 4 months ago

jankoh commented 4 months ago

Name and Version

bitnami/postgresql 15.5.14

What architecture are you using?

amd64

What steps will reproduce the bug?

We configured the Bitnami PostgreSQL chart to export metrics for our Prometheus service. While this works with a new deployment to a clean namespace, I figured that our development namespace started throwing errors after updating to 15.5.14 from 15.5.13. I'm not completely sure if it is strongly related since the error messages started a couple of hours after the rollout:

ts=2024-07-06T13:16:47.257Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=127.0.0.1:5432
ts=2024-07-06T13:16:47.695Z caller=collector.go:176 level=error msg="Error opening connection to database" err="error querying postgresql version: pq: database \"myUser\" does not exist"
ts=2024-07-06T13:16:48.495Z caller=postgres_exporter.go:682 level=error err="Error opening connection to database (postgresql://myUser:PASSWORD_REMOVED@127.0.0.1:5432/?sslmode=disable): pq: database \"myUser\" does not exist"

Are you using any custom parameters or values?

We have set the following (skipped irrelevant parts):

postgres:
  auth:
    database: "service-database"
    username: "myUser"
    password: "secret"
  image:
    tag: "15"
  metrics:
    containerSecurityContext:
      enabled: true
      runAsGroup: 1001
    enabled: true
    serviceMonitor:
      enabled: true

What is the expected behavior?

We'd expect to find error messages in the logs.

What do you see instead?

We get those messages. Maybe it's due to auto-collecting database information from the exporter itself. So maybe the bug is within this tool itself, not the chart.

carrodher commented 4 months ago

The issue may not be directly related to the Bitnami container image/Helm chart, but rather to how the application is being utilized, configured in your specific environment, or tied to a specific scenario that is not easy to reproduce on our side.

If you think that's not the case and are interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

Suppose you have any questions about the application, customizing its content, or technology and infrastructure usage. In that case, we highly recommend that you refer to the forums and user guides provided by the project responsible for the application or technology.

With that said, we'll keep this ticket open until the stale bot automatically closes it, in case someone from the community contributes valuable insights.

jankoh commented 4 months ago

Well, the error indeed had to do with the Bitnami Chart. With 15.5.15 the error vanished. Source of the culprit was the line:

          env:
            - name: DATA_SOURCE_URI
              value: {{ printf "127.0.0.1:%d/?sslmode=disable" (int (include "postgresql.v1.service.port" .)) }}

in statefulset.yaml. The fix came with #27734, so thank you @KorenP1 :smiley:

I'll close this as resolved.

Best, Jan