I recently switched to openhab 2 and first of all I’d like to say thanks for the good work to all involved.
Unfortunately it seems that in my setup all the rule related stuff that involves times is not working. First I faced this issue with openhab 2.1 and a cron based rule that should be triggered every 5 minutes but is never fired. After reading here that there are some issues with cron in version 2.1 I updated to 2.2 and I’m currently running build #1055 (openhabian on raspberry 2). Unfortunately the rule is still not fired even I can see in the log that it is scheduled.
Additionally another rule that creates a timer is also not working well because timer is created proberly (according to manual log messages) but never triggered.
Both rules worked well in openhab 1 so I guess it is not a problem with my code and I also tried to remove all productive code and only added log messages.
Unfortunately I still have problems understanding the new logging mechanisms using karaf console so I don’t know what exactly to activate to get a prober log that helps solving the issue.
Does anybody have an idea what I’m missing or what to change for logs to get a better information?
Hey Olti,
I don’t know of any issues. There were reports of cron rules triggering more than once but your case is different. I’d suspect an error in the config files.
Entering this in the Karaf console will help to monitor when the cron rules are executed too. When your done monitoring, rerun with DEBUG changed to OFF, INFO, or WARN.
There is talk on changing the scheduler, and there has been a couple fixes to the current one recently, but I don’t know if they are in the build you have or if they could be the cause. I’m on 2.2 snapshot 1054 and do not have this issue. Maybe get a newer build?
Could you try changing the rule suggested by @ThomDietrich to trigger on Time cron "0 0/1 * * * ?" and see if that fires the rule every minute? That is the format I use and works for my rules.
PS - Instead of Blockquote, use Preformatted Text for wrapping the logs… makes them much easier to read!
changing the cron expression didn’t change anything but it seems that your log which mentions QuartzSchedulerThread gave me the right hint. I remembered something related to the quartz thread count when setting up caldav binding for openhab 1. I gave it a try and changed the quartz thread count to 20 and now I can see the cron rule to be triggered.
Thanks for all your help.
BTW: Is there an easy way to reset logging settings to the defaults for everything?
There is a file called quartz.properties which is located under /usr/share/openhab2/runtime/etc/ or openhab-sys/runtime/etc if using the shares via Samba / Designer
I jumped into this topic, because I had a very similar issue.
I had literally this rule:
rule "Test chron"
when
Time cron "0 * 0 ? * * *"
then
logWarn("test", "triggered")
end
And it was not being triggered at all.
Eventually, I restarted the system, and it started working again.
I have no Thread::Sleep() in any rule, but I do have quite a lot of timers (made with CreateTimer).
Now, you mentioned that adding threads helped, but up to a certain point.
Is it possible that the two issues are related?
Checked after about 12 hours, and it stopped working again.
As a matter of facts, it seems that all cron rules stopped working: I have another rule, simply resetting an item state every day at 8AM, and I can see that the item state was not reset.
That rule stopped working about at the beginning of November; and I performed update to 2.4 M5 at about that time: maybe that could be the reason?