[SOLVED] There is no queryable persistence service registered with the id 'rrd4j' error on upgrade to v2.4.0 snapshot

I’m running openHAB in a Docker Swarm, and have just upgraded from the 2.3.0-amd64-debian image to 2.4.0-snapshot-amd64-debian to start testing it out.

Most things appear to work, but I was getting the following error in the logs:

There is no queryable persistence service registered with the id 'rrd4j'

After much looking around, something I tried was to add the following to my conf/services/addons.cfg:

persistence = rrd4j,influxdb

And after restarting, things started working.

I had not yet checked in the Paper UI after upgrading (still used to do things on the command line), however when I did both rrd4j and influxdb were showing as “installed”.

So to try and diagnose, I removed the above line again, and restarted… and everything was OK, and checking the Paper UI, they are also showing as installed. Now it may have been that if I went to the Paper UI before modifying conf/services/addons.cfg I could have installed things there, but either way, it’s working now.

I’m posting here in case there is some sort of bug with the upgrade process, or if I didn’t install it correctly the first time.

If you want more info please let me know. I have included a couple of files for reference below as well:

cat ./services/rrd4j.cfg
# please note that currently the first archive in each RRD defines the consolidation
# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
# fully supported
#
# default_numeric and default_other are internally defined defnames and are used as
# defaults when no other defname applies

#<defname>.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],<heartbeat>,[<min>|U],[<max>|U],<step>
#<defname>.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],<xff>,<steps>,<rows>
#<defname>.items=<list of items for this defname>
cat ./persistence/rrd4j.persist
Strategies {
	everyMinute : "0 * * * * ?"
	everyHour 	: "0 0 * * * ?"
	everyDay	: "0 0 0 * * ?"
	default = everyMinute
}
Items {
	// persist everything when the value is updated, just a default, and restore them from database on startup
	* : strategy = everyMinute, restoreOnStartup
}

Usually this happens only on startup because your rules are already trying to use the persistence service but it is not loaded yet.
If this is shown in the logs after openHAB has fully started I would start to troubleshoot …

It’s a little bit out off topic, but anyway.
I am reading myself through books about docker and thinking that the docker swarm, if not Kubernetes, would be ideal for setting a fault tolerant openhab solution.

Could you a little bit explain how your setup looks like and what your experiences are.

Based on my experience, Docker Swarm is great. Now Kubernetes is much easier to deploy, I think it maybe better - especially for multi-node fault tolerance - but I have not used it, so can not say.

I found it takes a bit to wrap my head around all of the concepts. (I went straight into Docker Swarm, and kind of missed the Docker thing). Some pointers that I use for myself:

  • A Docker container is not a VM, rather it’s an encapsulated process running on the host (I came from using a LOT of VM’s for dev, so thing took some getting used to). So the overhead is minimal.
  • Nodes in a Docker swarm can all speak with each other via host name - no need to have everything running on a separate port (eg: all HTTP services just run on port 80). I can then access openHAB using the host name “openhab”, and Docker takes care of it.
  • If you want to access things within the swarm, then you do need to open up a port into the swarm. I have an Nginx reverse proxy to get to all of my internal services (I actually have 2, one for my swarm internal services, and one for things I expose on the internet behind an authenticated reverse proxy - this is what I wrote and use: https://github.com/sillyfrog/magicreverseproxy )
  • There are some limitations - eg: you can get broadcast traffic - so if you want to have something like HomeKit, you’ll need to break it out of the swarm (I found the openHAB implementation a bit lacking, so actually run this https://github.com/hobbyquaker/homekit2mqtt - again in docker, but not in a Swarm for this reason).
  • Be careful, every time you redeploy, everything will update to the latest release - often good, but if running snapshots it can be… bad… I’m now running the M5 snapshot release. But to be safe, I build a docker container, which is literally just “FROM openhab/openhab:2.4.0.M5-amd64-debian” - and tag it, and if I want to update, I do a rebuild of this image.
  • InfluxDB with Grafana is awesome - and running in Docker makes it so simple - highly recommend.
    That’s everything I can think of off the top of my head - if you have any more questions, feel free to ping me (or maybe we can start a new thread if we go into more detail in case it’s of value to others).

Good luck!

1 Like