spayne/GameLiftStarterPlugin

Getting empty fields from JSON

Closed this issue · 4 comments

LogGameLift: Warning: About to make login request to https://tc07mravdi.execute-api.us-east-1.amazonaws.com/testfleet-api-test-stage with user0/test12
LogGameLift: Warning: Got Successful Login Response
LogJson: Warning: Field PlayerSession was not found.
LogJson: Error: Json Value of type 'Null' used as a 'Object'.
LogJson: Warning: Field PlayerSessionId was not found.
LogJson: Error: Json Value of type 'Null' used as a 'String'.
LogJson: Warning: Field PlayerSession was not found.
LogJson: Error: Json Value of type 'Null' used as a 'Object'.
LogJson: Warning: Field IpAddress was not found.
LogJson: Error: Json Value of type 'Null' used as a 'String'.
LogJson: Warning: Field PlayerSession was not found.
LogJson: Error: Json Value of type 'Null' used as a 'Object'.
LogJson: Warning: Field Port was not found.
LogJson: Error: Json Value of type 'Null' used as a 'String'.

When we try to login we get this error,

{"message":"Unauthorized"} I get this when I try to use curl command to start session

Thanks for the logging information. So it looks like something doesn't have permission.
I'm thinking there are couple possible causes

  • the login is failing for good cause - ie if the cognito user database failed to be created, then maybe this would happen
  • some internal IAM permissions - e.g. maybe something is going wrong between the rest api and the cognito system

I'm in the middle of a '5.1.1' engine build at the moment, but once that clears up I'll try and reproduce what you are seeing to see if I can determine what is happening. In the meantime, what you could try is to do a 'check' on the "Cognito User Pool Setup" and ensure you are getting a green checkmark.

Hi SaketZaan,

I was able to reproduce what you are seeing by providing an invalid username or password. The error messages/warnings for this case were not very good, so I updated the code to give you more helpful messages.

If could please:

  • pull this repository (cd into Plugins\GameLiftStarter and run git pull)
  • build the client
  • try again with a redeploy (you don't need to rebuild or repackage the server).

You should then be able to login. And if not, you should be able to get more meaningful logging information.

Other than testing invalid username and password I also tested the following error conditions:

  • shutting down cognito - you will get a fail message and info that the cognito user pool is no longer present
  • delete the lambdas - you will get a fail message "internal server error"

Hopefully this helps. I would appreciate it if you could give it another try to confirm that is fixed.
Thanks,
Sean

Hey @spayne Thank You for your help. It was a stupid mistake I created the rest api before creating the fleet. Sorry to take your time.

Glad you figured it out.