Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse terminationTime from TerminateProcess message #3

Open
j1mmie opened this issue May 3, 2023 · 0 comments
Open

Unable to parse terminationTime from TerminateProcess message #3

j1mmie opened this issue May 3, 2023 · 0 comments

Comments

@j1mmie
Copy link

j1mmie commented May 3, 2023

I know this repo is rather old, just saving this issue here for posterity. I hope I can submit a PR for it some day.

I'm seeing this error on live servers in GameLift:

2023-05-03T18:57:05.064Z engine.io-client:socket socket receive: type "message", data "2["TerminateProcess","{\n  \"terminationTime\": \"1683140584\"\n}"]"
2023-05-03T18:57:05.065Z socket.io-parser decoded 2["TerminateProcess","{\n  \"terminationTime\": \"1683140584\"\n}"] as {"type":2,"nsp":"/","data":["TerminateProcess","{\n  \"terminationTime\": \"1683140584\"\n}"]}
2023-05-03T18:57:05.067Z socket.io-client:socket emitting event ["TerminateProcess","{\n  \"terminationTime\": \"1683140584\"\n}"]
2023-05-03T18:57:05.068Z ServerState ServerState got the terminateProcess signal.  rawTerminationTime : {
  "terminationTime": "1683140584"
}
2023-05-03 11:57:05.070 INFO  GameLift: Process is exiting with code 1. Calling GameLiftServerAPI.Destroy() 
2023-05-03 11:57:05.071 INFO  GameLift: Disposing of GameLift 
2023-05-03 11:57:05.074 INFO  /local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/ServerState.ts:308
        this.terminationTime = deserialized.terminationTime.mul(1000 * 10000)
                                                            ^
2023-05-03 11:57:05.077 INFO  TypeError: deserialized.terminationTime.mul is not a function
    at ServerState.<anonymous> (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/ServerState.ts:308:61)
    at step (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/dist/lib/Server/ServerState.js:32:23)
    at Object.next (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/dist/lib/Server/ServerState.js:13:53)
    at /local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/dist/lib/Server/ServerState.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/dist/lib/Server/ServerState.js:3:12)
    at /local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/ServerState.ts:293:7
    at ServerState.OnTerminateProcess (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/ServerState.ts:312:7)
    at Socket.<anonymous> (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/Network.ts:61:20)
    at Socket.Emitter.emit (/local/game/server/node_modules/component-emitter/index.js:145:20)

It appears that terminationTime is assumed to be a Long at this point. I'm not sure what the value actually is, but there could be some additional checks / conversions to avoid this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant