RRD4J doesn't store any data

Hi,

I’m new to openhab and have tiny issue with rrd4j.
My setup is pretty straight forward: I have a KNX system and I’m controlling everything related to my heating with openhab. I’m using mapdb to persist the item values in order to have them survive a restart. This works like a charm.
Now I wanted to start logging temperature values to have some historic data. Unfortunately rrd4j doesn’t generate any rrd files. Any idea why?

I haven’t touched services/rrd4j.cfg (= it’s empty).
And here’s my persistence/rr4dj.persist:

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

Items {
        AUSSENTEMPERATUR : strategy = everyMinute
}

And the corresponding item definition:

Number AUSSENTEMPERATUR "Außentemperatur [%.1f °C]" <temperature>  {knx="<14/2/7"}

Karaf output of feature:list:

openhab-persistence-rrd4j                   | 1.10.0           | x        | Started     | openhab-addons-2.1.0    | RRD4j Persistence

Any ideas? What’s the best approach to debug this? How do I specifically turn on logging for rrd4j?

Thanks!

Are you certain AUSSENTEMPERATUR has a value and isn’t NULL? Does it show a value in your sitemap or does it show - instead of a number?

Have you tried a restart of OH just to make sure everything is cleanly running?

See http://docs.openhab.org/administration/logging.html for how to change the logging level of rrd4j.

Thanks for the swift reply.

Yes, the item does have a value. In my sitemap it works perfectly.
And I restarted OH a dozen times :slight_smile:

Should

log:set DEBUG org.openhab.persistence.rrd4j

enable logging?

That should work as well when logged into the karaf console.

I turned on logging now.

First finding: Seems like /var/lib/openhab2/config/org/openhab/rrd4j.config contained some old archives which I defined during testing. I cleared those now.

On startup I can now see that rrd4j uses it’s default archives default_numeric and default_other. But there were no items configured:

2017-10-19 09:51:18.065 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Created default_other = GAUGE heartbeat = 3600 min/max = NaN/NaN step = 1 6 archives(s) = [ MAX xff = 0.999 steps = 1 rows = 3600 MAX xff = 0.999 steps = 10 rows = 1440 MAX xff = 0.999 steps = 60 rows = 1440 MAX xff = 0.999 steps = 900 rows = 2880 MAX xff = 0.999 steps = 21600 rows = 1460 MAX xff = 0.999 steps = 86400 rows = 3650] 0 items(s) = []
2017-10-19 09:51:18.073 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Created default_numeric = GAUGE heartbeat = 60 min/max = NaN/NaN step = 60 6 archives(s) = [ AVERAGE xff = 0.5 steps = 1 rows = 480 AVERAGE xff = 0.5 steps = 4 rows = 360 AVERAGE xff = 0.5 steps = 14 rows = 644 AVERAGE xff = 0.5 steps = 60 rows = 720 AVERAGE xff = 0.5 steps = 720 rows = 730 AVERAGE xff = 0.5 steps = 10080 rows = 520] 0 items(s) = []

So I added the following line to my rrd4j.cfg for testing:

default_numeric.items=AUSSENTEMPERATUR,HEIZUNG_DUSCHE_RAUM_SOLL

Now I see the following on startup:

2017-10-19 23:08:22.228 [DEBUG] [sistence.rrd4j.internal.RRD4jService] - Created default_numeric = GAUGE heartbeat = 60 min/max = NaN/NaN step = 60 6 archives(s) = [ AVERAGE xff = 0.5 steps = 1 rows = 480 AVERAGE xff = 0.5 steps = 4 rows = 360 AVERAGE xff = 0.5 steps = 14 rows = 644 AVERAGE xff = 0.5 steps = 60 rows = 720 AVERAGE xff = 0.5 steps = 720 rows = 730 AVERAGE xff = 0.5 steps = 10080 rows = 520] 2 items(s) = [AUSSENTEMPERATUR HEIZUNG_DUSCHE_RAUM_SOLL ]
2017-10-19 23:08:22.235 [DEBUG] [org.openhab.persistence.rrd4j       ] - ServiceEvent REGISTERED - {org.openhab.core.persistence.PersistenceService}={service.pid=org.openhab.rrd4j, component.name=org.openhab.persistence.rrd4j, component.id=180, default_numeric.items=AUSSENTEMPERATUR,HEIZUNG_DUSCHE_RAUM_SOLL, service.id=300, service.bundleid=191, service.scope=bundle} - org.openhab.persistence.rrd4j
2017-10-19 23:08:22.329 [DEBUG] [org.openhab.persistence.rrd4j       ] - ServiceEvent REGISTERED - {javax.servlet.ServletContext}={osgi.web.symbolicname=org.openhab.persistence.rrd4j, osgi.web.version=1.10.0, osgi.web.contextpath=/, service.id=303, service.bundleid=191, service.scope=singleton} - org.openhab.persistence.rrd4j
2017-10-19 23:08:22.343 [DEBUG] [org.openhab.persistence.rrd4j       ] - ServiceEvent REGISTERED - {org.openhab.ui.chart.ChartProvider}={component.name=org.openhab.persistence.rrd4j.chartservlet, component.id=181, service.id=302, service.bundleid=191, service.scope=bundle} - org.openhab.persistence.rrd4j

So this doesn’t look too bad. Seems like the two items get assigned to the default_numeric archive and two “event listeners” get registered.

But rrd4j still doesn’t store anything. No rrd files are being generated.:slightly_frowning_face:

At the same time mapdb works just fine:

2017-10-19 23:11:05.523 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for AUSSENTEMPERATUR
2017-10-19 23:11:05.527 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored 'AUSSENTEMPERATUR' with state '11.700000000000001' in mapdb database

Any ideas?

Thanks!
Michael

Gentle ping - any ideas?

If I would have an idea,I would have posted. Sorry, all the suggestions I would have given you have already done.

The documentation suggests: "From time to time, you may find that if you change the item type of a persisted data, you may experience charting or other problems. To resolve this issue, remove the old <item_name>.rrd file in the ${openhab_home}/etc/rrd4j folder or /var/lib/openhab/persistence/rrd4j folder for apt-get installed openHABs."
However, I guess you tried that and your respective folder is empty.

Yep, the folder is empty.

My plan forward is to spin up a second instance of openHAB on my workstation with the same config and see if I run into the same issue there. If so, I’ll try to debug it. But first I have to figure out how to set up a dev environment. I hope the documentation is up-to-date :wink:

Setting up to IDE takes some time, especially if it is the first time for you.

Found an older thread with a suggestion to remove the “_” in an item-name in order to make rrd4j start persisting. It should be worth a try.
On the topic “naming restrictions” I’m actually scanning the code (with no luck so far) for real restrictions.

[Edit:] That gives evidence of my stupidity! I am using Items like “E10_1” which are persisted with rrd4j without any problem!:blush:

Also saw this old thread and already tried it. Didn’t solve the issue.

:frowning_face::frowning_face::frowning_face:

In order to help, could you post or PM the log from startup up to 20 minutes runtime? I have no clue what I’m looking, but…

Sorry, for the late reply. I was pretty busy in the last few days.

You can download the logs here.
But I would be surprised if you find anything. org.openhab.persistence.mapdb and org.openhab.persistence.rrd4j were set to loglevel DEBUG.

Thanks!

Good morning,
can’t look into the log from here.
however, the user in this thread, who seems to have been experiencing the same problem, concluded it might have been caused by the use of the Homegear binding. Although this is NOT confirmed, could you state your system specifics for hardware and the your used addons?

I’m using OH on a RaspberryPi 3 together with the KNX binding.

But I’ve now disabled everything and just set up a minimal demo case: In this config I have only one test item together with a rule which updates the test item every minute with a random int value. Even with this setup no data is stored with RRD4J.
Then I copied this config over to my Linux workstation (Ubuntu 17.10) and tried it there. Same issue.

You can download the demo config here. Feel free to try yourself. On my workstation and the Raspberry I was using OH installed from the APT sources (stable release).

Thanks!
Michael

I’m sorry, but ad said I’m out of ideas. (Can’the read the setup on my phone)

No problem. I don’t say that you have to have an answer. :slight_smile:
The good news is that we now have a minimal reproduction case. I’ll file a bug for that. Would be great if anyone else could try to reproduce it with mentioned config.

Did you file a bug yet?
I’ll be trying to get rrd4j working, total fail so far.