INTO-CPS-Association / pyfmu

https://into-cps-application.readthedocs.io/en/latest/submodules/pyfmu/docs/index.html
7 stars 2 forks source link

Nuanced error when keyword args visible and logging_on missing #48

Open clagms opened 4 years ago

clagms commented 4 years ago

Steps to reproduce:

  1. Go to BicycleDynamic and remove visible and logging_on keyword arguments, so that the constructor looks like this:
    def __init__(self, *args, **kwargs):
        super().__init__(
            model_name="BicycleDynamic", author="", description="", *args, **kwargs
        )
       ...
  2. Run test: tests.test_cosim.test_BicycleDynamicAndDriver
  3. Observe an output similar to the following:
    FAILED                 [100%]['java', '-jar', 'D:\\srcctrl\\github\\pyfmu\\src\\pyfmu\\resources\\validation\\coe.jar', '-v', '--configuration', 'C:\\Users\\clagm\\AppData\\Local\\Temp\\tmpvo5w0t60\\coe.json', '--oneshot', '--starttime', '0.0', '--endtime', '10.0']
    Version: 1.0.7-SNAPSHOT
    WARN [main] (CoeInitialize.scala:395) - Make sure the execution tool: '' is available during this simulation.
    An error has ocurred during instantiation of the FMU: Unable to instantiate slave
    ERROR [main] (CoeInitialize.scala:420) - Could not instantiate: {bd}.bdi
    WARN [main] (CoeInitialize.scala:395) - Make sure the execution tool: '' is available during this simulation.
    ERROR [main] (CoeInitialize.scala:127) - Invalid start condition the instances could not be created in: List({bd}.bdi)
    ERROR [main] (RequestProcessors.java:320) - Internal error in initialization
    org.intocps.orchestration.coe.AbortSimulationException: Invalid start condition the instances could not be created in: List({bd}.bdi)
    at org.intocps.orchestration.coe.scala.CoeInitialize$.initialize(CoeInitialize.scala:128)
    at org.intocps.orchestration.coe.scala.Coe.initialize(Coe.scala:140)
    at org.intocps.orchestration.coe.httpserver.RequestProcessors.processInitialize(RequestProcessors.java:311)
    at org.intocps.orchestration.coe.httpserver.RequestHandler.initialize(RequestHandler.java:362)
    at org.intocps.orchestration.coe.httpserver.RequestHandler.handleRequest(RequestHandler.java:212)
    at org.intocps.orchestration.coe.util.SimulationExecutionUtil.callHttpAny(SimulationExecutionUtil.java:166)
    at org.intocps.orchestration.coe.util.SimulationExecutionUtil.run(SimulationExecutionUtil.java:200)
    at org.intocps.orchestration.coe.CoeMain.runOneShotSimulation(CoeMain.java:213)
    at org.intocps.orchestration.coe.CoeMain.main(CoeMain.java:159)
    Simulation failed Invalid start condition the instances could not be created in: List({bd}.bdi)

This is difficult to debug error because the message we get throws the developed into a different direction wrt to the cause. I also would expect that removing those argument would make them available inside kwargs, but apparently this is changing the behavior of the wrapper in a drastic way...

clegaard commented 4 years ago

Yes, the log messages printed by maestro are somewhat lacking. I am quite confident that a python stack trace is printed to stdout. It is possible that maestro capture this and neglect to forward it to the output.