-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating InfluxQL Datasource to InfluxDB v2 returns Unauthorized(401) or InfluxDB Error: Bad Request #29372
Comments
Solution is to provide a header "Authorization" in the datasource: This should contain the value: "Token {token}" This is not described in the documentation (https://docs.influxdata.com/influxdb/v2.0/tools/grafana/), so I leave it open as a documentation issue. |
@eaglejohn81 if this is an issue in Influx docs you should create an issue with Influx as we are not responsible for maintaining that. |
When you say the header should have a value of "Token {token}", are the curly brackets { } part of the string? |
Just got it to work. The {} is not part of the string. |
@aocenas This is an issue with the InfluxDB data source in Grafana. When configured for query language Flux it will correctly ask for a token, but when configured for query language InfluxQL the field is missing. |
What happened:
After setup a clean GA version of InfluxDB 2.0.2, I created a dbrp mapping according
https://docs.influxdata.com/influxdb/v2.0/query-data/influxql/#map-unmapped-buckets and trying to create a Grafana datasource to the InfluxDB database according https://docs.influxdata.com/influxdb/v2.0/tools/grafana/.
This fails with "Unauthorized(401)" on Grafana 7.1.5 or "InfluxDB Error: Bad Request" on Grafana 7.3.4.
According the nginx access log, this query is executed (same for both cases, returning 401):
{ip} - influxdb [25/Nov/2020:11:26:14 +0000] "GET /query?db=30days&epoch=ms&q=SHOW+RETENTION+POLICIES+on+%2230days%22 HTTP/1.1" 401 48 "-" "Grafana/7.3.4"
When running this query using postman, I do get correct results:
{"results":[{"statement_id":0,"series":[{"columns":["name","duration","shardGroupDuration","replicaN","default"],"values":[["30days","0s","168h0m0s",1,true]]}]}]}
Environment:
The text was updated successfully, but these errors were encountered: