Problems with GameLift server process. Starts and terminates

Hello.
Im using Unreal Engine 4 for development. My GameLift server starts and stops instantly.
My problem started randomly (i think). And i have tried lots of things, and flooded my project with different logs.

params->OnHealthCheck.BindLambda(
{
UE_LOG(LogTemp, Log, TEXT(“HealthCheck happening.”));
return true;
});

This spams my logs with “HealthCheck happening”, it gets executed about 100 times in 5 seconds.

params->OnStartGameSession.BindLambda([=](Aws::GameLift::Server::Model::GameSession gameSession)
{
UE_LOG(LogTemp, Log, TEXT(“Gamesession created and activated!”));
gameLiftSdkModule->ActivateGameSession();
UE_LOG(LogTemp, Log, TEXT(“Activate gamelift GameSession!”));
});

I get both logs correctly and after that log file ends.

Tried again with ‘GameLift.CreateGameSession’ request and now i didn’t even get “Activate gamelift GameSession” log. I think something is very wrong with “GameLift” and i’m thinking about changing it for something normal. I have battled against that error for 3 days already.
Note! It used to work as it should work, error started when i uploaded new fleet a week back.

Also getting
Matchmaking error:
“Status”: “FAILED”,
“StatusMessage”: “Game session reservation has failed post-processing.”,
“StatusReason”: “PLACING_FAILED”,

Hi FinalZer0. I use GameLift on UE 4, all worked good. You can try to:

  1. Load your Server Build on GameLift.
  2. Create Fleet from your build.
  3. After Fleet will in “Active” status.
  4. On your PC use AWS CLI and run comman
    aws gamelift create-game-session --fleet-id "YOUR_FLEET_ID" --maximum-player-session-count "5"

I hope that action can help you find where you have error.

I have tried it, It does not work. Actually it does not even create gamesession for me.

[2019.09.13-13.08.01:672][ 74]LogTemp: HealthCheck happening.
[2019.09.13-13.08.58:650][777]LogTemp: HealthCheck happening.
[2019.09.13-13.08.58:951][786]LogTemp: HealthCheck happening.
[2019.09.13-13.09.01:695][868]LogTemp: HealthCheck happening.
[2019.09.13-13.09.58:646][570]LogTemp: HealthCheck happening.
[2019.09.13-13.09.58:947][579]LogTemp: HealthCheck happening.
[2019.09.13-13.10.01:709][661]LogTemp: HealthCheck happening.

these are last rows from server log.
I have also tried with empty map. So no way for in code errors.

You use LocalGameLift or Real GameLift ?

If Real GameLift witch status have your Fleet ?

I’m using Real Gamelift, but i have also tried with local version, on local it worked as it should work. My fleet status is Active

After try CLI, can you show error message.

I dont recieve error message, i can send my logs if you want?

in command line when use AWS CLI in any case you must see message error or no. And your logs will can help too.

AWS CLI

Setup: Empty map + only copy pasted code from tutorial + some UE logs
Logs: https://pastebin.com/0s4WaU5r

Result with AWS CLI:

{
“GameSession”: {
“GameSessionId”: “arn:aws:gamelift:eu-central-1::gamesession/fleet-72371ee1-5838-4d8d-86c8-3ff5806ed58c/gsess-21e89f5a-d449-4a1e-be96-564f7c5babb0”,
“FleetId”: “fleet-72371ee1-5838-4d8d-86c8-3ff5806ed58c”,
“CreationTime”: 1568382512.499,
“CurrentPlayerSessionCount”: 0,
“MaximumPlayerSessionCount”: 5,
“Status”: “ACTIVATING”,
“GameProperties”: [],
“IpAddress”: “18.184.216.16”,
“Port”: 7777,
“PlayerSessionCreationPolicy”: “ACCEPT_ALL”
}
}

Looking good, and now from your client just need create PlayerSession and that’s it.

I have made script in GameSparks that create gamesession and playersession, but it terminates really fast

I think need look your logic more deeply. But on this moment i must go, sorry i will read your messages later :slight_smile:

Maybe i have to try with new project and with new plugin. I think plugin is broken. Somehow

I think plugin work good, thome thing in your code wrong. But i can mistake about plugin.

Some troubleshooting to consider:

  1. Look at your fleet metrics in GameLift. Do you see “Available GameSessions”? Do you see solid “Healthy” server processes? What does the CPU load look like on your instance?
  2. If using multiple processes per instances have you tried scaling back so theres just 1
  3. I assume you already using remote access into an instance so you can tail your logs in real time, but if not this can be really helpful
  4. Do you see any FleetEvents relating to unhealthy processes or failing health checks?

As previously suggested I would try creating 1 game session at a time on your fleet and ensure that your process receives it, accepts it and is healthy after the fact.

  • Would ensure you are not starving your health check callback or other threads; logs just stopping would indicated deadlock, cpu starvation or potentially a crash somewhere.

Good luck

Thank you for your answer.

  1. It’s healthy
  2. Have tried scaling down

I somehow cannot get connection to my instances. AWS Cli gives me message: “An error occurred (NotFoundException) when calling the GetInstanceAccess operation: Host (i-09d092ab9d18ddde5) not found.”, while my instance is active. Here i’m describing my instances.Any ideas why is this broken for me?

“Instances”: [
{
“FleetId”: “fleet-123456789”,
“InstanceId”: “i-09d092ab9d18ddde5”,
“IpAddress”: “12.34.56.78”,
“OperatingSystem”: “AMAZON_LINUX”,
“Type”: “c4.large”,
“Status”: “Active”,
“CreationTime”: 1568625527.061
}
]

I found that i have fleet message “Game session failed to activate within 5 minutes of ActivateGameSession()”. Hope it gives more ideas how to debug, because i’m all out :D. Except abandoning GameLift.