Trouble Adding InfluxDB 2.0 as DataSource

Noob alert!.
I have 2 ubuntu 20.04 LXCs in proxmox running Influx 2.0 and Grafana. Influx receives data via telegraf agents running a bunch of windows/linux boxes. I’m trying to add this influx db as a datasource in Grafana but it doesnt seem to work. I’m not sure what I’m missing here.

If there anything that I need to do in Influx 2.0 to allow connections from Grafana?

Used the default token that was created when influx is setup. Tried both Org name and id. Tried switching buckets. Nothing seems to eowk.

Grafana Screenshot

Influx 2.0 buckets list

Hi there,
also noob alert ahead - i’v got the same problems.
I run a local server with Influx 1.0 and Grafana. This works very well. For my devices, especially the portable ones, I use an InfluxDB 2.0 cloud instance (azure). But I simply can’t integrate it due to the same problem.
Bucket names match, but always “error reading influxdb”

Any Ideas?

I started with Influxdb azure instance as well and failed to integrate with grafana, so I thought I’ll set it up influx locally. That apparently did not help. Is it possible that any of grafana/influx ports must be open to get this to work? Also @soerenhelms1 - any idea on log files that may have been created to debug what caused the connection failure?

Have added the HTTP request payload and response that I see after clicking “Save & Test”. Would be great if someone can read this and help us troubleshoot the problem. I also checked the log file in /var/log/grafana, but that doesnt seem to indicate any error establishing this connection.

Request Payload

{"datasource":{"id":1,"orgId":1,"name":"InfluxDB","type":"influxdb","typeLogoUrl":"","access":"proxy","url":"http://influx.cosmos:9999/api/v2","password":"","user":"","database":"","basicAuth":true,"basicAuthUser":"","basicAuthPassword":"","withCredentials":false,"isDefault":true,"jsonData":{"defaultBucket":"temp","httpMode":"POST","organization":"Infiverse","version":"Flux"},"secureJsonFields":{"token":true},"version":16,"readOnly":false},"id":1,"message":"Datasource updated","name":"InfluxDB"}

Response

{"results":{"test":{"error":"parse error on line 1, column 1: bare \" in non-quoted-field","refId":"test","series":null,"tables":null,"dataframes":null}},"message":"parse error on line 1, column 1: bare \" in non-quoted-field"}

Hi @rajivvishwa
i just checked my cloud instance but found no section to get a log or something. So understanding the problems seems to need either the influxdata support or a local instance.
If we get your local influxdb working that should also work for cloud.

I played around with Influx 2.0 REST API and it seems to work correctly with POSTMAN client. I’m guessing that the issue is with Grafana in our case. The HTTP response I posted earlier is returned by Grafana API, so I believe something weird is going on there. Surprised how we are the only ones with this issue.

{"results":{"test":{"error":"parse error on line 1, column 1: bare \" in non-quoted-field","refId":"test","series":null,"tables":null,"dataframes":null}},"message":"parse error on line 1, column 1: bare \" in non-quoted-field"}

The connection URL should be http://localhost:9999 instead of http://localhost:9999/api/v2.

I picked the api endpoint from grafana + influx 2.0 docs here - https://docs.influxdata.com/influxdb/v2.0/tools/grafana/. It looks like someone updated it just now with the correct URL format.