OH3 authorization issues with influxDB2.0

Hi All
I’m having difficulty getting OH3 to authorize itself with my instance of influxDB 2.0.7

Setup as follows:

user: openhab
organization: warrimoo
bucket: warrimoo01

token is set up as All-Access
password is setup and working

influxDB persistence add-on is installed


# The database URL, e.g. or .
# Defaults to:
# The name of the database user, e.g. openhab.
# Defaults to: openhab

# The password of the database user.
# The name of the database, e.g. openhab.
# Defaults to: openhab

Note: I have left the token visible so that its structure can be seen particularly the use of dashes and equals signs. (The token has long since been deleted from my running system :slightly_smiling_face:)


Strategies {
    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"

Items {
    Miflora_OneDot_Light, Color1000_Temperature : strategy = everyMinute

I don’t think the issue is in the .persist file as I get the following error message from the influxdb.service on the influxdb server

msg=Unauthorized log_id=0VNsKDiW000 error="authorization not found"

I have tested the org/bucket/token combination from the influxdb-cli on the influxdb server and I can write data to the bucket using the token with no problem.

I have also tested write access to the bucket using postman from another machine and this also works fine. I will note that the token passing is a little twitchy…

Here’s the url

It also needs a separate header added for the token. The word “Token” is essential and it must be capitalized.

Key: Authorization
Value: Token Kc-1Nh0lIw3VyRTGE6Tww2Wo8AeKSBbSDnGS-_Z9aHH_woOKlrIuHGOT7xFzr_vn9z8z4qDFhb2ikdiGbQbreA==

In my attempts to connect OH3 to the influxdb server I have tried all possible variations of the influxdb.cfg file

No inverted commas - no spaces between keys and values i.e.


No inverted commas - spaces between keys and values i.e.

key = value

Single inverted commas - no spaces between keys and values i.e.


Single inverted commas - spaces between keys and values i.e.

key = 'value'

Double inverted commas - no spaces between keys and values i.e.


Double inverted commas - spaces between keys and values i.e.

key = "value"

I have my suspicions that the correct configuration entry syntax is

   No inverted commas - no spaces between keys and values

and that the existence of the “==” in the token is giving the config parser a problem.

I reason this way because

a) with single inverted commas around the token OH3 attempts to connect to influxdb and I get the authorization not found error

in combination with

b) without the inverted commas OH3 stops trying to access the influxdb server as if there was a config error

If anyone has any suggestions as to how this can be fixed I would be most grateful.
Perhaps there are escape sequences I can use?
Maybe the parser can be modified if that is the issue?

Many thanks in advance
Ian Carson

Have you tried configuring through the UI? Not saying this should be the only way (I can understand those who prefer config files), but it’s most of the time less error prone, and if it works there it could indicate that your suspicions are correct regarding the handling of special chars.

Edit: Looking at my /var/lib/openhab/config/org/openhab/influxdb.config (configured via UI) it looks like this:


I.e the =-signs are escaped using backslashes. Have you tried that?

Thanks for the pointer @pacive

I wasn’t aware of the UI configuration page until you mentioned it. I found it right at the bottom of the listings on the main Settings page and made some appropriate changes.

I also deleted /etc/openhab/services/influxdb.cfg so as to avoid possible conflicts

I did notice that the retention policy on the UI page would not retain the changes I made after pressing the save button. I think there is a bug here between the UI and the config file at /var/lib/openhab/config/org/openhab/influxdb.config

The config file shows the retentionpolicy key with a lowercase “p” but I suspect the mechanism to update the UI is looking for a key with an uppercase "P’ and as it doesn’t find it it doesn’t update the UI page.

I temporarily changed the key to have a “P” and restarted openhab eh voila the correct bucket name appears in the UI. I then reverted the key to having a lowercase “p” and once again restarted.

Now my data is flowing to influx, Fanstastic! :smiley:

Note: For those of you getting influxdb up and running also be aware that there is a section under Settings, System Services called “Persistence”. This allows you to set the default persistence system for openhab.

The standard RRD4J is there from the start but it looks like when the first new persistence model is added the default setting seems to get unchecked which turns off access to the data which provides the nice sparklines in the Item displays.

You’ll need to recheck the RRD4J entry to ensure that you retain data on those items the persistence for which is not being managed by your newly added persistence model

I’d like to correct my last post.

The changing of the key name in /var/lib/openhab/config/org/openhab/influxdb.config needs to be permanent to get the connection to work.


“retentionpolicy” should read “retentionPolicy”

otherwise the value reverts to “autogen” and the connection to influxDB2.0 fails