I’m working through the megafrog example (here) and having troubles getting the final server script to run. I’m able to deploy the very basic server script (from this link) and see the server is up and healthy, but when following the directions to update the server with the final script (using both the final megafrog server script and the gameloop) the server immediately crashes without a whole lot of helpful output.
Server process exited without calling ProcessEnding(), exitCode(137), launchPath(/local/NodeJS/bin/node), arguments(-- /local/game/src/gamelift.js --script …/…/…/local/game/etag-4d4b5ae88ebc24b1fd50de7c1819ff70/MegaFrogRaceServer.js), instanceId(i-06adfd8d749284ccd), publicIP(184.108.40.206), gameSessionId(none)
I’ve tried this several times, and to the best of my knowledge I haven’t changed any code (just straight download and create zip file). I’m also unclear how to debug this - there is very little output here to go on, and it’s not clear if the realtime servers can be run locally.
UPDATE: When I terminate the fleet and start it up fresh with the final scripts, it appears to launch into a healthy state. I think there might be something wonky with updating running scripts?
UPDATE: This is fairly repeatable. I’ve tried to upload a new script several times, crashed the server, terminated the fleet, and then created a new fleet with that same script, and it comes up every time. I’m going to open a ticket now. (case 6187158891)
I responded on your TT but re-posting here.
You can debug these issues as long your fleet is ACTIVE by remoting into the fleet: https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html
This will give you access to the logs in /local/game/logs etc. Obviously not the easiest solution and something we’d like to improve.
As to your specific issue, it seems you failed to include your dependencies in your updated script package. Your processes are repeatedly because the gameloop.js file is missing from the updated Script bundle:
25 Jun 2019 17:06:57,571 [ERROR] (index.js) 235: Failed loading developer code: Error: Cannot find module './gameloop.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/local/game/etag-59e49c061105822d16f78a314572d631/MegaFrogRaceServer.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
I think there’s something else going on here. If I “update a script” with a zip file containing both .js files, it crashes. Terminate the fleet. Start up the fleet with the EXACT SAME FILE and it works fine. I suspect there’s something going on with how the script or fleet deal with updates that is different than clean starts.