OpenHab3 with influxdb 2.1 persistence: "unauthorized access"

Setting up a brand new machine with the latest of everything.

  • Platform information:
    • OS: debian 11
    • Java Runtime Environment: OpenJDK Runtime Environment Zulu11.54+25-CA
    • openHAB version: 3.2.0
    • influxdb v2.1

Persistence is failing to connect to Influxdb

influxdb configuration is (I have trimmed the token):

# influx org list | grep shade
d2e8dc0d3b22984d	shade
# influx bucket list | grep enviro
ba66688e63b1cec8	enviro		infinite	168h0m0s		d2e8dc0d3b22984d	implicit
influx auth list | grep openhab3
ID			Description	Token User Name	User ID	Permissions
08f8562e2093c000	openhab3	00...==	admin		08f74450b593c000	[read:orgs/d2e8dc0d3b22984d/buckets/ba66688e63b1cec8 write:orgs/d2e8dc0d3b22984d/buckets/ba66688e63b1cec8]

openhab3 user should be able to connect to enviro bucket, org shade, using the “00…==” read/write token

Following the instructions for Influxdb V2 at InfluxDB (0.9 and newer) - Persistence Services | openHAB, I configured the influxdb service

#cat /etc/openhab/services/influxdb.cfg 

# name of Organisation in InfluxDB V2
# name of Bucket in InfluxDB V2

Restart openhab3, configure persistence for some items, and the openhab.log shows:

2022-02-25 12:25:37.240 [ERROR] [] - The error occurred during writing of data
com.influxdb.exceptions.UnauthorizedException: unauthorized access
	at com.influxdb.internal.AbstractRestClient.responseToError( ~[bundleFile:?]
	at com.influxdb.client.internal.AbstractWriteClient.toInfluxException( ~[bundleFile:?]
	at com.influxdb.client.internal.AbstractWriteClient.lambda$new$12( ~[bundleFile:?]

I tried using the admin token with all permissions, with same error resulting.


bucket = "enviro"
client = InfluxDBClient(url="http://localhost:8086", token="00...==", org="shade")

in a test python script connected to influxdb and wrote successfully.