Startup error for all cron based rules

I get this error msg during startup for all my rules with a cron time trigger on restart of OH2 without a system restart. They seem to run fine however.

Something is out of order. Not sure if on shutdown, OH2 is not canceling the current jobs. Not a linux expert so not sure if this is an issue with my setup or OH2.

PS Running tinycore linux

Any idea?

From log
Started dashboard at /start
2016-09-23 07:43:09.518
[ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘set ss’: Unable to store Job : ‘DEFAULT.clark.rules#set ss#0 0 4 1/1 * ? *’, because one already exists with this identification.

I get the same errors with my two timer rules. But the rules are working as expected.

Any ideas?

Thx.

Also have the same problem.

1 Like

Can this be reproduced with the demo setup (which also includes cron-based rules)?

Not exactly. I do not get the same errors for the demo rules. But when you resave demo.items and OH2 starts refreshing demo.items I get the error for all my rules again even though my items have not changed. Guessing it just reloads all items even though it does not say it in the log.

To further clarify, any time I refresh an items file I get the errors but not on rules file update. I also get the same errors twice about 10 secs apart in the log.
Is there a way to enable trace level logging inside ruletriggermanager. Setting openhab logger to trace did not give me any ideas?

Edit
Upon further testing, when I comment out all items in my items file I do not get the error. Now I am hunting for the issue inside my items file. No errors in the logs.

did you get any results? I reinstalled my Openhab2, and just used the same rules which worked in my last oh2 installation, now they dont work anymore. Nearly the same Snapshotrelease. How is this possible?

2016-11-02 06:32:48.911 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘’: Unable to store Job : 'DEFAULT.Wohnung.rules##0 01 23 ? * MON-FRI’, because one already exists with this identification.

in this rule i use some also some timers.

Edit: No timer at all works, if i comment the cron jobs out, it gives me no error message at all.

is it possible that somehow there is already something using this rule???

it also tells me twice that it refreshes the rule, but in fact i did it only once
2016-11-02 11:01:47.462 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'Wohnung.rules’
2016-11-02 11:01:48.032 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘Wohnung.rules’

I get the same error, here are some lines from the log:
2016-11-04 17:34:23.524 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Pulsecounter node 2 reset to zero’: Unable to store Job : ‘DEFAULT.mb.rules#Pulsecounter node 2 reset to zero#0-3 0 00 * * ?’, because one already exists with this identification.
2016-11-04 17:34:23.538 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Sunset group off’: Unable to store Job : ‘DEFAULT.mb.rules#Sunset group off#0 0 23 * * ?’, because one already exists with this identification.
2016-11-04 17:34:23.549 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Sunrise group on’: Unable to store Job : ‘DEFAULT.mb.rules#Sunrise group on#0 30 6 * * ?’, because one already exists with this identification.
2016-11-04 17:34:24.353 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Pulsecounter node 2 reset to zero’: Unable to store Job : ‘DEFAULT.mb.rules#Pulsecounter node 2 reset to zero#0-3 0 00 * * ?’, because one already exists with this identification.
2016-11-04 17:34:24.392 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Sunset group off’: Unable to store Job : ‘DEFAULT.mb.rules#Sunset group off#0 0 23 * * ?’, because one already exists with this identification.
2016-11-04 17:34:24.403 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Sunrise group on’: Unable to store Job : ‘DEFAULT.mb.rules#Sunrise group on#0 30 6 * * ?’, because one already exists with this identification.

Because I am setting up and testing Openhab2 there are quite a few restarts to change configurations so I am guessing that the system (or I) should do some cleaning after shutdown but I have not been able to figure out where. Any advice will be much appreciated.

Yes this looks as the same problem for me.
Due to the fact that nowone here seems to have an answer and i did not face this bug on an other device with nearly the same openhab2 version i will try to just reinstall openhab2 maybe something went wrong

I have just converted a well working 1.8.3 installation to 2.0.0.b4 and everything seems to work well with the exception of the cron jobs (that always worked under 1.x.x). A sample from the logs is listed in an earlier post above and another later in this post. One of the very simple rules which gives the trouble is:

rule "Sunset group off"
when
Time cron “0 0 23 * * ?”
then
sendCommand (gSunset, OFF)
sendCommand (isNight_start, ON)
end

An example of the error message is:
2016-11-09 09:42:09.896 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Sunset group off’: Unable to store Job : ‘DEFAULT.mb.rules#Sunset group off#0 0 23 * * ?’, because one already exists with this identification.

So at restart there seems to be stored jobs blocking the start of a new cron job (exactly the same as for other posts in this thread).

I have searched through the entire Openhab installation without being able to find any references mentioned in the error message. The storage of these jobs thus is hidden somewhere in the database/binaries. Maybe there is a Karaf console command to find them but at my current knowledge of this tool I am unable to figure this out.

I have also tried to find if anything might be stored among the “normal” cron jobs but found nothing related to user openhab or user root (runs on a Pi as a service as described in the documentation for Linux ) .

I am not skilled enough to go any further into the code unfortunately why I am stuck here (and so seems others be as well) and as it has been working for a long time on 1. versions my assumption is that it is a bug.

I think Openhab is a great system which suits my requirements well so many thanks for all efforts from you and the team.

i did also a total new installation with purge but still the same problem.

the only mistake i did during my installation was something with my root rights but i think i fixed it and cant think thats the problem here.

Let’s hope that someone knowing the system can answer. In the meantime I have had to go back to 1.8.3 which works flawlessly.

I tried to reproduce it yesterday, but it only happened once and then not again.

Can you really confirm that you see it reliably on every single start of the runtime?

Yes, it has been reproducible. I even made an upgrade according to the procedure in the Linux documentation (i e the conf and userdata was copied back from a backup) and at startup the error was back again. So it seems that somewhere there are stored cron jobs which can not be overwritten/erased.

Now I have openhab 2 running as a “slave” to the 1.8.3 installation using the eventbus functionality so I just restarted it and the info from the log is:

2016-11-11 12:56:25.494 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule 'Pulsecounter node 2 reset to zero': Unable to store Job : 'DEFAULT.mb.rules#Pulsecounter node 2 reset to zero#0-3 0 00 * * ?', because one already exists with this identification.
2016-11-11 12:56:25.515 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule 'Sunset group off': Unable to store Job : 'DEFAULT.mb.rules#Sunset group off#0 0 23 * * ?', because one already exists with this identification.
2016-11-11 12:56:25.523 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule 'Sunrise group on': Unable to store Job : 'DEFAULT.mb.rules#Sunrise group on#0 30 6 * * ?', because one already exists with this identification.
2016-11-11 12:56:26.237 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule 'Pulsecounter node 2 reset to zero': Unable to store Job : 'DEFAULT.mb.rules#Pulsecounter node 2 reset to zero#0-3 0 00 * * ?', because one already exists with this identification.
2016-11-11 12:56:26.256 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule 'Sunset group off': Unable to store Job : 'DEFAULT.mb.rules#Sunset group off#0 0 23 * * ?', because one already exists with this identification.
2016-11-11 12:56:26.264 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule 'Sunrise group on': Unable to store Job : 'DEFAULT.mb.rules#Sunrise group on#0 30 6 * * ?', because one already exists with this identification.

The openhab2 runs as user openhab and service openhab2 according to the Linux docs. I earlier tried to run as root as well to see if there are permission issues but the error messages still came.

So it is reproducible.
Many thanks for your effort to solve this problem.

I have the same problem. First i thought the reason was the upgrade of to pixel raspbian. So i got back on one of the older releases. I made 3 new installations and everytime i had this problem but only with my existing rule file. I made a new, very simple one, it does not give an exeption, but does also not work.
At the moment i try to figure out if this problem only occures when i use a rule with a timer and a cron job.

I post an example rule tomorrow

Hello,
I see the same at every runtime start. See example below and many more entries like this:

19:34:11.700 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Licht Konsole AN’: Unable to store Job : ‘DEFAULT.awhs.rules#Licht Konsole AN#0 10 21 * * ?’, because one already exists with this identification.
19:34:11.702 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Licht Konsole AUS’: Unable to store Job : ‘DEFAULT.awhs.rules#Licht Konsole AUS#0 58 22 * * ?’, because one already exists with this identification.

Regards,
Marcel

I get the same messages, although the cron jobs/rules run fine. I’m running OH2 on two different platforms and get almost identical error messages:

Laptop running Ubuntu 16.04

2016-11-12 16:03:33.507 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Mag50_10.sitemap’
2016-11-12 16:03:37.085 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘update time’: Unable to store Job : ‘DEFAULT.Power.rules#update time#0 0/5 * * * ?’, because one already exists with this identification.
2016-11-12 16:03:38.509 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Fan Run Values for Graphing’: Unable to store Job : ‘DEFAULT.Bathroom.rules#Fan Run Values for Graphing#0 0/3 * * * ?’, because one already exists with this identification.
2016-11-12 16:03:38.516 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Check Time’: Unable to store Job : ‘DEFAULT.Bathroom.rules#Check Time#2 * * * * ?’, because one already exists with this identification.
2016-11-12 16:03:39.267 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Radio Alarms’: Unable to store Job : ‘DEFAULT.NodeAlarms.rules#Radio Alarms#0/59 * * * * ?’, because one already exists with this identification.
2016-11-12 16:03:40.061 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘update time’: Unable to store Job : ‘DEFAULT.Power.rules#update time#0 0/5 * * * ?’, because one already exists with this identification.
2016-11-12 16:03:40.595 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Fan Run Values for Graphing’: Unable to store Job : ‘DEFAULT.Bathroom.rules#Fan Run Values for Graphing#0 0/3 * * * ?’, because one already exists with this identification.
2016-11-12 16:03:40.602 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Check Time’: Unable to store Job : ‘DEFAULT.Bathroom.rules#Check Time#2 * * * * ?’, because one already exists with this identification.
2016-11-12 16:03:41.071 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app

and Raspberry PI

2016-11-12 16:00:46.262 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at /start
2016-11-12 16:00:46.494 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Radio Alarms’: Unable to store Job : ‘DEFAULT.NodeAlarms.rules#Radio Alarms#0/59 * * * * ?’, because one already exists with this identification.
2016-11-12 16:00:46.655 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Fan Run Values for Graphing’: Unable to store Job : ‘DEFAULT.Bathroom.rules#Fan Run Values for Graphing#0 0/3 * * * ?’, because one already exists with this identification.
2016-11-12 16:00:46.661 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Check Time’: Unable to store Job : ‘DEFAULT.Bathroom.rules#Check Time#2 * * * * ?’, because one already exists with this identification.
2016-11-12 16:00:46.696 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘update time’: Unable to store Job : ‘DEFAULT.Power.rules#update time#0 0/5 * * * ?’, because one already exists with this identification.
2016-11-12 16:00:46.773 [ERROR] [e.internal.engine.RuleTriggerManager] - Cannot create timer for rule ‘Radio Alarms’: Unable to store Job : ‘DEFAULT.NodeAlarms.rules#Radio Alarms#0/59 * * * * ?’, because one already exists with this identification.
2016-11-12 16:00:46.801 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.

I have gone through the latest logs and after another reinstallation behavior has changed to be as Wayne Stronach describes, i e the logs show failures at startup but the cron jobs have started to work (which they did not do before).
Can not find any reasonable explanation because the installs were identical but one way or another something has changed. But in any case there seems to be something giving an instability with the cron jobs. Will watch this closely during the next few days.

mhm this is so frustrating. At the moment close to every rule with timers, astro or whats ever is time based works for me.
Something is realy not working at all. Sometimes some rules work, i have no idea why

can confirm same behavior running OH2 under windows

I think I have arrived at a point where the entire 1.8.3 system is converted and works on OH2 (even if there are errors in the logs). The two last areas giving problems were the 2.0 Astro binding and an Aeon Multisensor . I had to replace the Astro binding with the 1.9 version. Also, somewhere it was stated that the functionality is reading these Astro items only, no swithches etc. are working.

Last item giving problems was the motion sensor of an Aeon multisensor which did work when looking at the Control in Paper UI and also did forward to the eventbus broker but nothing showed up in the eventbus log and nothing was triggered by a motion event. When changing the item from Contact to Switch everything started to work. In 1.X.X I had used Contact for years so there are small changes which may affect quite a bit.

Most likely this may not be of any help to you but I mention it just in case. It may pay off to look at the heaps of forum posts, docs and also change items and observe the differences if any (which I guess you may have gone through already).