Issue with Rules - script interpreter cannot be obtain

I am getting the following error:

2016-04-25 21:07:27.940 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule ‘Motion Detected’: Script interpreter couldn’t be obtain

Any thoughts?

I also notice that the manually created rules seem to be showing up in habmin automation tab now? Had not noticed that before.

I’ve been getting this too on the last few builds. Doesn’t seem to happen every time a rule fires but most of the time.

Which snapshot build are you using?

Me latest available.
Can confirm.

Could you please enter an issue for ESH? Thanks!

Observing the same, I’d enter the issue, but where? My giss would be “openhab/openhab-distro”.

[Edit]
Issue is posted here.

Any updates on this? I’m testing a very simple rule and getting this issue.

rule "Test rule on"
when
Item Light_GroundFloor_Living_FirePlace changed from OFF to ON
then
sendCommand(Speaker_GroundFloor_Living, ON)
end

rule "Test rule off"
when
Item Light_GroundFloor_Living_FirePlace changed from ON to OFF
then
sendCommand(Speaker_GroundFloor_Living, OFF)
end

2016-05-08 21:52:54.555 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘Light_GroundFloor_Living_FirePlace’ received command OFF
2016-05-08 21:52:54.569 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule ‘Test rule off’: Script interpreter couldn’t be obtain
2016-05-08 21:52:54.608 [INFO ] [marthome.event.ItemStateChangedEvent] - Light_GroundFloor_Living_FirePlace changed from ON to OFF

Running openhab-offline-2.0.0-SNAPSHOT

Tx - Ivan

The findings look like that such an error is logged if any failure OR comment is in the rules file.
In your case i think the failure is here:

The line should read Item Light_GroundFloor_Living_FirePlace changed to ON

tx - this worked for me

After you touch the rules file, it seems to work for a while and then it goes back to not working.

10:45:41.397 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule 'Zone 5 Trip': Script interpreter couldn't be obtain 10:45:41.414 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule 'Zone 5 Trip': Script interpreter couldn't be obtain 10:45:41.415 [INFO ] [marthome.event.ItemStateChangedEvent] - ZONE5_TRIPPED changed from NULL to ON

Rule:

rule "Zone 5 Trip" when Item ZONE5_TRIPPED changed to ON then sendNotification("rich@gmail.com", "Second Floor Door Zone Opened") end

Even with those errors, the rule did fire…but it will stop working. I’ll try to time it or see what cause it to stop.

I’m on build #293, but was seeing this with previous builds.

Is this the whole content of your .rules file?

No, but here is my entire .rules file

rule "Initialize light states"
        when
                System started
        then
        sendCommand(Ring_Motion, OFF)
        sendNotification("rich@gmail.com", "openHAB Started")
end

/* Rules for Alarm Notifications */


rule "Zone 1 updated"
when
    Item ZONE1_TRIPPED changed to ON
then
    sendNotification("rich@gmail.com", "1st Floor Door Zone Opened")
end

rule "Zone 3 Trip"
when
    Item ZONE3_TRIPPED changed to ON
then
    sendNotification("rich@gmail.com", "Back Door Zone Opened")
end

rule "Zone 5 Trip"
when
    Item ZONE5_TRIPPED changed to ON
then
    sendNotification("rich@gmail.com", "Second Floor Door Zone Opened")
end

rule "Big Garage Open"
when
    Item GarageDoorContact changed to OPEN
then
    sendNotification("rich@gmail.com", "Big Garage Opened")
end

rule "Front Door Motion Detected"
when
    Item Ring_Motion changed to ON
then
    sendNotification("rich@gmail.com", "Front Door Motion Detected")
    sendCommand(Ring_Motion, OFF)
end


rule "Big Garage Closed"
when
    Item GarageDoorContact changed to CLOSED
then
    sendNotification("rich@gmail.com", "Big Garage Closed")
end


rule "Close Garage Door When Alarm is Armed in Stay Mode"
when
   Item PARTITION1_ARM_MODE changed to 3
then
 try {
   if (GarageDoorSwitch.state == ON){
    sendCommand(GarageDoorSwitch,OFF)
    logInfo("DSC", "Garage Door Closed by Alarm")
    }

According to my humble finding, the comment could be the cause for the error. However that would not explain why the rule stopped working.

Interesting about the comment.

I will take it out and see if that help.

When did comments become “illegal syntax” in .rules?

No difference. The Rule did fire though

18:20:39.031 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule 'Zone 5 Trip': Script interpreter couldn't be obtain
18:20:39.034 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule 'Zone 5 Trip': Script interpreter couldn't be obtain
18:20:39.042 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule 'Zone 5 Trip': Script interpreter couldn't be obtain
18:20:39.053 [INFO ] [marthome.event.ItemStateChangedEvent] - ZONE5_TRIPPED changed from OFF to ON
18:20:39.070 [INFO ] [marthome.event.ItemStateChangedEvent] - ZONE5_GENERAL_STATUS changed from CLOSED to OPEN

I did check with “//”" comments, the error was logged when the rule had such a comment. Directly after restart the rule was not performed, after the rule was “touched” it was performed although the error was still being logged.
I did a recheck with the rule without a comment after restart, it was performed without any error.
I have no idea why or when such comments became “illegal”, or if that is a misconception of me ( an OpenHAB newbie).

@Kai I was seeing similar errors to above. I updated to the latest release, and am still getting an error any time a rule goes to run. Here’s the log:

java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_65]
	at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_65]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:179)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:72)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:56)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager.dispatchESHEvent(OSGiEventManager.java:188)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager.handleEvent(OSGiEventManager.java:163)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager.handleEvent(OSGiEventManager.java:146)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415)[3:org.apache.karaf.services.eventadmin:4.0.4]
	at org.apache.felix.eventadmin.impl.tasks.HandlerTask.run(HandlerTask.java:90)[3:org.apache.karaf.services.eventadmin:4.0.4]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_65]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
Caused by: java.lang.NullPointerException
	at org.eclipse.smarthome.model.rule.runtime.internal.engine.RuleContextHelper.getContext(RuleContextHelper.java:64)[122:org.eclipse.smarthome.model.rule.runtime:0.8.0.201605141733]
	at org.eclipse.smarthome.model.rule.runtime.internal.engine.RuleEngineImpl.executeRule(RuleEngineImpl.java:304)[122:org.eclipse.smarthome.model.rule.runtime:0.8.0.201605141733]
	at org.eclipse.smarthome.model.rule.runtime.internal.engine.RuleEngineImpl.executeRules(RuleEngineImpl.java:321)[122:org.eclipse.smarthome.model.rule.runtime:0.8.0.201605141733]
	at org.eclipse.smarthome.model.rule.runtime.internal.engine.RuleEngineImpl.receiveCommand(RuleEngineImpl.java:222)[122:org.eclipse.smarthome.model.rule.runtime:0.8.0.201605141733]
	at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:46)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:192)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:1)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:170)[97:org.eclipse.smarthome.core:0.8.0.201605141733]
	... 4 more

@feens This looks indeed like a bug, I have commented on your issue.