Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matrix-prometheus-postgres-exporter pg_ls_waldir permission denied error #3039

Open
joecool1029 opened this issue Dec 13, 2023 · 2 comments
Open

Comments

@joecool1029
Copy link
Contributor

Describe the bug

Dec 13 18:41:02 xwaretech.net matrix-postgres[32910]: 2023-12-13 18:41:02.352 UTC [111] STATEMENT:
Dec 13 18:41:02 xwaretech.net matrix-postgres[32910]: SELECT
Dec 13 18:41:02 xwaretech.net matrix-postgres[32910]: COUNT(*) AS segments,
Dec 13 18:41:02 xwaretech.net matrix-postgres[32910]: SUM(size) AS size
Dec 13 18:41:02 xwaretech.net matrix-postgres[32910]: FROM pg_ls_waldir()
Dec 13 18:41:02 xwaretech.net matrix-postgres[32910]: WHERE name ~ '^[0-9A-F]{24}$'
Dec 13 18:41:02 xwaretech.net matrix-prometheus-postgres-exporter[35638]: ts=2023-12-13T18:41:02.352Z caller=collector.go:199 level=error
msg="collector failed" name=wal duration_seconds=0.028922192 err="pq: permission denied for function pg_ls_waldir"

To Reproduce
My vars.yml file looks like this:

prometheus_enabled: true
prometheus_node_exporter_enabled: true
prometheus_postgres_exporter_enabled: true
grafana_enabled: true
matrix_synapse_metrics_enabled: true

Expected behavior
Expect to not see these errors.

Matrix Server:

  • OS: Ubuntu 22.04
  • amd64

Additional context
Looks to be this issue: bitnami/charts#20247 just not sure on best way to resolve issue.

@masikrus
Copy link

GRANT pg_monitor TO readonly_user;

@joecool1029
Copy link
Contributor Author

Ok so I did:

GRANT pg_monitor TO matrix_prometheus_postgres_exporter;

Error stopped happening (this had been going for weeks)

REVOKE pg_monitor FROM matrix_prometheus_postgres_exporter;

brings it back. Not sure if this is giving it too many permissions, but it will get it working granting it this role.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants