Persistence only working for minutes

Hello,

I have very recently upgraded my openHAB-Installation from 2.3 to 2.4 to be able to install some bindings. Since then (so I am guessing), my persistence is not working properly anymore. Directly after rebooting my computer, some data points are stored, then nothing…

My system:

  • Platform information:
    • Hardware: RaspberryPi 3B
    • OS: Openhabian
    • Java Runtime Environment: OpenJDK 1.8.0_152
    • openHAB version: 2.4.0 Release

Everything seems to be running just fine, just the visualization in Grafana using the influx-persistence is showing only a few points from after reboot. When I “just” restart openHAB, no new points are added.
In the log window I only see messages about item change events.

My influx.persist file:

Strategies {
    everyMinute   : "0   * * * * ?"
    every5Minutes : "*/5 * * * * ?"
    everyHour     : "0   0 * * * ?"
    everyDay      : "0   0 0 * * ?"
}

Items {
    gRaspberry*, gFritzbox* : strategy = everyMinute
    gSolar* : strategy = everyChange, everyMinute
    gPersist*   : strategy = everyChange, everyHour, restoreOnStartup
}

What I also noticed is a log message when I change and save the file - but only one time. For second and any further changes, no message is displayed.

I also have mqtt-persistence installed and get value updates as expected. ‘top’ shows influxd is taking some CPU (~22%), some something should be written - but what?

I don’t really know, where to search for a problem/solution and therefore, which further information might be useful. Any suggestions?

Thanks,
Roland

Look in InfluxDB’s logs. There might be some errors reported there.

Hello Rich,

where do I find the logs? There is a directory ‘/var/log/influxdb/’, but it is empty…

You’ll have to probably look in the InfluxDB docs or on their forum. While lots of us use InfluxDB, there are few of us here on this forum who are experts.

Ok, I found the logs. For reference:

sudo journalctl -u influxdb.service

If found no errors but I found logs for write commands from openhab “POST /write?..” - exactly for those datapoints that I see in grafana.
So my theory is that there is just no attempt to push data into influx. Is there some log in openhab for the communication with persistence services?

OK, that is good information. If there were an error occurring then I would expect to see errors in openhab.log. Look in events.log. Are the members of those Groups updating? Are they changing?

You can put the InfluxDB add-on into debug logging and watch the logs and see if it’s doing something or not.

When I go to the openHAB console (ssh to port 8101) and use

log:tail

I see the items updating.
Through

log:get openhab-persistence-influxfb

I get the information it is set to “ERROR” level. When I issue

log:set TRACE openhab-persistence-influxdb

and look again, it stays at “ERROR” (also tried with INFO and DEBUG).
How do I get debug messages?

After finding another post I did
log:set TRACE org.openhab.persistence.influxdb
This seemed to work (log:get returned TRACE), but I still see no messages except state change events…

Are these state change events supposed to be saved to InfluxDB? What I’m after is to see that OH is generating the update/changed/command events that are supposed to be saved to the DB and that the add-on is not generating errors.

Yes, the state change events should be saved.
With log level of the influx persistence set to TRACE I rebooted the system. For the same items I get messages from influx that their value is saved:

2019-05-03 19:35:43.747 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part

2019-05-03 19:35:43.752 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 1887.42

2019-05-03 19:35:43.756 [TRACE] [.internal.InfluxDBPersistenceService] - storing Solar_Grid_Power in influxdb value 1887.42, Solar_Grid_Power (Type=NumberItem, State=1887.42)

Despite from the start messages at the very beginning, these are the only message from influx I see. After a while (~1 minute) the influx messages stop.

When looking at the messages right after the last influx message, a thing from knx binding is being updated. Could this be a lead?

Yes and no. We know we’ve narrowed down the source of the problem pretty well to the InflusDB binding. I’ve no idea what the problem could be or how to fix it. I recommend filing an issue on the openhab1-addons repo (I think they are still hosted there). See How to file an Issue.

Ok. Thank you for your help.
Opened issue: https://github.com/openhab/openhab1-addons/issues/5857