incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Bug][Grafana-MySQL] The default Grafana connection doesn’t allow running queries.

Open Carloscampos9262 opened this issue 4 months ago • 1 comments

Search before asking

  • [x] I had searched in the issues and found no similar issues.

What happened

In Grafana, no dashboards are displaying data, and a red warning icon is shown with the message: 'Error when executing the SQL query'

The installation of the DevLake platform was carried out using the Helm tool on minikube and the values file with the following content:

version: 1.0-beta1 lake: encryptionSecret: secret: <Encription_Key> grafana: adminPassword: <Password> service: type: NodePort uiPort: 30006 ingress: enabled: true hostname: devlake.com.mx

What do you expect to happen

The expected result is that, after data collection in DevLake, the dashboards in Grafana should display information according to the data sources obtained from Jenkins or SonarQube

How to reproduce

SO: RHEL 8.10 (Ootpa) minikube version: v1.37.0

Values.yaml:

version: 1.0-beta1
lake:
  encryptionSecret:
    secret: <Encription_Key>
grafana:
  adminPassword: <Password>
service:
  type: NodePort
  uiPort: 30006
ingress:
  enabled: true
  hostname: devlake.com.mx

helm install devlake devlake/devlake -f values.yaml

Anything else

No response

Version

v1.0-beta1

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

Carloscampos9262 avatar Nov 05 '25 01:11 Carloscampos9262

Hi @Carloscampos9262! I'm Dosu and I’m helping the incubator-devlake team.

This issue is likely caused by a misconfiguration in the Grafana MySQL datasource. DevLake's dashboards require the datasource to connect to the MySQL service using the hostname mysql (not localhost). The default deployment for v1.0-beta1 sets this up via environment variables, but if the datasource in Grafana is still pointing to localhost:3306, queries will fail and dashboards won't display data.

To fix this, check the Grafana datasource configuration (in Grafana UI: Configuration → Data Sources → MySQL) and ensure the host is set to mysql:3306. If it's not, update it and save. If you are using Helm, make sure your deployment's environment variables (like MYSQL_URL) reference mysql:3306 as shown in the deployment YAML.

Also, confirm that the MySQL pod is running and accessible from the Grafana pod. If you continue to see errors, check the logs for both Grafana and MySQL for connection or authentication issues.

For more details, see the note in the QA Release Plan: "Make sure DB connection string uses host name mysql".

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

dosubot[bot] avatar Nov 05 '25 01:11 dosubot[bot]