eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 783 forks source link

Rule “System started” runs twice #5188

Open hr3 opened 6 years ago

hr3 commented 6 years ago

After powerON at Raspi3 openHABian 2.3.0 Build #1218

rule "System started"
when
  System started
then
  logInfo("_","System started")
  ...
end
openhab.log
2018-02-22 07:43:53.141 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2018-02-22 07:43:53.541 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-02-22 07:43:54.033 [INFO ] [b.core.service.AbstractActiveService] - Expire Refresh Service has been started
2018-02-22 07:44:11.039 [INFO ] [org.eclipse.smarthome.model.script._] - System started
2018-02-22 07:44:11.039 [INFO ] [org.eclipse.smarthome.model.script._] - System started
2018-02-22 07:44:11.106 [INFO ] [lipse.smarthome.io.net.exec.ExecUtil] - executed commandLine ...

After restart or reboot and on windows-installations it runs correctly once.

lolodomo commented 6 years ago

Unfortunately that is a known bug, rules are often run several times at startup. The startup process with dependencies between components is not yet fully reliable.

hr3 commented 6 years ago

Thanks, but that's a big problem. In this case the hole rule-file doesn't run correct and I have to solve manualy. Is there a way to realize and solve automaticly?

...
2018-03-07 15:24:06.328 [INFO ] [b.core.service.AbstractActiveService] - Expire Refresh Service has been started
2018-03-07 15:24:21.603 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'Index' on rule file 'home.rules' cannot be initialized with value 'newArrayList(<XUnaryOperationImplCustom>,<XUnaryOperationImplCustom>,<XUnaryOperationImplCustom>)': The name 'newArrayList' cannot be resolved to an item or type; line 23, column 13, length 22
2018-03-07 15:24:21.609 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'NextEvent' on rule file 'home.rules' cannot be initialized with value 'newArrayList(<XNumberLiteralImpl>,<XNumberLiteralImpl>,<XNumberLiteralImpl>)': The name 'newArrayList' cannot be resolved to an item or type; line 24, column 17, length 19
2018-03-07 15:24:21.697 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_TH': The name 'Mcp23017' cannot be resolved to an item or type; line 521, column 59, length 8
2018-03-07 15:24:21.697 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_IOr': The name 'Zs_IOr' cannot be resolved to an item or type; line 501, column 56, length 6
2018-03-07 15:24:21.700 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_EG': The name 'Oh_anwesend' cannot be resolved to an item or type; line 525, column 63, length 11
2018-03-07 15:24:21.700 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_IO': The name 'Zs_IO_LU' cannot be resolved to an item or type; line 459, column 3, length 8
2018-03-07 15:24:21.705 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_IOr': The name 'Zs_IOr' cannot be resolved to an item or type; line 501, column 56, length 6
2018-03-07 15:24:21.710 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'gd_Re': The name 'gd_Re' cannot be resolved to an item or type; line 315, column 52, length 5
2018-03-07 15:24:21.710 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'rs': The name 'rs' cannot be resolved to an item or type; line 366, column 14, length 2
2018-03-07 15:24:21.711 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'gd_Ha': The name 'gd_Ha' cannot be resolved to an item or type; line 311, column 52, length 5
2018-03-07 15:24:21.715 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Me_Radio_SU': The name 'Index' cannot be resolved to an item or type; line 508, column 59, length 5
2018-03-07 15:24:21.716 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_TH_SU': The name 'Index' cannot be resolved to an item or type; line 504, column 59, length 5
2018-03-07 15:24:21.722 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'se_mcp3008': The name 'se_mcp3008_LU' cannot be resolved to an item or type; line 393, column 3, length 13
2018-03-07 15:24:44.057 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_EG_SU': cannot invoke method public java.lang.Object java.util.ArrayList.set(int,java.lang.Object) on null
2018-03-07 15:24:44.061 [INFO ] [org.eclipse.smarthome.model.script._] - System started
2018-03-07 15:24:44.084 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Zs_Gong_Modus': cannot invoke method public abstract java.lang.Object org.eclipse.xtext.xbase.lib.Functions$Function4.apply(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object) on null
...
2018-03-07 15:24:44.764 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'jede Minute': cannot invoke method public java.lang.Object java.util.ArrayList.get(int) on null
...
2018-03-07 15:25:00.116 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'jede Minute': cannot invoke method public java.lang.Object java.util.ArrayList.get(int) on null
...
2018-03-07 15:26:00.130 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'jede Minute': cannot invoke method public java.lang.Object java.util.ArrayList.get(int) on null
...
maggu2810 commented 6 years ago

Is there a way to realize and solve automaticly?

It should be solved if #1896 is solved.

hr3 commented 6 years ago

The problem still occure in 2.3.0!

sjsf commented 6 years ago

Yes, sure. Nobody claimed anything else.