Influx 2.0.1 Issue

  • Platform information:
    • openHAB version: 2.5.11
  • Issue of the topic: please be detailed explaining your issue

I have an issue after an InfluxDB update. That brought me to version 2.0.1, and now, I can’t access the DB anymore correctly.

I use persistence-influxdb - 1.14.0.

The config file looks like this:

# The database URL, e.g. http://127.0.0.1:8086 or https://127.0.0.1:8084 .
# Defaults to: http://127.0.0.1:8086
url=http://127.0.0.1:8086

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

# The password of the database user.
password=xxxxxxxxx

# The name of the database, e.g. openhab.
# Defaults to: openhab
db=openhab_db

# The retention policy to be used, needs to configured in InfluxDB
# Till v0.13: 'default', since v1.0: 'autogen'

On startup I receive the following error messages:

2020-12-18 20:17:49.665 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate@1e400705': {"code":"unauthorized","message":"Unauthorized"}
java.lang.RuntimeException: {"code":"unauthorized","message":"Unauthorized"}
	at org.influxdb.impl.InfluxDBErrorHandler.handleError(InfluxDBErrorHandler.java:19) ~[?:?]
	at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:242) ~[?:?]
	at org.influxdb.impl.$Proxy162.query(Unknown Source) ~[?:?]
	at org.influxdb.impl.InfluxDBImpl.query(InfluxDBImpl.java:195) ~[?:?]
	at org.openhab.persistence.influxdb.internal.InfluxDBPersistenceService.query(InfluxDBPersistenceService.java:362) ~[?:?]
	at org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate.query(QueryablePersistenceServiceDelegate.java:52) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_275]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]

I needed to reconfigure Grafana, which uses Flux as query language. But openHAB is not able to post data into the repository.

Anyone experienced and solved similar issues?

1 Like

I don’t think this version supports influxdb 2 databases:

You will need the openHAB3 version of the persistence:

Wasn’t clear to me. So, I rolled back manually to version 1.8.3 which is running perfectly again.
Thank you!

Question: shall we use the openHAB3 version of the persistence even still on 2.5.11?

Stick to the 1.8.3 version of the persistence. Anything above won’t work on openHAB 2.5.

2 Likes