After upgrading to 2.5 stable, my openhab rules are periodically reloading.
Hardware: Rapsberry pi 3b+
OS: Raspbian GNU/Linux 9 (stretch)
Java Runtime Environment: openjdk version “1.8.0_222”
openHAB version: 188.8.131.52
This behaviour started between 2.5 M5 and M6. I reported this here.
I had to downgrade to M5 to get Openhab usuable again. As RC1 had a MQTT bug, I was unable to test RC1. Now in 2.5 stable the problem is back.
What I am seeing is the same behaviour as when an item definition is changed, i.e by editing an items file. If that happens - as far as I can tell - rule files that are relevant to that item get reloaded. However, I am not touching my items in any way.
Note that the reloading of rules as a result of editing an item is something different from a change to a rules file itself. If that happens you get a corresponding line in your log file. This does not happen when a rule reloads as a result of edits to an item.
The reason that I know that my rules are being reloaded is that all my rule files have code similar to the following:
rule "System started Rule radiators"
logInfo("System started Rule", "radiators done")
What I am seeing is my rules get reloaded for no apparent reason. It might be that this is affecting other people as well, however, I am assuming most people won’t have the above code in their rule files. What they would probably see is cpu usage periodically spiking as openhab reloads rules and/or lags.
After downgrading to 2.5 M5, the behaviour is gone again. Does anybody have an idea what is going on, or how to debug this?
Thank you. addons.cfg seems to be all commented out with #marks. I looked at addons.config. That is harder to judge. The file is below, but I do not know what I am looking for. I’m not seeing addons that I’m not using.
An alternative interpretation based on the evidence - not reloading
(you are missing the logs that might produce), but simply triggering System started, as detected by your rules.
It’s a subtle difference but leads to possibly different causes.
I do think my rules are reloading, as i see the cpu going up to roughly 100%. The same as when my rules are loading when openhab starts. However, I agree, the only think I know for sure is that a System started event is triggered.
To make things weirder, not all rules have the System started event triggered. I am looking into what the rules that have their System started event triggered and those that don’t have in common or how they differ. For the moment, I dont see a pattern.
I have made a log of them and will report if something changes, However, I do not think they are changing for the reason you state. As far as I can tell the last edit was made on December 12. That corresponds to the timestamps that I see in the daily backups of my openhab configuration.
Careful - some backup tools do touch files. I forgot to say that you should also check xxx.items files timestamps, an expected cause of “system started” trigger without rules loaded logs, and you may as well complete the set with any xxx.things files.
It’s not entirely clear if you have seen this problem since that ‘current’ timestamp of 12/12, but I presume so since you could not have updated to 2.5 release at that date.
Hi, thanks for all the help. The reloads are quite frequent. In fact the latest reload just started 10 minutes ago. I do not think there is a connection with the daily backup process. BTW I use the openhab backup script.
I can see reloads at:
Looking at this list the reloads seem to trigger every 2 hours. Is there a something in openhab running every two hours? I have checked
my cron jobs, nothing with a two hour trigger
all my rule files for cron triggers, nothing with a two hour trigger.
exec binding things, nothing that runs automatically
OpenWeatherMap, runs on a 10 minute cycle
Buienradar binding (rain forcast in the Netherlands), runs on a 5 minute cycle
Systeminfo binding (60 minutes)
What could explain the 2 hour cycle? BTW I see that when I previously reported the problem, there also was a 2 hour cycle. However, back then the minute the cycle started was not roughly 24 like today, but roughly 11. This makes me think that it is either linked to openhab or linux starting.
There’s nothing like that in OH by default unless you coded something yourself like a timer.
I’d suggest to install openHABian from scratch to another SD card and copy your config over. That may or may not show the same behavior but that way you can be sure it’s not some obscure part of the OS to cause that.
I will do that, however since updating to 2.5 I downgraded to 2.5 M5 a couple of times. If I do that, the problem goes away. If I upgrade to 2.5 stable the problem reappears like clockwork. As I said, I will give it a try if only to exclude possibilities.
Well, I do have tasker which uses rest calls. However, nothing on a 2 hour cycle, purely event driven. In addition my router posts a mqtt message when a phone connects to it. Other than that, I have a few cron jobs, posting the results to a REST call, however, that is not anywhere as often as on a two hour cycle.
I dont see any Loading model messages after the initial loading on startup, but from the behaviour it feels like openhab would internally reload them or doing some other weird stuff every other hour. A threads --list gave me only some pool thread 5 as the one with the most cpu time…
Is there any way to dig deeper? I’d be happy to do so, but I don’t know the commands…