Hi. I’m having an issue when trying to connect to my InfluxDB 2.0.3 instance through Grafana. When attempting to connect using InfluxQL, I get Network Error: (400). When attempting to connect with Flux, the connection works and I can query my buckets, so it doesn’t appear to be an issue with connecting to InfluxDB.
This is on a fresh test install setup specifically to try out Grafana and InfluxDB. I’ve followed this documentation on using Grafana alongside InfluxDB, using the InfluxQL tab’s instructions.
It is very possible that I’m misunderstanding something (I’m new to both Grafana and Influx), but this is how I’ve entered my information:
Query Language: InfluxQL URL: <influx_url> (tested working with Flux query language)
User (Basic Auth Details): kaden Password (Basic Auth Details): Auth token (retrieved from InfluxDB > Load Data > Tokens > kaden's Token
Database (InfluxDB Details): Bucket ID (not name) (retrieved from InfluxDB > Load Data > <bucket_id>'s id) Username (InfluxDB Details: kaden Password (InfluxDB Details): Same auth token used for Basic Auth Details HTTP Method: GET
It’s very possible that I’m misunderstanding something, but I’ve tried many combinations of usernames, passwords, I’ve reinstalled quite a few times, but yet nothing. Hopefully I can get some guidance here, thanks in advance
I’ve confirmed that the network is reachable - as I said, connecting using Flux instead of InfluxQL works fine. I’ve tried both over my public-facing domain, and using the Docker container hostname (http://influxdb:8086), both work for Flux and don’t for InfluxQL.
I’ve reset my database numerous times trying to get this to work, and through then I’ve used different password/usernames, still nothing.
Fixed it. Turns out I needed to include an HTTP Header, key “Authorization”, value “Token myToken”. I have no idea how I was supposed to know this, found no mention of it on the documentation, but it’s possible I missed something.
I couldn’t find any mention of these custom HTTP headers, even on the page I linked for the setup guide for InfluxDB 2.0 and Grafana, they reference an image which does not display these headers.
Could you point me to where the docs mention this so I know for future reference? Thanks
[quote=“kadenscott, post:8, topic:42757, full:true”]
You might be misunderstanding me - I’m referring to the Custom HTTP Headers, not the Basic Auth.
[/quo
no its all docued
I’m not saying it isn’t, would just like to know where as I didn’t see the requirements for custom HTTP headers referenced anywhere in the documentation, as I clearly missed something.
I can query the DB using the api like this and it works:
curl --get http://localhost:8086/query?db=example-db \
--header "Authorization: Token YourAuthToken" \
--data-urlencode "q=SELECT used_percent FROM example-db.example-rp.example-measurement WHERE host=host1"
Those configurations are the suggested ones in the documentation.
I also tried to brute force several combinations trying to find what could be wrong and nothing worked.
Hi Melrose, I have tried all the combination, but still cannot get it works, can you please if you have time help me to set it up? actually I am a newbie. thanks alot.
Hi gentelemen.
I am using InfluxDB 2.1.1 with Grafana 8.3.6.
With Flux activated I am able to access InfluxDB but I am not able to do so with InfluxQL.
I tried everything suggested in this thread without success but possibly I did something wrong.
So can somebody please provide a step by step how to set this up?
Thanks in further.
Make sure that when you past your token in the field, you have to include the word Token in front of that. It’s case-sensitive and as the token doesn’t display it’s hidden it might not be so obvious.