Gamelift Server refused client connection

My game server is working fine on gamelift local, but after creating the fleet from the build. I created a game session with lambda function called by client and after recieving player data, i am trying to connect to a TCP port opened on game server. But the server is refusing my connection.

Can anyone please help me out. Thank you!

Theres two typical reasons for this assuming you are seeing timeouts connecting / connections refused.

  1. Fleet ports aren’t open on the fleet / GameLift is blocking your connections

By default a GameLift fleet does not allow any incoming connections. You have to explicitly open the ports required during fleet-creation or (on an Active/Error fleet) using update-fleet-port-settings.

You can check whats open on your fleet any time by using:
https://docs.aws.amazon.com/cli/latest/reference/gamelift/describe-fleet-port-settings.html

Check that the expected ports are open and/or restricted by CIDR ranges that make sense for your use case.

  1. The Server is not listening on the port it claims to be listening on

You also need to ensure your server is listening on the expected port (the port it reported in ProcessReady). You can remote into the GameLift instance to check this from your logs or via command line etc.

https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html

Typically the server listen port is passed in via a parameter during fleet-creation time but some users auto-configure their ports on server launch. Either way its good to have a log statement or other means to validate the port the server is on etc.

Note: You’ll need to ensure the SSH/RDP port is open for remote connections on the fleet (see above) depending on the OS type.

Hope that helps.

I am not able to connect update port settings for remote instance connection

An error occurred (InvalidRequestException) when calling the UpdateFleetPortSettings operation: 1 validation error detected: Value ‘RDP’ at ‘inboundPermissionAuthorizations.1.member.protocol’ failed to satisfy constraint: Member must satisfy enum value set: [UDP, TCP]

Also I checked inbound settings of my fleet they were fine still when my client is trying to connect to Server, the connection is refused.

InboundPermissions": [
{
“FromPort”: 1900,
“ToPort”: 2000,
“IpRange”: “0.0.0.0/0”,
“Protocol”: “TCP”
},
{
“FromPort”: 1900,
“ToPort”: 2000,
“IpRange”: “0.0.0.0/0”,
“Protocol”: “UDP”
}
]

To update fleet port settings for RDP you would do something like (as its seems like you have a windows fleet):

Protocol=TCPFromPort=3389,ToPort=3389,IpRange="0.0.0.0/0",Protocol=TCP

Its important that you can remote into an instance so you can confirm the server port settings and see what the server is seeing wrt to connections. Theres a complete set instructions for remote access for Windows fleets via the console here: Windows Remote Access won't connect to GameLift Fleet, what am I doing wrong?

From a client POV It may be useful to capture what errors the client is seeing and, if you are using TLS, confirm that the security materials required are installed.

I understand how frustrating tracking down client/server connections can be, but the first thing we need to do is see both ends (as much as possible) of the communication attempt.