edurange / edurange-server

cloud-based interactive security exercises
https://www.edurange.org
MIT License
14 stars 14 forks source link

Error if trying to run more than one scenario at at the same time. #39

Closed newjam closed 5 years ago

newjam commented 6 years ago

First create and boot one scenario. Then attempt to create a second scenario. Expect the following stack trace (when running the development server):

bug

The expected behavior is either that more than one scenario is able to be run at the same time, or that at least an appropriate error message is displayed.

The issue seems to be that on this line nil is assigned to @scenario. https://github.com/edurange/edurange-server/blob/1f693bb2fdd5ab6ca29d494b87cf26c9ae73e349/app/controllers/scenarios_controller.rb#L120-L123 So on this line there is a nil reference exception: https://github.com/edurange/edurange-server/blob/1f693bb2fdd5ab6ca29d494b87cf26c9ae73e349/app/controllers/scenarios_controller.rb#L126 The ScenarioLoader::fire! procedure should either return a scenario or throw an exception. Alternatively, if ScenarioLoader::fire! is allowed to return nil values, we need to handle that case in ScenariosController::create

newjam commented 5 years ago

ScenarioLoader::fire! shouldn't return nil, but this doesn't seem to be an issue anymore.