Page 1 of 1

[Klonan] [0.16.36] Headless Server - Wave Defense Scenario crash

Posted: Sat Apr 07, 2018 3:21 am
by Styx13
I was not in the game while it happened, but I am running a headless server on linux and I noticed it crashed, there were players on it at the time of the crash apparently.

It seems it crashed when somebody tried to click on "next wave" ?

Code: Select all

3317.405 Error MainLoop.cpp:1029: Exception at tick 85113: Error while running event level::on_gui_click (ID 1)
Given entity doesn't exist anymore.
stack traceback:
        /somepath/factorio/temp/currently-playing/control.lua:332: in function 'command_straglers'
        /somepath/factorio/temp/currently-playing/control.lua:182: in function 'next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:66: in function </somepath/factorio/temp/currently-playing/control.lua:60>
3317.405 Error ServerMultiplayerManager.cpp:96: MultiplayerManager failed: "Error while running event level::on_gui_click (ID 1)
Given entity doesn't exist anymore.
stack traceback:
        /somepath/factorio/temp/currently-playing/control.lua:332: in function 'command_straglers'
        /somepath/factorio/temp/currently-playing/control.lua:182: in function 'next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:66: in function </somepath/factorio/temp/currently-playing/control.lua:60>"
3317.405 Info ServerMultiplayerManager.cpp:698: mapTick(85113) changing state from(InGame) to(Failed)

Re: [16.36] Headless Server - Wave Defense Scenario crash

Posted: Sat Apr 07, 2018 6:37 pm
by Styx13
Just wanted to indicate that the bug is reproducible, below the snippet with the same error:

Code: Select all

25559.744 Error MainLoop.cpp:1029: Exception at tick 28273: Error while running event level::on_tick (ID 0)
Given entity doesn't exist anymore.
stack traceback:
        /somepath/factorio/temp/currently-playing/control.lua:332: in function 'command_straglers'
        /somepath/factorio/temp/currently-playing/control.lua:182: in function 'next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:165: in function 'check_next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:113: in function </somepath/factorio/temp/currently-playing/control.lua:111
25559.744 Error ServerMultiplayerManager.cpp:96: MultiplayerManager failed: "Error while running event level::on_tick (ID 0)
Given entity doesn't exist anymore.
stack traceback:
        /somepath/factorio/temp/currently-playing/control.lua:332: in function 'command_straglers'
        /somepath/factorio/temp/currently-playing/control.lua:182: in function 'next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:165: in function 'check_next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:113: in function </somepath/factorio/temp/currently-playing/control.lua:111>"
25559.744 Info ServerMultiplayerManager.cpp:698: mapTick(28273) changing state from(InGame) to(Failed)
and again:

Code: Select all

 513.600 Error MainLoop.cpp:1029: Exception at tick 36993: Error while running event level::on_tick (ID 0)
Given entity doesn't exist anymore.
stack traceback:
        /somepath/factorio/temp/currently-playing/control.lua:332: in function 'command_straglers'
        /somepath/factorio/temp/currently-playing/control.lua:182: in function 'next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:165: in function 'check_next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:113: in function <somepath/factorio/temp/currently-playing/control.lua:111
 513.600 Error ServerMultiplayerManager.cpp:96: MultiplayerManager failed: "Error while running event level::on_tick (ID 0)
Given entity doesn't exist anymore.
stack traceback:
        /somepath/factorio/temp/currently-playing/control.lua:332: in function 'command_straglers'
        /somepath/factorio/temp/currently-playing/control.lua:182: in function 'next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:165: in function 'check_next_wave'
        /somepath/factorio/temp/currently-playing/control.lua:113: in function </somepath/factorio/temp/currently-playing/control.lua:111>"
 513.600 Info ServerMultiplayerManager.cpp:698: mapTick(36993) changing state from(InGame) to(Failed)

Re: [16.36] Headless Server - Wave Defense Scenario crash

Posted: Sat Apr 07, 2018 7:13 pm
by Styx13
I believe I found the reason for the crash.

It actually crashes after the game is lost.
Meaning, if the bitters kill the rocket silo, the game is over, however it continues to run on the server.
And if somebody joins the server and tries to start the next wave, or if the next wave is automatically being called by the timer (as it seems the timer is still running after game is over), it will generate this crash.

I believe the fix for that would be to detect game lost on the server side and restart the game.

Actually, somebody already put some suggestion about modifying the wave defense scenario for a headless server: viewtopic.php?f=133&t=55706&hilit=wave+defense

I believe the fastest fix is to automatically restart the game after it's over (and not let the server continue running)

Re: [Klonan] [0.16.36] Headless Server - Wave Defense Scenario crash

Posted: Sat Apr 14, 2018 11:29 pm
by Klonan
Thanks for the report,

This is fixed for the next version of 0.16

(In 0.17, it was already fixed by some refactoring)