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

oVirt Grafana dashboards all blank #915

Open
WildStar2022 opened this issue Jan 27, 2024 · 5 comments
Open

oVirt Grafana dashboards all blank #915

WildStar2022 opened this issue Jan 27, 2024 · 5 comments
Labels

Comments

@WildStar2022
Copy link

Affected version

oVirt Engine: (oVirt Version 4.5.5-1.el8) (includes nightly update of oVirt-engine)

Describe the bug

SELinux is preventing /usr/sbin/grafana-server from name_connect access on the tcp_socket port 5432, resulting in all oVirt Grafana dashboards having no data.

To reproduce

n/a

Expected behavior

n/a

Screenshots

n/a

Additional context

Added this local policy to fix the issue:

ausearch -c 'grafana-server' --raw | audit2allow -M my-grafanaserver
semodule -X 300 -i my-grafanaserver.pp

@Ecsi1337
Copy link

Ecsi1337 commented Feb 6, 2024

/ovirt-test.local/ovirt-engine-grafana/datasources/edit/DS_OVIRT_DWH handler=/api/ds/query
logger=tsdb.postgres t=2024-02-05T14:42:09.434075498+01:00 level=error msg="query error" err="dial tcp [::1]:5432: connect: permission denied"

"
ausearch -c 'grafana-server' --raw | audit2allow -M my-grafanaserver
semodule -X 300 -i my-grafanaserver.pp
"

this solution didn't work for me

@WildStar2022
Copy link
Author

If your issue is indeed also with SELinux, have a look for a similar fix in your engine's /var/log/messages

Example:

messages-20240128:Jan 27 15:23:16 ovirt-engine setroubleshoot[5962]: SELinux is preventing /usr/sbin/grafana-server from name_connect access on the tcp_socket port 5432.#12#012***** Plugin catchall (100. confidence) suggests **************************#12#012If you believe that grafana-server should be allowed name_connect access on the port 5432 tcp_socket by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this access.#012Do#012allow this access for now by executing:#12# ausearch -c 'grafana-server' --raw | audit2allow -M my-grafanaserver#012# semodule -X 300 -i my-grafanaserver.pp#012

Hope that helps.

@Ecsi1337
Copy link

Ecsi1337 commented Feb 8, 2024

The entries referring to the error have successfully disappeared from /var/log/messages, but even though I set the log settings of the Grafana server and the Postgresql server to debug mode, I still cannot connect to the database. "db query error: failed to connect to server - please inspect Grafana server log for details" error. I can still log in successfully from the console with the command "psql -U ovirt_engine_history_grafana -d ovirt_engine_history -W -h localhost".

Do you have any other ideas?

@mwperina
Copy link
Member

mwperina commented Feb 8, 2024 via email

@0ffer
Copy link
Contributor

0ffer commented Apr 24, 2024

Hi everyone.
For grafana >= 9.2.10-15 version there is already included patch with selinux flag for grafana and postgresql.

And if you have grafana with correct version, you can enable it by hands with command semanage boolean --modify --on grafana_can_tcp_connect_postgresql_port

I created pr for enable this bool automatically during engine-setup: oVirt/ovirt-dwh#67

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

No branches or pull requests

4 participants