Hello guys,
Im having a problem when I use more than one query using WHERE to filter the data.
You can see in this screenshot that with one query works just fine ( I disable the second one).
But when I enable the second query it stops to work.
Please can someone help me?
Hi,
I think we might be having the same issue, there is a bug report here:
opened 08:01PM - 11 Apr 19 UTC
closed 09:32PM - 12 Apr 19 UTC
datasource/InfluxDB
needs more info
needs investigation
<!--
Please use this template while reporting a bug and provide as much info as… possible.
Questions should be posted to https://community.grafana.com
Use query inspector to troubleshoot issues: https://community.grafana.com/t/using-grafanas-query-inspector-to-troubleshoot-issues/2630
-->
**What happened**: when trying to use grafana + influxdb and the discret plugin grafana crashes when many metrics are used.
**What you expected to happen**: the panel to work without error
**How to reproduce it (as minimally and precisely as possible)**:
**Anything else we need to know?**:
Grafana logs with backtrace (I've expanded '\n' -> real newlines for readability):
```
Apr 11 19:12:21 mqtt-can-live grafana-server[9285]: t=2019-04-11T19:12:21+0100 lvl=eror msg="Request error" logger=context userId=10 orgId=1 uname=xxx@xxx.com error="net/http: abort Handler" stack="
/usr/local/go/src/runtime/panic.go:513 (0x434ed8)
/usr/local/go/src/net/http/httputil/reverseproxy.go:284 (0xa4ffd7)
/go/src/github.com/grafana/grafana/pkg/api/pluginproxy/ds_proxy.go:99 (0xed14bc)
/go/src/github.com/grafana/grafana/pkg/api/dataproxy.go:35 (0xf65db5)
/go/src/github.com/grafana/grafana/pkg/api/api.go:258 (0xf98cf3)
/usr/local/go/src/runtime/asm_amd64.s:522 (0x46350a)
/usr/local/go/src/reflect/value.go:447 (0x4c0978)
/usr/local/go/src/reflect/value.go:308 (0x4c0413)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x814a73)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x8143d9)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x830600)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x83051e)
/go/src/github.com/grafana/grafana/pkg/middleware/request_tracing.go:25 (0xb2b2fc)
/usr/local/go/src/runtime/asm_amd64.s:522 (0x46350a)
/usr/local/go/src/reflect/value.go:447 (0x4c0978)
/usr/local/go/src/reflect/value.go:308 (0x4c0413)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x814a73)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x8143d9)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x830600)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x83051e)
/go/src/github.com/grafana/grafana/pkg/middleware/request_metrics.go:17 (0xb2ac17)
/usr/local/go/src/runtime/asm_amd64.s:522 (0x46350a)
/usr/local/go/src/reflect/value.go:447 (0x4c0978)
/usr/local/go/src/reflect/value.go:308 (0x4c0413)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x814a73)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x8143d9)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x830600)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x83051e)
/go/src/github.com/grafana/grafana/pkg/middleware/session.go:15 (0xb2b601)
/usr/local/go/src/runtime/asm_amd64.s:522 (0x46350a)
/usr/local/go/src/reflect/value.go:447 (0x4c0978)
/usr/local/go/src/reflect/value.go:308 (0x4c0413)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x814a73)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x8143d9)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x830600)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x83051e)
/go/src/github.com/grafana/grafana/pkg/middleware/recovery.go:147 (0xb2ab30)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:79 (0x8304a0)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:157 (0x814760)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:135 (0x8144cb)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x830600)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x83051e)
/go/src/github.com/grafana/grafana/pkg/middleware/logger.go:34 (0xb2849d)
/usr/local/go/src/runtime/asm_amd64.s:522 (0x46350a)
/usr/local/go/src/reflect/value.go:447 (0x4c0978)
/usr/local/go/src/reflect/value.go:308 (0x4c0413)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x814a73)
/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x8143d9)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x830600)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/router.go:187 (0x840d44)
/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/router.go:303 (0x83b54e)
/go/src/github.c
Apr 11 19:12:21 mqtt-can-live grafana-server[9285]: om/grafana/grafana/vendor/gopkg.in/macaron.v1/macaron.go:220 (0x834ac1)
/usr/local/go/src/net/http/server.go:2741 (0x6b124a)
/usr/local/go/src/net/http/server.go:1847 (0x6ad605)
/usr/local/go/src/runtime/asm_amd64.s:1333 (0x465220)
"
Apr 11 19:12:21 mqtt-can-live grafana-server[9285]: 2019/04/11 19:12:21 http: multiple response.WriteHeader calls
Apr 11 19:12:21 mqtt-can-live grafana-server[9285]: t=2019-04-11T19:12:21+0100 lvl=eror msg="Request Completed" logger=context userId=10 orgId=1 uname=jasper@arcolaenergy.com method=GET path=/api/datasources/proxy/1/query status=500 remote_addr=x.x.x.x time_ms=12
```
The influxdb query, (I followed this guide to get it: https://community.grafana.com/t/how-to-troubleshoot-metric-query-issues/50):
```
https://xxx.com/grafana/api/datasources/proxy/1/query?db=arcola&q=SELECT distinct("value") FROM "alarm_warn_states_group_2.cathode_inlet_pressure_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.cathode_inlet_temperature_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.cathode_intercooler_temp_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.cathode_outlet_temperature_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.coil_temperature_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.coil_temperature_sensor_state_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.compressor_restart_timer_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.coolant_overpressure_vs_anode_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.coolant_overpressure_vs_cathode_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.cooling_3_way_valve_feedback_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.cooling_conductivity_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.cooling_inlet_pressure_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.cooling_inlet_temperature_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.cooling_outlet_temperature_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.cooling_radiator_outlet_temp_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.fluid_outlet_delta_T_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.heatsink_temperature_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.latched_protect_flags_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.lock_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.lockout_recovery_timer_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null);SELECT distinct("value") FROM "alarm_warn_states_group_2.logic_12V_supply_state" WHERE ("rmuid" =~ /^1004$/) AND time >= 1554996907523ms and time <= 1554997755882ms GROUP BY time(500ms) fill(null)&epoch=ms
```
I've tried the query in influx directly and it works and produces data.
**Environment**:
- Grafana version: v5.4.2 (d812109)
- Data source type & version: influxdb 1.6
- OS Grafana is installed on: Debian Stretch
- User OS & Browser: Debian Stretch & Firefox
- Grafana plugins:
- Others:
What versions of influxdb and grafana are you using?
I’m using v6.1.3 now. I guess was a problem with this new version.
I did some changes and now is working with this query:
A: SELECT “AccXAVG” FROM “measures” WHERE (“deviceID” =~ /^device /)
B SELECT “AccYAVG” FROM “measures” WHERE (“deviceID” =~ /^device /)
C SELECT “AccYAVG” FROM “measures” WHERE (“deviceID” =~ /^device /)
Thanks for your attention. You can close this issue.