No communication with influxdb 2.x

To advance to graphing wonderfulness in my OH 3.2.0 system I am attempting to set up influxdb (2.1.1) and am clearly having some communication issues.

I have set up influxdb and can log into the console at http://localhost:8086. It sure seems to be working.

The influx bundle is installed and verified it is active in the console. I’ve set the bundle to DEBUG but have had no entries.

My influxdb.cfg file is set up as such:

url=http://127.0.0.1:8086
user=<username>
password=<password>
db=openHAB_data
retentionPolicy=autogen

My influxdb.persist:

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

Items {
  ESP_Temp : strategy = everyMinute
}

(the item corresponds to a temperature sensor item I have set up).

Every minute I am logging the following message:

2021-12-30 16:38:00.466 [ERROR] [org.influxdb.impl.BatchProcessor    ] - Batch could not be sent. Data will be lost
org.influxdb.InfluxDBException: {"code":"unauthorized","message":"Unauthorized"}
at org.influxdb.InfluxDBException.buildExceptionForErrorState(InfluxDBException.java:175) ~[bundleFile:?]
at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:827) ~[bundleFile:?]
at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:460) ~[bundleFile:?]
at org.influxdb.impl.OneShotBatchWriter.write(OneShotBatchWriter.java:22) ~[bundleFile:?]
at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:340) [bundleFile:?]
at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:287) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]

I’ve verified that user names, passwords, database names all match between my .cfg and influxdb. I am hopefully missing something simple here?

Thanks!

What system are you running this on? Influxdb2 requires 64 bit. Are you running openhabian 64 bit on a rpi?

Hi, could have mentioned that up-front. Everything is running on top of Ubuntu Server 20.04 LTS. 64 bit

Aslo running 3.2.0. Although mine is influx 1.0, I’m not using influxdb.cfg.
Instead it is configured through the Settings UI under Other Services, Influx Persistence Service.

Thanks for the suggestion @brianlay. I did check there and the .cfg file is simply populating the fields on that page. But I did notice that there was a selection for Version 1 or 2 of the db, and 1 was selected. I changed it to 2 and my every minute error message blew up! But perhaps that’s a clue? New error message below:

2021-12-31 12:24:01.508 [ERROR] [.client.write.events.WriteErrorEvent] - The error occurred during writing of data
com.influxdb.exceptions.UnauthorizedException: unauthorized access
	at com.influxdb.internal.AbstractRestClient.responseToError(AbstractRestClient.java:98) ~[bundleFile:?]
	at com.influxdb.client.internal.AbstractWriteClient.toInfluxException(AbstractWriteClient.java:574) ~[bundleFile:?]
	at com.influxdb.client.internal.AbstractWriteClient.lambda$new$12(AbstractWriteClient.java:181) ~[bundleFile:?]
	at io.reactivex.internal.subscribers.LambdaSubscriber.onNext(LambdaSubscriber.java:65) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableDoFinally$DoFinallySubscriber.onNext(FlowableDoFinally.java:84) [bundleFile:?]
	at io.reactivex.internal.operators.mixed.FlowableConcatMapMaybe$ConcatMapMaybeSubscriber.drain(FlowableConcatMapMaybe.java:284) [bundleFile:?]
	at io.reactivex.internal.operators.mixed.FlowableConcatMapMaybe$ConcatMapMaybeSubscriber.onNext(FlowableConcatMapMaybe.java:137) [bundleFile:?]
	at io.reactivex.internal.operators.mixed.FlowableConcatMapSingle$ConcatMapSingleSubscriber.drain(FlowableConcatMapSingle.java:279) [bundleFile:?]
	at io.reactivex.internal.operators.mixed.FlowableConcatMapSingle$ConcatMapSingleSubscriber.innerSuccess(FlowableConcatMapSingle.java:179) [bundleFile:?]
	at io.reactivex.internal.operators.mixed.FlowableConcatMapSingle$ConcatMapSingleSubscriber$ConcatMapSingleObserver.onSuccess(FlowableConcatMapSingle.java:317) [bundleFile:?]
	at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:64) [bundleFile:?]
	at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:64) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableCollectSingle$CollectSubscriber.onComplete(FlowableCollectSingle.java:119) [bundleFile:?]
	at io.reactivex.internal.subscribers.BasicFuseableSubscriber.onComplete(BasicFuseableSubscriber.java:120) [bundleFile:?]
	at io.reactivex.internal.subscribers.BasicFuseableConditionalSubscriber.onComplete(BasicFuseableConditionalSubscriber.java:119) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableGroupBy$State.checkTerminated(FlowableGroupBy.java:686) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableGroupBy$State.drainNormal(FlowableGroupBy.java:626) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableGroupBy$State.drain(FlowableGroupBy.java:558) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableGroupBy$State.onComplete(FlowableGroupBy.java:548) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableGroupBy$GroupedUnicast.onComplete(FlowableGroupBy.java:474) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableGroupBy$GroupBySubscriber.onComplete(FlowableGroupBy.java:213) [bundleFile:?]
	at io.reactivex.processors.UnicastProcessor.checkTerminated(UnicastProcessor.java:430) [bundleFile:?]
	at io.reactivex.processors.UnicastProcessor.drainRegular(UnicastProcessor.java:314) [bundleFile:?]
	at io.reactivex.processors.UnicastProcessor.drain(UnicastProcessor.java:397) [bundleFile:?]
	at io.reactivex.processors.UnicastProcessor.onComplete(UnicastProcessor.java:487) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableWindowBoundarySupplier$WindowBoundaryMainSubscriber.drain(FlowableWindowBoundarySupplier.java:254) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableWindowBoundarySupplier$WindowBoundaryMainSubscriber.innerNext(FlowableWindowBoundarySupplier.java:166) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableWindowBoundarySupplier$WindowBoundaryInnerSubscriber.onNext(FlowableWindowBoundarySupplier.java:316) [bundleFile:?]
	at io.reactivex.processors.PublishProcessor$PublishSubscription.onNext(PublishProcessor.java:360) [bundleFile:?]
	at io.reactivex.processors.PublishProcessor.onNext(PublishProcessor.java:243) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.tryEmit(FlowableFlatMap.java:282) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$InnerSubscriber.onNext(FlowableFlatMap.java:668) [bundleFile:?]
	at io.reactivex.subscribers.SerializedSubscriber.onNext(SerializedSubscriber.java:100) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableWindowTimed$WindowExactBoundedSubscriber.drainLoop(FlowableWindowTimed.java:498) [bundleFile:?]
	at io.reactivex.internal.operators.flowable.FlowableWindowTimed$WindowExactBoundedSubscriber$ConsumerIndexHolder.run(FlowableWindowTimed.java:579) [bundleFile:?]
	at io.reactivex.Scheduler$Worker$PeriodicTask.run(Scheduler.java:479) [bundleFile:?]
	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) [bundleFile:?]
	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

Looks like some sort of authorization error. I think the DB can use either auth token or name/password but have no idea which method OH3 is using

I suggest deleting the binding and starting over.
I would get rid of the .cfg file and configure only with the UI settings

Thanks, @brianlay. That helped me fix the issue. It wasn’t that the .cfg was functioning inappropriately necessarily, but I did not have the data buckets within Influxdb set up correctly to receive the data. Using the UI settings page I was able to walk down each of the settings and follow the guidance for each, and discover my gaps.
I’m still so used to using files for management as under OH 2 that I still don’t fully utilize the settings pages of OH 3. I was relying on the documentation page for Influx and it’s lacking. But the way that the settings page is set up, it’s really its own documentation.

Glad it worked out!
Cheers and Happy New Year!

1 Like