Exec 2.0 Binding Error: Uninitialized - HANDLER_INITIALIZING_ERROR

Hello,
I have an issue with the Exec 2.0 Binding.

In PaperUI the Thing says “UNINITIALIZED - HANDLER_INITIALIZING_ERROR”

Here are my things (same error each):

exec:command:PixelController_PowerOn [command="sudo /home/pi/pixelcontroller/pixConServer/PixelControllerRPi.sh", interval=0, autorun=false]
exec:command:PixelController_PowerOff [command="sudo pkill -9 -f com.neophob.sematrix.cli.PixConDaemon", interval=0, autorun=false]
exec:command:PixelController [command="sudo /home/pi/pixelcontroller/pixConClient/PixConCli.sh -c %2$s", interval=0, autorun=true]
18:15:21.702 [INFO ] [smarthome.event.ThingAddedEvent     ] - Thing 'exec:command:PixelController_PowerOn' has been added.
18:15:21.717 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'exec:command:PixelController_PowerOn' changed from UNINITIALIZED to INITIALIZING
18:15:21.729 [INFO ] [smarthome.event.ThingAddedEvent     ] - Thing 'exec:command:PixelController_PowerOff' has been added.
18:15:21.739 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'exec:command:PixelController_PowerOn' changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR)
18:15:21.736 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while initializing handler of thing 'exec:command:PixelController_PowerOn': java.lang.IllegalArgumentException
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_111]
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_111]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:186)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:79)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:63)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9.run(ThingManager.java:728)[103:org.eclipse.smarthome.core.thing:0.9.0.201612010841]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_111]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_111]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Caused by: java.lang.IllegalArgumentException
        at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay(ScheduledThreadPoolExecutor.java:589)[:1.8.0_111]
        at org.openhab.binding.exec.handler.ExecHandler.initialize(ExecHandler.java:105)[182:org.openhab.binding.exec:2.0.0.201612022359]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:731)[103:org.eclipse.smarthome.core.thing:0.9.0.201612010841]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)[103:org.eclipse.smarthome.core.thing:0.9.0.201612010841]
        at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:177)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_111]
        ... 3 more
18:15:21.760 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'exec:command:PixelController_PowerOff' changed from UNINITIALIZED to INITIALIZING
18:15:21.769 [INFO ] [smarthome.event.ThingAddedEvent     ] - Thing 'exec:command:PixelController' has been added.
18:15:21.769 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'exec:command:PixelController_PowerOff' changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR)
18:15:21.768 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while initializing handler of thing 'exec:command:PixelController_PowerOff': java.lang.IllegalArgumentException
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_111]
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_111]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:186)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:79)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:63)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9.run(ThingManager.java:728)[103:org.eclipse.smarthome.core.thing:0.9.0.201612010841]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_111]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_111]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Caused by: java.lang.IllegalArgumentException
        at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay(ScheduledThreadPoolExecutor.java:589)[:1.8.0_111]
        at org.openhab.binding.exec.handler.ExecHandler.initialize(ExecHandler.java:105)[182:org.openhab.binding.exec:2.0.0.201612022359]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:731)[103:org.eclipse.smarthome.core.thing:0.9.0.201612010841]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)[103:org.eclipse.smarthome.core.thing:0.9.0.201612010841]
        at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:177)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_111]
        ... 3 more
18:15:21.808 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'exec:command:PixelController' changed from UNINITIALIZED to INITIALIZING
18:15:21.815 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'pixelcontroller.things'
18:15:21.822 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'exec:command:PixelController' changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR)
18:15:21.821 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while initializing handler of thing 'exec:command:PixelController': java.lang.IllegalArgumentException
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_111]
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_111]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:186)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:79)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:63)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9.run(ThingManager.java:728)[103:org.eclipse.smarthome.core.thing:0.9.0.201612010841]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_111]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_111]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Caused by: java.lang.IllegalArgumentException
        at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay(ScheduledThreadPoolExecutor.java:589)[:1.8.0_111]
        at org.openhab.binding.exec.handler.ExecHandler.initialize(ExecHandler.java:105)[182:org.openhab.binding.exec:2.0.0.201612022359]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:731)[103:org.eclipse.smarthome.core.thing:0.9.0.201612010841]
        at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)[103:org.eclipse.smarthome.core.thing:0.9.0.201612010841]
        at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:177)[96:org.eclipse.smarthome.core:0.9.0.201612010841]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_111]
        ... 3 more
18:15:21.850 [WARN ] [home.core.thing.binding.ThingFactory] - Could not create channel 'run' for thing type 'exec:command:PixelController_PowerOn', because channel type 'exec:running' could not be found.
18:15:21.855 [WARN ] [.thing.internal.GenericThingProvider] - Could not create channel 'run' for thing 'exec:command:PixelController_PowerOn', because channel type 'exec:running' could not be found.
18:15:21.861 [WARN ] [home.core.thing.binding.ThingFactory] - Could not create channel 'run' for thing type 'exec:command:PixelController_PowerOff', because channel type 'exec:running' could not be found.
18:15:21.865 [WARN ] [.thing.internal.GenericThingProvider] - Could not create channel 'run' for thing 'exec:command:PixelController_PowerOff', because channel type 'exec:running' could not be found.
18:15:21.872 [WARN ] [home.core.thing.binding.ThingFactory] - Could not create channel 'run' for thing type 'exec:command:PixelController', because channel type 'exec:running' could not be found.
18:15:21.876 [WARN ] [.thing.internal.GenericThingProvider] - Could not create channel 'run' for thing 'exec:command:PixelController', because channel type 'exec:running' could not be found.

What is going wrong here?

I have found the issue:
It is not possible to do “interval=0”.

It seems there is currently no way to fire a command only once. I have created a feature request on github for this issue.

My workaround is to set interval to a very high number :wink:

Cheers

The problem has been solved by the developer.

“interval=0” now works and fires the command only once.

I have nearly the same problem.
The .things file has the following content:

Thing exec:command:on [command="sudo /home/piremote/raspberry-remote/send 01011 30 1 -b", interval=0, autorun=false]

the .items file looks like this:

Switch dg_sa_li_kommode "Kommode" <light> (gDGSamiZimmer, gDGLicht) {channel="exec:command:on:run"}

But when I turn on the Switch nothing happens and the Switch jumps back to off.

2016-12-10 13:56:40.242 [WARN ] [home.core.thing.binding.ThingFactory] - Could not create channel 'run' for thing type 'exec:command:on', because channel type 'exec:running' could not be found.
2016-12-10 13:56:40.250 [WARN ] [.thing.internal.GenericThingProvider] - Could not create channel 'run' for thing 'exec:command:on', because channel type 'exec:running' could not be found.
2016-12-10 13:59:34.789 [WARN ] [io.rest.core.thing.ThingTypeResource] - Cannot find channel type: exec:running

As far as I understood the problem should be fixed, nevertheless after updating openhab 2 it doesn’t work.
So my question is: Do you use the snapshot or the beta version of openhab 2?

@saemet This is a bug, I have proposed a fix

[The Switch jumping back to OFF is normal, as it is only used to trigger the execution of the command. Once the execution of the command has finished, it is set back to OFF]

Since the last update turning on works! But how is it possible to turn it off through another command?

Yes, you have to define another Thing with a command to switch off your device, light,…, and then define an Item that links to the “run” Channel of that Thing