Openhab 2.4.0 rrd4j inconsistent behaviour

  • Platform information:
    • Hardware: raspberry pi 2
    • OS: raspbian
    • Java Runtime Environment: 1.8
    • openHAB version: 2.4.0
  • Issue: charting rrd4j behaving badly. I have about 10 items defined to be persisted. In OpenHAB 2.3.0 I had no problems. Now only two items (light intensity) are shown in a chart. Other items in other charts are not shown. I have removed the persistence files, but that didn’t make any difference. log:set debug on rrd4j shows all the items are stored as I would expect. I don’t see any errors in the log file.
    The only chart that shows items is also a bit strange. I deleted the rrd file, so only the last hour should be visible. But I see 24 hours, with a constant value.

Anyone hints as how to debug this problem?

When you delete files but the data or the file somehow persist, that is a really good sign that your SD card is failing.

If the SD card were failing, I would expect errors in syslog or messages. I tried again: delete the rrd files, copied a big file (to make sure the new rrd files use other parts of the disk) and restarted OH.
Same strange behaviour: some items seem to work, others not (I checked with the REST API).

To be continued…

Why? When the SD card wears out that means that some but not all of the writes that are attempted simply do not occur. But there is no indication to the rest of the OS that the write failed. When SD cards fail, they do so mostly silently. If any errors are generated, it is because some needed file got corrupted, not because the OS notices that the write failed.

I had an SD card that failed and I discovered it because my logs stopped rotating. I would manually delete the log file but when I rebooted the log file came back.

Symptoms in my raspberry were different. A reboot did not restore deleted files. File deletion and creation seemed consistent. A fresh install of Openhab 2.4.0 solved the problem.

This implies that the delete of the rrd4j file didn’t actually happen.

No, the file was really gone after I deleted it. I monitored its existence and it was recreated at the time I started openhab (well… quite a few seconds later, because starting openhab takes some time). But the newly created file was badly initiated by Openhab/rrd4j is my guess.
I am quite sure the problems were in my setup. I made a big mess of it. It was a mixture of settings done through PaperUI, settings in cfg files and last but not least a custom karaf features.xml file (trying to load the needed bindings because I did not know they should/could go into a cfg file).

In fact I am quite happy now. Had some problems installing derby, didn’t know that, besides derby.jar, also derbyclient.jar was needed for the embedded driver.
And every now and then I get an unexplained 503 error in my rest request, but most of the time it runs without error. So that’s a minor issue.
:grinning: