Cron not triggering

I have openhab 2.1 (latest stable) running and I wanted to set up some morning rules that should trigger every day at 3 AM. The rules are not triggered. If I set the trigger to run at a time in a few minutes, the rule is triggered - so my rules and cron syntax are correct. Also if I look at the logs (after setting org.quartz.core to DEBUG) I do not see anything, as if the cron timer is just ignored after some time.

I found some discussion here in the forum stating to switch to “the” 2.2 snapshot, but when I did that openhab would not start anymore… Is there anything I can do to get it working on 2.1?

My configuration:

  • RaspberryPi 3 with jessie.
  • Java 1.8.0_65-b17
  • openhab 2.1.0 release

Here is the relevant part of my rule:

val String LOG = "Alarms"

rule "SetAlarmTimers"
when 
    Time cron "0 0 3 * * ?"
then
    logInfo(LOG, "Setting alarm timers")
    ...
end

If I have to switch to some snapshot, could someone point me to a more detailed description of how to do it? (I only have basic linux knowledge)

Your java version is way too old (_65), you need at least _101 (current is _152 or something)

Thanks sihui!
I thought it would get updated automatically through apt-get. I updated to 1.8.0_151-b12 and now I see log entries showing that quartz acwuired the triggers (it also seems like openhab is starting faster).

1 Like

The trigger did not work today, but I think there was an issue initializing openhab (I had no log entries for the whole night…). I will check tomorrow and see.

If you are on a snapshot build #1083 to #1102, those where buggy and could have caused the problem. Upgrade to #1103 or newer to solve that problem.

No luck - they did not trigger. I am running 2.1 stable - are there known issues? I could only find something about triggers firing too often.

That is also the only thing I can remember.

In this thread are several hints you could try:

I coulldn’t find anything. I will try the latest 2.2 snapshot and see if that helps.

OK. Now I am on 2.2 #1106 and it still is not working. I have added the following rule:

rule "Test"
when
	Time cron "0 * * * * ?"
then
	logInfo("crontest.rules", "minutely cron rule seems to be working... ")
end

and after a reboot I get the following (after some startup stuff):

2017-12-03 15:58:00.039 [DEBUG] [org.quartz.core.JobRunShell         ] - Calling execute on job DEFAULT.Test.rules#Test#0 * * * * ?
2017-12-03 15:58:00.060 [DEBUG] [rg.quartz.core.QuartzSchedulerThread] - batch acquisition of 0 triggers
2017-12-03 15:58:00.077 [INFO ] [marthome.model.script.crontest.rules] - minutely cron rule seems to be working...
2017-12-03 15:58:18.482 [INFO ] [tzboxtr064.internal.PhonebookManager] - Downloading phonebook ID 0
2017-12-03 15:58:20.045 [DEBUG] [rg.quartz.core.QuartzSchedulerThread] - batch acquisition of 0 triggers
2017-12-03 15:58:20.058 [INFO ] [g.fritzboxtr064.internal.CallMonitor] - Callmonitor Thread [206] attempting connection to FritzBox on fritz.box:1012..
2017-12-03 15:58:20.063 [INFO ] [g.fritzboxtr064.internal.CallMonitor] - Connected to FritzBox on fritz.box:1012
2017-12-03 15:58:48.910 [DEBUG] [rg.quartz.core.QuartzSchedulerThread] - batch acquisition of 1 triggers
2017-12-03 15:59:20.079 [DEBUG] [rg.quartz.core.QuartzSchedulerThread] - batch acquisition of 1 triggers
2017-12-03 15:59:20.088 [DEBUG] [org.quartz.core.JobRunShell         ] - Calling execute on job DEFAULT.Test.rules#Test#0 * * * * ?
2017-12-03 15:59:20.097 [INFO ] [marthome.model.script.crontest.rules] - minutely cron rule seems to be working...
2017-12-03 15:59:24.048 [DEBUG] [org.quartz.core.JobRunShell         ] - Calling execute on job DEFAULT.2017-12-03T15:59:24.044+01:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {
  <XFeatureCallImplCustom>.apply(<XFeatureCallImplCustom>)
} ]
2017-12-03 15:59:24.064 [DEBUG] [rg.quartz.core.QuartzSchedulerThread] - batch acquisition of 1 triggers
2017-12-03 15:59:51.439 [DEBUG] [org.quartz.core.JobRunShell         ] - Calling execute on job DEFAULT.2017-12-03T15:59:51.437+01:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {
  <XFeatureCallImplCustom>.apply(<XFeatureCallImplCustom>)
} ]

notice, that now it’s 16:11, so that there should have been at least 10 more entries about my test rule.I am really lost now…

I just noticed though, that it seems like cron is working before my first timer fires and stops after that (I have a rule that starts a timer for an initialization task after 2 minutes of startup).