Skip to content

Gamelift game does not call InitSdk() in time and does not terminate

0

Hi there, i have been trying to run an Unreal Engine game on gamelift for quite some time but i cannot get past one issue. If i start the server locally (manually clicking on the .exe file) everything loads as expected, or at least i do not get any errors: Image Of Logs The "network failure" that shows is something that i both wasn't able to find a solution to and thought it would disapper once run in the gamelift environment. I have followed the tutorial (https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-engines-setup-unreal.html) down to every comma, and my code is the copy-paste of theirs. Once uploaded to gamelift, i am greeted with the very rewarding page that follows: Fleet build failing The thing that makes me even happier is that there is no instance in ec2 in that region, like none at all, and there are no CloudWatch logs at all, so i don't know where i am even supposed to look for a log file (there is no game session running, not even one in an "error" state to look into for logs). One more funny thing, on the UI for the plugin in unreal, using both the "anywhere" and "managed ec2" deploy options doesn't work, because the anywhere option simply does not start the server, like at all, and the cloud deployment fails for some reason which i'm not gonna get into since uploading the file through AWS CLI and creating a fleet is all that i need, no point complicating an already difficult thing.

If anyone reading this cares enough to help my poor soul, this is the general environment i'm running in: Windows 10 machine with Unreal Engine 5.4.4 (source build), aws sdk 5.1.3 (from github), uploading a windows server to gamelift. The command i'm using is

aws gamelift upload-build --name Carico-Test-2 --build-version 1.23.0 --build-root "E:\Compiled\Compiled_in_5.4.4\WindowsServer" --operating-system WINDOWS_2016 --region eu-central-1 --server-sdk-version 5.1.3

Do you have any idea why this could be happening?

*PS: After looking through some more tutorials i found out that i actually can connect using the cli just with the id of the machine (blurred out in the logs) and i though to myself: "that's neat, no need for a desperate forum post" but then aws responded with a very friendly Screenshot of TargetNotConnected error in command prompt

  • PPS: The timeout for calling initsdk is the default 600 seconds.

  • facing same issue did u resolve this

2 Answers
0
Accepted Answer

Finally found a solution after countless hours of tutorials, forum questions and other support. To anyone else having this or similar problems, look at this carefully.

  1. Follow the steps in the answer that the author of this question posted. Pay close attention to the logs in EC2 mode, meaning when you compile using InitSdk() and NOT InitSdk(serverparameters) there should be no errors. For this to work, you manually need to set the environment variables that gamelift instances have built-in (that questions shows a bit of how to do it and use chatgpt for the rest, its kinda easy).
  2. Make a copy of the server folder and move it to another computer. If you don't have another computer you'll have to figure something out. After moving, run the server and MAKE SURE IT RUNS THERE. Run the install.bat that you have first, and after that run the .exe file with -log to look at logs. For me this was the key: on my machine it ran fine, but elsewhere it required an additional libcrypto-3-x64.dll and libssl-3-x64.dll which i did not have beacuse another openssl version was present. Even if it runs on your machine, check if it runs on a machine that has never seen that server.
  3. At the time of writing, 27/04/2025 at 11:02 CEST the Unreal Engine plugin used on UE5.4.4 is complete garbage, do not use that. Test your builds as that other question suggested with environment variables. Do not upload using the Unreal Engine menu, as i said its garbage and doesn't work. Instead, use AWS CLI with a command similar to aws gamelift upload-build --name [name of build] --build-version [your own version, AWS does not care about this] --build-root "[full path of the folder containing your build]" --operating-system WINDOWS_2016 --region [a region supported by aws] --server-sdk-version 5.1.3 make sure the SDK version is exactly what u have installed.
  4. After pushing, limit the maximum server processes per instance to 1 to ease testing. Beware: test everything as i described before because if a fleet errors out it will take ages to register as a dead fleet to let you delete it.

Side note: if you are trying to use only blueprint or prefer them, copy-paste the code for the GameMode and then make a new one that is a child of it, so AWS will run and you can code your GM with blueprints.

answered a year ago
-1

Based on the information provided, it appears you're encountering a common issue with Amazon GameLift where the server process is not initializing properly. Here are a few potential reasons and solutions to consider:

  1. SDK Version Mismatch: Ensure that the ServerSdkVersion parameter used when creating the build resource matches the server SDK version you're using (5.1.3 in your case). The default value is 4.x, which is not compatible with newer SDK versions. You may need to create a new build and deploy it to a new fleet with the correct SDK version specified.

  2. InitSDK() Timeout: Your server process may not be calling InitSDK() within the expected time frame (usually 5 minutes). Double-check your server code to ensure InitSDK() is being called promptly after the process starts.

  3. Process Crashing: The error message suggests that the server process might be crashing before it can properly initialize. This could be due to various reasons, including compatibility issues or errors in your game code.

  4. Logging Issues: The lack of CloudWatch logs is concerning. Ensure that your server process has the necessary permissions to write logs and that logging is correctly configured in your game server code.

  5. Fleet Configuration: Verify that your fleet is correctly configured, including the launch path for your server executable and any required launch parameters.

  6. Network Configuration: The "network failure" you mentioned in your local tests might be more significant when running in the GameLift environment. Ensure your server is correctly set up to communicate with GameLift services.

To troubleshoot further:

  1. Review your server code, particularly around the InitSDK() call, to ensure it's being executed correctly and early in the process.
  2. Double-check your build and fleet configurations in the GameLift console.
  3. Try to enable more verbose logging in your server code to capture any errors that might occur before the SDK initialization.
  4. Consider using Amazon GameLift's remote access feature to connect to the EC2 instance and investigate the server process directly.

If these steps don't resolve the issue, you may need to open a support case with AWS for more detailed assistance, as there might be underlying issues specific to your setup that require deeper investigation.
Sources
BUG: Server process started correctly but did not call InitSDK() or ProcessReady() within 5 minutes | AWS re:Post
C++ (Unreal) server SDK 5.x for Amazon GameLift Servers -- Actions - Amazon GameLift Servers
Go server SDK for Amazon GameLift Servers -- Actions - Amazon GameLift Servers

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.