[Bug] error Influxdb returned statuscode invalid status code: 400 Bad Request #7215

Closed
kisienya opened this Issue Jan 11, 2017 · 5 comments

Projects

None yet

3 participants

@kisienya
kisienya commented Jan 11, 2017 edited

Hi,

Much appreciate this useful tool.

  • What Grafana version are you using?
    Grafana v4.0.2
  • What datasource are you using?
    InfluxDB v1.1.1
  • What OS are you running grafana on?
    Fedora .x86_64
  • What did you do?
    Test an alert
  • What was the expected result?
    Success
  • What happened instead?
    error tsdb.HandleRequest() error Influxdb returned statuscode invalid status code: 400 Bad Request
    alert-result

Alert configuration
alert-config

Panel JSON

{
  "alert": {
    "conditions": [
      {
        "evaluator": {
          "params": [
            30
          ],
          "type": "lt"
        },
        "operator": {
          "type": "and"
        },
        "query": {
          "datasourceId": 3,
          "model": {
            "alias": "CP.Idle",
            "application": {
              "filter": ""
            },
            "dsType": "influxdb",
            "functions": [],
            "group": {
              "filter": ""
            },
            "groupBy": [
              {
                "params": [
                  "$interval"
                ],
                "type": "time"
              },
              {
                "params": [
                  "null"
                ],
                "type": "fill"
              }
            ],
            "host": {
              "filter": ""
            },
            "item": {
              "filter": ""
            },
            "measurement": "CPU",
            "mode": 0,
            "options": {
              "showDisabledItems": false
            },
            "policy": "default",
            "refId": "A",
            "resultFormat": "time_series",
            "select": [
              [
                {
                  "params": [
                    "value"
                  ],
                  "type": "field"
                },
                {
                  "params": [],
                  "type": "max"
                }
              ]
            ],
            "tags": [
              {
                "key": "host",
                "operator": "=",
                "value": "monitor-test.alkira.com"
              },
              {
                "condition": "AND",
                "key": "item_name",
                "operator": "=",
                "value": "CPU\\ idle\\ time"
              }
            ]
          },
          "params": [
            "A",
            "5m",
            "now"
          ]
        },
        "reducer": {
          "params": [],
          "type": "avg"
        },
        "type": "query"
      }
    ],
    "executionErrorState": "alerting",
    "frequency": "60s",
    "handler": 1,
    "message": "Check CPU Idle its below 30%",
    "name": "CPU Idle",
    "noDataState": "no_data",
    "notifications": [
      {
        "id": 1
      }
    ]
  },
  "aliasColors": {},
  "bars": false,
  "datasource": "influx-zab-srvs",
  "editable": true,
  "error": false,
  "fill": 1,
  "id": 3,
  "legend": {
    "avg": false,
    "current": false,
    "max": false,
    "min": false,
    "show": true,
    "total": false,
    "values": false
  },
  "lines": true,
  "linewidth": 1,
  "links": [],
  "nullPointMode": "connected",
  "percentage": false,
  "pointradius": 5,
  "points": false,
  "renderer": "flot",
  "seriesOverrides": [],
  "span": 6,
  "stack": false,
  "steppedLine": false,
  "targets": [
    {
      "alias": "CP.Idle",
      "application": {
        "filter": ""
      },
      "dsType": "influxdb",
      "functions": [],
      "group": {
        "filter": ""
      },
      "groupBy": [
        {
          "params": [
            "$interval"
          ],
          "type": "time"
        },
        {
          "params": [
            "null"
          ],
          "type": "fill"
        }
      ],
      "host": {
        "filter": ""
      },
      "item": {
        "filter": ""
      },
      "measurement": "CPU",
      "mode": 0,
      "options": {
        "showDisabledItems": false
      },
      "policy": "default",
      "refId": "A",
      "resultFormat": "time_series",
      "select": [
        [
          {
            "params": [
              "value"
            ],
            "type": "field"
          },
          {
            "params": [],
            "type": "max"
          }
        ]
      ],
      "tags": [
        {
          "key": "host",
          "operator": "=",
          "value": "monitor-test.alkira.com"
        },
        {
          "condition": "AND",
          "key": "item_name",
          "operator": "=",
          "value": "CPU\\ idle\\ time"
        }
      ]
    }
  ],
  "thresholds": [
    {
      "value": 30,
      "op": "lt",
      "fill": true,
      "line": true,
      "colorMode": "critical"
    }
  ],
  "timeFrom": null,
  "timeShift": null,
  "title": "CPU Idle",
  "tooltip": {
    "msResolution": false,
    "shared": true,
    "sort": 0,
    "value_type": "individual"
  },
  "type": "graph",
  "xaxis": {
    "mode": "time",
    "name": null,
    "show": true,
    "values": []
  },
  "yaxes": [
    {
      "format": "short",
      "label": null,
      "logBase": 1,
      "max": null,
      "min": null,
      "show": true
    },
    {
      "format": "short",
      "label": null,
      "logBase": 1,
      "max": null,
      "min": null,
      "show": true
    }
  ]
}
@torkelo
Member
torkelo commented Jan 16, 2017

you could turn on debug logging, then the influxdb query sent influxdb should be logged to grafana log output. Can you do that and print the query?

@bergquist
Contributor
bergquist commented Jan 17, 2017 edited

query

SELECT mean("value") FROM "CPU" WHERE "host" = 'name-of-server.com' AND "item_name" = 'CPU\ iowait\ time' AND time > now() - 5m GROUP BY time(200ms) fill(null)

My local influxdb returns

{"error":"error parsing query: found \\ , expected identifier, string, number, bool at line 1, char 92"}

Does the graph render correctly?

@kisienya

This is the query for the graph

SELECT max("value") FROM "CPU" WHERE "host" = 'name-of-server.com' AND "item_name" = 'CPU\ idle\ time' AND $timeFilter GROUP BY time($interval) fill(null)

@torkelo
Member
torkelo commented Jan 20, 2017

my guess it's the same issue that was fixed in #6765

Can you test latest 4.2 nightly build?

@torkelo torkelo closed this Jan 20, 2017
@torkelo torkelo added this to the 4.2.0 milestone Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment