OH3 warnings at boot after upgrade to 3.1 from 2.5.12 (whitelist)

Hi ! - Still trying to weed out warnings after upgrading one of my openhab sites to 3.x.

I am now on OH3.1 using OpenHabian on Ubuntu 20.04 LTS. All is fine - but;

At time of boot, I get this warning in my log:

2021-07-26 18:32:17.899 [WARN ] [rg.openhab.core.io.net.exec.ExecUtil] - Error occurred when executing commandLine '[/bin/touch /etc/openhab2/misc/exec.whitelist]'
java.io.IOException: Cannot run program "/bin/touch /etc/openhab2/misc/exec.whitelist": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(Unknown Source) ~[?:?]
	at java.lang.ProcessBuilder.start(Unknown Source) ~[?:?]
	at org.openhab.core.io.net.exec.ExecUtil.executeCommandLine(ExecUtil.java:59) ~[?:?]
	at org.openhab.core.model.script.actions.Exec.executeCommandLine(Exec.java:40) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:1192) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:1167) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._invokeFeature(XbaseInterpreter.java:1153) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeFeature(XbaseInterpreter.java:1098) ~[?:?]
	at org.openhab.core.model.script.interpreter.ScriptInterpreter.invokeFeature(ScriptInterpreter.java:151) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:1008) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:971) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:247) ~[?:?]
	at org.openhab.core.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:227) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:475) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:251) ~[?:?]
	at org.openhab.core.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:227) ~[?:?]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:213) ~[?:?]
	at org.openhab.core.model.script.runtime.internal.engine.ScriptImpl.execute(ScriptImpl.java:80) ~[?:?]
	at org.openhab.core.model.script.runtime.internal.engine.DSLScriptEngine.eval(DSLScriptEngine.java:131) ~[?:?]
	at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.lambda$0(ScriptActionHandler.java:62) ~[?:?]
	at java.util.Optional.ifPresent(Unknown Source) ~[?:?]
	at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.execute(ScriptActionHandler.java:59) ~[?:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1183) ~[?:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.runNow(RuleEngineImpl.java:1032) ~[?:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.lambda$6(RuleEngineImpl.java:1445) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:?]
	at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) ~[?:?]
	at java.util.HashMap$KeySpliterator.forEachRemaining(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:?]
	at java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:?]
	at org.openhab.core.automation.internal.RuleEngineImpl.lambda$4(RuleEngineImpl.java:1445) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.ProcessImpl.forkAndExec(Native Method) ~[?:?]
	at java.lang.ProcessImpl.<init>(Unknown Source) ~[?:?]
	at java.lang.ProcessImpl.start(Unknown Source) ~[?:?]
	... 47 more

Again, it seems to be leftovers from the OH 2.5.12 upgrade to OH 3.1 through OpenHabian - but how do I eliminate it/them ?

The new whitelist under /misc/ seem to work fine - but it seems that there is an old reference in a config file somewhere ?

That error is coming from a rule. Look for an executeCommandLine with that command. Unfortunately it’s not saying what rule or line number but if you grep touch *.rules from the rules folder it should tell you which file it’s in.

Fantastic ! - I didn’t catch that from the error message. It turned out that I had an old rule implemented as a work-around. I have now fixed that…

rule "exec whitelist workaround"
when
    System started
then
    executeCommandLine("/bin/touch /etc/openhab2/misc/exec.whitelist")
end

There were several clues that it was coming from a rule.

  • The presence of “xtext” in the stack trace. That indicates Rules DSL.
  • The presence of executeCommandLine in the stack trace also points to it being a rule because executeCommandLine is only used in rules.
  • When you see “…model.script…” that’s part of the rules engine
  • When you see “org.openhab.core.automation” that’s part of the rules engine.

There is a wealth of information in the stack traces and I cringe when ever I see people asking how to hide them.

I’m glad you found the solution. You probably added that early on when the Exec binding first implemented the whitelist. It wouldn’t create the whitelist file itself and would fail when it didn’t exist. That has since been fixed so that rule is no longer needed anyway.