After several attempts, and investigating the request that the grafana sends, I saw that in the standard authentication model he was giving a bad request and receiving a timeout.
So putting together some tips from this thread, it worked that way.
I followed the config as described by you, but still get “Error reading InfluxDB”
Regarding the token, is it Token"+"Obtained tocken or TokenObtained tocken?
Thanks for your support.
I now debugged the requests coming from Grafana and my PHP application (some self-promotion: my request-handler helped a lot).
After I made sure that both requests are almost the same (by the way, the authorization is Token ${Token} - with a space), the request also failed in the PHP application with the message unauthorized. So the /health request does not require authentication (good to know), but the request api/v2/query does.
Now yes, there had to be a reason why the token from Kubernetes didn’t work and I found it. I took a look at /var/lib/influxdbv2/influxd.bolt which contains the admin token in plain text and it is different from the token in the Helm deployment. Probably I had not cleared the persistent storage after the first test deployment, so there was an old password/token. So I deleted the deployment and storage (since they were empty anyway) and set it up with a fixed, non-generated password and token. It worked immediately.
Query Language: Flux
URL: http://localhost:8086
Acces: Server (default)
Whitelisted coockies: (don't touch)
Auth
(don't touch)
Custom HTTP Headers
Header: Authorization
Value: Token aaabbbcccc
(the aaabbbccc is the token you find in Data > Tokens admin's Token, I think it is possible to create another member to secure the acces)
Organization: the_name OR the_id (it doesn't really matter)
Token: (same token who was given in value without the word Token in front)
Default Bucket doesn't matter
If you want to find you the error you have. Press F12 check console.
Normally you will have something like
Hi bbortolato, I have tried it but still getting this error message “Error reading InfluxDB”, I have even created a full access read/write token, but still not working. From Influxdb2 docker side I have following error message: ts=2021-06-09T16:55:56.005205Z lvl=error msg=“Unable to gather” log_id=0UaAcyRl000 error="Get “http://10.0.1.2:8086/metrics”: dial tcp 10.0.1.2:8086: i/o timeout. Can it be linked to the fact that my docker is running on synology nas? Br.
Be sure your InfluxData Token has READ permissions. By default, InfluxData generates tokens for Telegraf with WRITE permissions only. Reading your InfluxDB from Grafana Cloud requires READ permissions of course.