Can't get default persistence to work again

I installed MapDB addon and uninstalled again. Since then, my graphs are showing no history of data anymore. I don’t know how I can get default persistence to work again with rrd4j.

What I checked:

  • Default persistence service is RRD4j. There is also no other selection.
  • I don’t have any .persist files. I never created any.
  • conf/services/rrd4j.cfg exists but contains only commented lines. I didn’t touch this.
  • settings of rrd4j add-on is

    I added restoreOnStartup after I uninstalled MapDB. Not sure if this was there before.
  • I restarted OpenHAB.

Any idea what I need to do to get default persistence with RRD4j working again?

Do you have the file $OH_USERDATA/jsondb/org.openhab.core.persistence.dto.PersistenceServiceConfigurationDTO? If so please post it’s contents.

1 Like

Maybe this might help?

I didn’t se the persist.cfg files just the Ui.

Yes. It still also contains mapDB

{
  "mapdb": {
    "class": "org.openhab.core.persistence.dto.PersistenceServiceConfigurationDTO",
    "value": {
      "serviceId": "mapdb",
      "configs": [],
      "defaults": [
        "everyChange",
        "restoreOnStartup"
      ],
      "cronStrategies": [
        {
          "name": "everyMinute",
          "cronExpression": "0 * * ? * *"
        },
        {
          "name": "everyHour",
          "cronExpression": "0 0 * * * ?"
        },
        {
          "name": "everyDay",
          "cronExpression": "0 0 0 * * ?"
        }
      ],
      "thresholdFilters": [],
      "timeFilters": [],
      "equalsFilters": [],
      "includeFilters": [],
      "editable": false
    }
  },
  "rrd4j": {
    "class": "org.openhab.core.persistence.dto.PersistenceServiceConfigurationDTO",
    "value": {
      "serviceId": "rrd4j",
      "configs": [],
      "defaults": [
        "everyChange",
        "restoreOnStartup"
      ],
      "cronStrategies": [
        {
          "name": "everyMinute",
          "cronExpression": "0 * * ? * *"
        },
        {
          "name": "everyHour",
          "cronExpression": "0 0 * * * ?"
        },
        {
          "name": "everyDay",
          "cronExpression": "0 0 0 * * ?"
        }
      ],
      "thresholdFilters": [],
      "timeFilters": [],
      "equalsFilters": [],
      "includeFilters": [],
      "editable": false
    }
  }
}

Thank you. I can try that but I hope to get the initial state back where OpenHab just uses rrd4j without additional configuration.

Did you upgrade to OH4?

Mine stopped working after I upgraded and then I out the items into the group and persisted the group and all is working again.

Good luck.

No, upgrading to 4 wasn’t the issue. As explained in the first post I installed MapDB addon and removed it again after figuring out that I don’t need it. Persistence to rrd4j stopped working in this change, I believe right after uninstalling MapDB.

I can still see the data from before, but no new data is being added.

I use both mapdb and rrdj4 because rrdj4 only persists numbers but I need it because it does the graphs.

For my install I do not have mapdb I only use RRd4j and I do not have that file on my system at all.
org.openhab.core.persistence.dto.PersistenceServiceConfigurationDTO
I also have a rrd4j.cfg file that is all commented out.
you might try to either remove the entry that refers to mapdb if it is not installed or maybe completely remove that file all together as a test .
I would also restart after what ever action you take as well may not be needed but can’t hurt.

1 Like

I tried to remove the whole file while OpenHab was shut down, but OpenHab outsmarts me:

[re.storage.json.internal.JsonStorage] - Json storage file at ‘/var/services/homes/openhab/openhab-4/userdata/jsondb/backup/1703251403090–org.openhab.core.persistence.PersistenceServiceConfiguration.json’ is used (backup 1).

The backup contains exactly the same configuration.

I also tried to leave only the rrd4j entry in the file. Still no luck with default persistence.
Also none of the files in userdata/persistence/rrd4j were touched in the past three days.

Finally default persistence works again: I removed userdata/jsondb/org.openhab.core.persistence.PersistenceServiceConfiguration.json and all backup files from the jsondb/backup directory, then I started OpenHab again.

Thank you, @rlkoshak and @justaoldman, I wouldn’t have thought of that file. Anything I could have done from the UI to fix or better prevent this? I didn’t expect the installation and uninstallation of a persistence service to cause a lasting change to my system.

Without having tested this, but I guess deleting the RRD4J persistence configuration should have solved that. RRD4J didn’t persist anything, because you had a persistence configuration for it and that config did not include any Items. If there is no configuration for RRD4J, it persists everything (this is the state you restored by deleting the Persistence configuration JSONDB file).

I guess my mistake was to ever press Save on this screen “Create persistence configuration” for RRD4J.

I haven’t seen a way to delete the configuration again from the UI.

If you have created a persistence config (the page display „Edit persistence configuration“ as heading), you have a remove button at the bottom of the page (the same as for all other UI stuff like Items):

2 Likes