Using old InfluxDB Java client with InfluxDB 2.7?

jedidia
Wed, 13 Dec 2023 11:05:31 +0000
InfluxDB 2

A lot of our codebase is using org.influxdb:influxdb-java:2.15 (which is for influxDB 1.x).
According to the github page, it should also work with the backwards compatibility API of influxDB 2.7.

However, I can’t get it to work. Connection seems to work (at least it doesn’t throw an error), but as soon as I send a query I get “Unautherized” back.
I tried using my username together with the password, as well as together with an API token. Both times same result.
I have also tried sending a request just by curl. Same result. I can’t authenticate with the backwards-compatibility endpoint. Do I have to activate it or open it or something (This is an OSS installation, btw, not cloud).

I have checked and confirmed that the DBRPS mapping exists:

		{
			"id": "d7145021f81a9a1c",
			"database": "yellow-bmetry",
			"retention_policy": "autogen",
			"default": true,
			"virtual": true,
			"orgID": "ba9404e4f918544c",
			"bucketID": "d7145021f81a9a1c"
		}

But still, if I curl the following query, I can’t get in, and neither can I get in with the Java client:

curl --get "http://localhost:8086/query" \
  --user "jedidia":"********" \
  --data-urlencode "db=yellow-bmetry" \
  --data-urlencode "q=SELECT * FROM bmetry-image-info"

Can anybody help me get this to work?

4 posts - 2 participants