influxdata / ui

UI for InfluxDB
94 stars 42 forks source link

Queries no longer return data #2004

Open Yuvashkenazi opened 3 years ago

Yuvashkenazi commented 3 years ago

Steps to reproduce: I don't know how to reproduce this bug.

Expected behavior: Queries from the Explore section of the UI return results.

Actual behavior: All queries sent through the Explore section of the UI (using both script editor and query builder) return the following error message: compilation failed: extern json parse error: missing field `value` at line 1 column 849

Environment info:

Additional info:

I looked on the developer tools Network tab and found that the requests that the queries send return a 400 bad request. I found an object called extern in the payload which looks relevant to the error message, it is posted below:

    "extern": {
        "type": "File",
        "package": null,
        "imports": null,
        "body": [
            {
                "type": "OptionStatement",
                "assignment": {
                    "type": "VariableAssignment",
                    "id": {
                        "type": "Identifier",
                        "name": "v"
                    },
                    "init": {
                        "type": "ObjectExpression",
                        "properties": [
                            {
                                "type": "Property",
                                "key": {
                                    "type": "Identifier",
                                    "name": "StationId"
                                },
                                "value": {
                                    "type": "StringLiteral"
                                }
                            },
                            {
                                "type": "Property",
                                "key": {
                                    "type": "Identifier",
                                    "name": "timeRangeStart"
                                },
                                "value": {
                                    "type": "UnaryExpression",
                                    "operator": "-",
                                    "argument": {
                                        "type": "DurationLiteral",
                                        "values": [
                                            {
                                                "magnitude": 1,
                                                "unit": "h"
                                            }
                                        ]
                                    }
                                }
                            },
                            {
                                "type": "Property",
                                "key": {
                                    "type": "Identifier",
                                    "name": "timeRangeStop"
                                },
                                "value": {
                                    "type": "CallExpression",
                                    "callee": {
                                        "type": "Identifier",
                                        "name": "now"
                                    }
                                }
                            },
                            {
                                "type": "Property",
                                "key": {
                                    "type": "Identifier",
                                    "name": "windowPeriod"
                                },
                                "value": {
                                    "type": "DurationLiteral",
                                    "values": [
                                        {
                                            "magnitude": 5000,
                                            "unit": "ms"
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            }
        ]
    }
phdd commented 3 years ago

I confirm this issue.

{
  "query": "from(bucket: \"****\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"****\"] == \"****\")\n  |> filter(fn: (r) => r[\"****\"] == \"****\")\n  |> aggregateWindow(every: 1m, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
  "extern": {
    "type": "File",
    "package": null,
    "imports": null,
    "body": [
      {
        "type": "OptionStatement",
        "assignment": {
          "type": "VariableAssignment",
          "id": {
            "type": "Identifier",
            "name": "v"
          },
          "init": {
            "type": "ObjectExpression",
            "properties": [
              {
                "type": "Property",
                "key": {
                  "type": "Identifier",
                  "name": "bucket"
                },
                "value": {
                  "type": "StringLiteral",
                  "value": "****"
                }
              },
              {
                "type": "Property",
                "key": {
                  "type": "Identifier",
                  "name": "MA_Range"
                },
                "value": {
                  "type": "StringLiteral",
                  "value": "1m"
                }
              },
              {
                "type": "Property",
                "key": {
                  "type": "Identifier",
                  "name": "Min_Rel_Treshold"
                },
                "value": {
                  "type": "StringLiteral"
                }
              },
              {
                "type": "Property",
                "key": {
                  "type": "Identifier",
                  "name": "Max_Rel_Treshold"
                },
                "value": {
                  "type": "StringLiteral",
                  "value": "0.9"
                }
              },
              {
                "type": "Property",
                "key": {
                  "type": "Identifier",
                  "name": "timeRangeStart"
                },
                "value": {
                  "type": "UnaryExpression",
                  "operator": "-",
                  "argument": {
                    "type": "DurationLiteral",
                    "values": [
                      {
                        "magnitude": 1,
                        "unit": "h"
                      }
                    ]
                  }
                }
              },
              {
                "type": "Property",
                "key": {
                  "type": "Identifier",
                  "name": "timeRangeStop"
                },
                "value": {
                  "type": "CallExpression",
                  "callee": {
                    "type": "Identifier",
                    "name": "now"
                  }
                }
              },
              {
                "type": "Property",
                "key": {
                  "type": "Identifier",
                  "name": "windowPeriod"
                },
                "value": {
                  "type": "DurationLiteral",
                  "values": [
                    {
                      "magnitude": 10000,
                      "unit": "ms"
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    ]
  },
  "dialect": {
    "annotations": [
      "group",
      "datatype",
      "default"
    ]
  }
}
kristinarobinson commented 3 years ago

@Yuvashkenazi -- Can you confirm whether you are using Cloud or OSS (open source) UI? Thanks!

Yuvashkenazi commented 3 years ago

@Yuvashkenazi -- Can you confirm whether you are using Cloud or OSS (open source) UI? Thanks!

I am using OSS

phdd commented 3 years ago

@kristinarobinson I use OSS as well.

kristinarobinson commented 3 years ago

Thanks for the information, routing to the correct team.

kristinarobinson commented 3 years ago

@dgnorton ... one for your team.

Yuvashkenazi commented 3 years ago

Any updates or workarounds for this? We've been using Postman but would like to get back to using the UI. Thanks!

all-sd commented 2 years ago

I had the same issue. Under "Boards" is a default board names "System". There I have defined a variable "bucket" with inside the select was a invalid value. After changing it to a valid value, everything get back working.

tennox commented 2 years ago

Thanks for the tip with the variables... I had to re-select my choice of aggregation window variable in the dashboard's variables (weird enough that even explore was totally broken).

Happened to me after migration from 2.0 beta to stable

ljani commented 2 years ago

I had the same issue. Under "Boards" is a default board names "System". There I have defined a variable "bucket" with inside the select was a invalid value. After changing it to a valid value, everything get back working.

Many thanks! I went through all the boards in the UI and made sure each variable was set and this fixed the Explore tab as well.