OpenDA-Association/OpenDA

You cannot specify a program without a path in a BBAction

theavuik opened this issue · 0 comments

The following config does not work as expected:

<computeActions>
  <action workingDirectory="%instanceDir%" exe="docker run .... ">
  </action>
</computeActions>

You would expect that if docker is in the $PATH environment variable, it would be possible for OpenDA to run it.

However, it fails with an unclear error :

Error running algorithm step.
Error message: Error running executable null on /scratch/work/work0: null
Error type :RuntimeException
Stacktrace :java.lang.RuntimeException: Error running executable null on /scratch/work/work0: null
        at org.openda.blackbox.config.BBAction.run(BBAction.java:122)
        at org.openda.blackbox.wrapper.BBModelInstance.compute(BBModelInstance.java:251)
        at org.openda.blackbox.wrapper.BBStochModelInstance.compute(BBStochModelInstance.java:349)
        at org.openda.algorithms.Simulation.next(Simulation.java:136)
        at org.openda.application.ApplicationRunnerSingleThreaded.runSingleThreaded(ApplicationRunnerSingleThreaded.java:86)
        at org.openda.application.OpenDaApplication.runApplicationBatch(OpenDaApplication.java:120)
        at org.openda.application.OpenDaApplication.main(OpenDaApplication.java:108)
Caused by: java.lang.NullPointerException
        at java.io.File.<init>(File.java:277)
        at org.openda.blackbox.config.BBUtils.runExecutable(BBUtils.java:152)
        at org.openda.blackbox.config.BBAction.run(BBAction.java:119)
        ... 6 more

OpenDA now checks if exe is a valid path, and if it fails it changes the value to null without an error.
Then it tries to run null if nothing has happened and fails ungracefully.

We should consider supporting commands. Otherwise, we should improve the error handling.

This issue is a duplicate of JIRA issue ODA-618, which will now be closed.