moxious / triage

testing triage actions for issues
0 stars 1 forks source link

Dashboard/Influxdb: multi values variables not escaped and break #216

Open tonypowa opened 8 months ago

tonypowa commented 8 months ago

What happened?

I have a multi value variable which contain list of path:

Capture d'écran 2023-12-20 165900

When using this variable inside a query I have this error:

image

And checking the generated query:


SELECT last("used") FROM "disk"

WHERE ("host"::tag =~ /^datsite$/ AND "path"::tag =~ /^/|/backups|/mnt/Backup1|/mnt/Backup2$/ AND "fstype"::tag != 'fuse.mergerfs' AND "fstype"::tag != 'cifs') AND $timeFilter

GROUP BY "device"::tag, "path"::tag

What did you expect to happen?

The query should look like this:


SELECT last("used")

FROM "disk"

WHERE ("host"::tag =~ /^datsite$/ AND "path"::tag =~ /^\/|\/backups|\/mnt\/Backup1|\/mnt\/Backup2$/ AND "fstype"::tag != 'fuse.mergerfs' AND "fstype"::tag != 'cifs') AND $timeFilter

GROUP BY "device"::tag, "path"::tag

Did this work before?

Yes, before upgrading to 10.2.3 (can't remember last version where it was working)

How do we reproduce it?

  1. Create a multi value variable where values contains /

  2. Create a query which use it

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: latest tag from docker

OS: Ubuntu

Browser: Chrome

Grafana platform?

Docker

Datasource(s)?

InfluxDB 1.8

tonypowa commented 8 months ago

This issue is a test copy of an issue in another repo. Original issue: https://github.com/grafana/grafana/issues/#79765

moxious commented 8 months ago

Summary: Issue #216 is open on the Grafana GitHub, where user tonypowa reports a problem with multi value variables containing paths not being properly escaped in queries after upgrading to Grafana 10.2.3. This results in errors during query execution. The expected behavior is for the paths to be correctly escaped, as it worked in previous versions.

moxious commented 8 months ago

Elaboration:

Thank you for providing a detailed description of the issue you're encountering. To better assist you, could you provide a few additional pieces of information, please?

  1. Could you confirm if the correct escaping of the paths worked in previous Grafana versions prior to 10.2.3?
  2. It would be helpful if you could provide the exact version number where the functionality last worked as expected.
  3. When creating the multi-value variable, can you indicate the method used for generating the list of paths?
  4. Are there any particular steps you take when upgrading to ensure settings and queries are preserved?
  5. If possible, could you share a screenshot of how the multi-value variable is configured in Grafana?
  6. Finally, do you receive the same error when trying different browsers or in incognito/private mode?

This additional information will help us pinpoint the issue and suggest appropriate solutions or workarounds. Thank you!

moxious commented 8 months ago

Hi @tonypowa, it looks like you're encountering an issue with multi-value variables in queries to InfluxDB. This appears to be related to escaping the path values correctly. This seems to be an issue that would best fit the Frontend Platform project since variable handling and query construction are typically managed on the frontend side of the application. I am tagging this issue for the frontend team to investigate.

{
 "projects": ["Frontend Platform project"]
}