FleetCapacityExceededException when there should be capacity left

Hi,

I am receiving “FleetCapacityExceededException” when calling “CreateGameSession” in a situation where I have only one instance in a single fleet. There are no active game sessions and the fleet is in “ACTIVE” state. I also checked on the instance itself that the process had successfully called “GameLiftServerAPI.ProcessReady”. I was able to play two sessions before running into this issue, both of which now appear as “TERMINATED” in the game session list for the fleet (the second game session had one player session that timed out).

Any ideas what could be happening here?

I managed to solve the issue by ripping down the whole process after each game session. I didn’t see any reports about the process being unhealthy in the GameLift dashboard and I did check from our logs that we had initiated the process correctly after the last successful session. Unfortunately the the fleet doesn’t exist anymore. But it was easily reproducible. Currently we’re in such a hurry that I’ll have to postpone further investigation for a bit later. However, thanks for the troubleshooting tips and I’ll get back to you when I continue my digging!

FleetCapacityExceeded means there is not enough available game server
processes running on your fleet to accept any new game sessions. This could be because:

  • you have 0 instances in your fleet (seems unlikely)
  • every game server process is already hosting a game session (as you report no active game sessions so unlikely)
  • although they are game server processes running, they are not healthy or responding to GameLift health checks
    Firstly try calling DescribeFleetUtilization, as this will tell you what Gamelift thinks is happening on your fleet.

I would check that you are following integration guide here:

https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html

I would ensure your server code is cleaning up as expected (and not crashing) at the end of the session ie do you receive a new OnGameSession for your process etc.

It may be easier to debug with Gamelift local if you haven’t already.

If you are still having issues please provide a fleet id and region and we can take a look.

Hi!
I am still having issue with my fleet!
I get an error saying :
“Unable to reserve a process on fleet fleet-57560fc8-1710-4674-9e13-d3d973b072cf, location ap-south-1, gameSessionId: arn:aws:gamelift:ap-south-1::gamesession/fleet-57560fc8-1710-4674-9e13-d3d973b072cf/gsess-da4bf4ea-6a59-454f-ac2e-cc218785391f. (No active and available server processes found on the fleet)”

when i test lambda function!
My region is ap-south-1

Hi there @Davinder_Singh ,

You are receiving this exception because there are no server processes available for hosting your GameSession. As mentioned above, this could mean:

  1. Not enough hosts under the fleet (all hosts in use or no hosts at all)
  2. Something is wrong with your server process and it is unhealthy.

Taking a quick look at some logs for the fleet you’ve mentioned, the problem seems to be #2 above. Server Processes are not starting up successfully on your fleet. This seems to be related to the launchPath provided during fleet creation. For a RealTime Server Fleet this parameter specifies the server script (.js file) that should be run on start-up, but I see that you’ve provided a zip file instead (launchPath=/local/game/realTimeServerScript.zip).

See: ServerProcess - GameLift Service
For more help getting started with RealTimeServers: Creating Servers for Multiplayer Mobile Games with Just a Few Lines of JavaScript | AWS Game Tech Blog

Hi @Nathan
Yes I figured that and replaced it with .js file and now working!

But now I am facing another issue which is when i try to play at two separate place such as unity editor and windows build, i only get “Player accepted” function called in unity editor but not in build. Do i need to configure my fleet or something?

Also, Game Session is not ending even after all players disconnect from it!

Hi Davinder,

You can try using GameLift local to verify if your game server and client integration with GameLift works correctly. With this approach you can reduce iteration time (by not having to upload a new build and configure a new fleet every time you make changes), and potentially identify the issue you’re facing with connecting players onto a game session.

A server process with 0 players is still an active server process. When you no longer require the server process after all players are disconnected, you should call ProcessEnding() to notify GameLift that the process is ready to be terminated.

Refer: GameLift Server API (C#) reference: Actions - Amazon GameLift

I am unable to call process ending ! It’s not showing up in scripts in project anywhere!

The game sessions, receiving and everything is working completely fine in unity editor but doesn’t work anywhere outside say when i create a build for windows or android. Maybe the screenshot attached is the issue!?

But also, i am unable to use gamelift local by following the documentation here:
https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-testing-local.html

I am getting this error when i try to create a new game session!

Hey, @Pip , @Nathan, @ShashankJ-AWS Can anyone help me with my problem here: