OH3 stable not working with Influxdb (1.8.4)

Influxdb (v1.8) persistence is not working for me in OH3. I have an instance of OH 2.4 running and it interacts perfectly with my influx server. I have installed instances of OH3 on both my Synology Docker and separately on a Pi (running one at a time). They target a second database in Influxdb. The permissions for both databases are the same.

In each OH3 instance, measurement labels are written to the db, but no values. OH 2.4 continues to perform perfectly on the same influx db server. To be clear, these are not measurementPoints with blank values. There is literally only one record in the database, and it is for the measurement label/name. In both cases, the settings in my persist files are followed without any problem. There is no restoreOnStartup setting.

Logs show update commands are issued from OH3, and the influx log shows the POST command executing and I do not see any errors. (I have not figured out how to change the Influx log level on either platform)

My best guess is that there is some defect in the construction of the POST that does not conform to the Influxdb line protocol and for some reason does not throw off an error. I am able manually to add values to Influxdb using the cli and the insert command, with no problems.

I am unable to see the actual line protocol commands sent to the server.

FOR OH3, in the OH TRACE log I see (first time using code fences here):

00:49:41.465 [TRACE] [e.influxdb.InfluxDBPersistenceService] - Storing item 2OfficeLt_OffOn (Type=SwitchItem, State=ON, Label=Off/On, Category=Switch, Tags=[Point], Groups=[2OfficeLt, gPersist]) in InfluxDB point InfluxPoint{measurementName='2OfficeLt_OffOn', time=2021-08-25T00:49:41.465386Z, value=1, tags={item=2OfficeLt_OffOn, label=Off/On, category=Switch, type=Switch}}

This is logged on the influx side as this:

"[httpd] - openhab [25/Aug/2021:00:49:41 +0000] "POST /write?db=openhab_2&rp=90_days&precision=n&consistency=o
ne HTTP/1.1" 204 0 "-" "okhttp/3.14.4" 5511c7b7-053e-11ec-822c-001132d2f82b 395207 "

FOR OH2, in the OH TRACE log I see:

18:15:03.291 [TRACE] [b.internal.InfluxDBPersistenceService] - storing isy_variable_4fbead30_state_38_value in influxdb value 580, isy_variable_4fbead30_state_38_value (Type=NumberItem, State=580)
This is logged on the influx side as this:

[httpd] - openhab [25/Aug/2021:01:15:03 +0000] "POST /write?consistency=one&db=openhab_db&p=%5BREDACTED%5D&pr
ecision=n&rp=90_days&u=openhab HTTP/1.1" 204 0 "-" "okhttp/2.4.0" e035da8a-0541-11ec-824e-001132d2f82b 255315     

I notice how this latter influx log entry uses both the -p and -u parameters, where the OH3 version uses neither. Also, it has no timestamp parameter, which by definition is optional in the line protocol.

In any case, the formats are obviously different, and I don’t know what to make of that.

I wonder if the timestamp parameter in OH3 is being translated to UTC format correctly?

Perhaps I just need help getting to a more granular logging level in Influxdb?

Have you read about how to do logging in Log and trace with InfluxDB | InfluxDB OSS 1.8 Documentation ?
In /etc/influxdb/influxdb.conf in logging section change

# level = "info"


level = "debug"

although I would expect to see errors being logged with the first option, too.

You should be able to find the influxdb log entries in the journal e.g. by running

journalctl  | grep influxdb

Als the measuremet labels are written - is there one value that get’s written too?
I might experience the same issue as you:

Green one is my OpenHAB 2.4, yellow one is my OpenHAB 3.1. At 18:36 o’clock I pushed my persistence configuration to the server, it wrote one value, but nothing since then. I can’t find an error in my configuration, and the logs don’t state one.

My versions: openHAB 3.1.0, infuxDB 2.0.8

Okay sorry for interruption - I got it working, it has been an error on my side: I forgot to define the groups I used for persisting. OpenHAB debug logging told me my mistake.

I’m sorry I can’t help with influxdb logging as the Queries from openHAB weren’t shown at my log verbosity and/or I watched the wrong log files.

So, an answer to my own question:

Data IS being stored in the database, but the required query structure has changed. The correct OH3 query format in my case is: "select value from “90_days”.“sOutdoorsTemp_Value”. In OH2 the query "select value from “sOutdoorsTemp_Value” worked fine: I did not need to add the retention policy “90_days” to the query. But if I omit it in OH3, it returns zero records. This is true even though “90_days” is set as my default retention policy.

Thanks for the suggestions.