By using AWS re:Post, you agree to the AWS re:Post Terms of Use

SERVER_PROCESS_CRASHED Server process exited without calling ProcessEnding(), SERVER_PROCESS_SDK_INITIALIZATION_TIMEOUT: The server process did not call InitSDK() within the time expected.

0

Hi, I am experiencing an issue when trying to deploy on a managed EC2 fleet. Everything works fine on the Anywhere fleet, but for the managed EC2 fleet, I am encountering the following error:

SERVER_PROCESS_CRASHED: Server process exited without calling ProcessEnding().
SERVER_PROCESS_SDK_INITIALIZATION_TIMEOUT: The server process did not call InitSDK() within the time expected.

Here is my Setup:

  • Target Platform: Windows Server
  • Game Engine: Unity
  • Plugin: amazon-gamelift-plugin-unity-release-2.1.0
  • Server SDK Version: 5.1.2

I have tried both deployment approaches: deploying from within the editor and using the CLI to upload the build. However, both methods are failing during the fleet activation process. I created the build as we typically do for the server from the Unity editor and uploaded it using the following command:

aws gamelift upload-build --name "Test_Server_1.0" --operating-system WINDOWS_2016 --server-sdk-version "5.1.2" --build-root "F:\Builds\MySampleGame\GameLift_Test" --build-version "1" --region ap-southeast-1

The build has been uploaded and appears in a ready state, but when I create a fleet using it, I encounter those errors.

Here is the configuration I am using for the fleet.

  • Compute Type : Managed EC2

  • Build Type : Build

  • Fleet Type : On Demand

  • Intance Type: c5.large

  • Launch Parameters: --batchmode --nographics -logfile /C:/game/logs/log.txt

  • Concurrent Process: 1

My sample game contains only a simple script attached to a GameObject, which calls InitSDK() without any parameters in the Start() function.

Am I missing any crucial steps, or do I need to create the server executables in a different way?

Here is the build directory I am uploading.

Enter image description here

I have also added an install.bat file to try to resolve the error, but I am still encountering the same issue even after including it. Here are the contents of the install.bat file:

@echo off
echo Starting server installation and setup...

:: Install Visual C++ Redistributable (adjust based on your server requirements)
echo Installing Visual C++ Redistributable...
powershell -Command "Invoke-WebRequest -Uri https://download.microsoft.com/download/vc_redist.x64.exe -OutFile vc_redist_installer.exe"
start /wait vc_redist_installer.exe /quiet /norestart
del vc_redist_installer.exe
echo Visual C++ Redistributable installation completed.

echo Installation and setup completed successfully.
exit /b 0

Thank you, any assistance would be greatly appreciated.

asked a month ago33 views
1 Answer
0

Based on the information provided, it appears you're encountering issues with your Amazon GameLift server process initialization on a managed EC2 fleet. Here are some potential reasons and solutions for the errors you're experiencing:

  1. SDK Initialization: The error suggests that InitSDK() is not being called within the expected time frame. Ensure that InitSDK() is being called as early as possible in your server process, preferably before any other GameLift-related initialization. In your Unity script, make sure it's in the Start() function and not in a later function like Update().

  2. ProcessEnding() Call: The server is exiting without calling ProcessEnding(). This function should be called after all other cleanup tasks, including shutting down all active game sessions. Make sure you're properly handling server shutdown and calling ProcessEnding() before the process terminates.

  3. Build Configuration: For managed EC2 fleets, ensure your build includes all necessary dependencies. The Visual C++ Redistributable you're trying to install via the install.bat file should ideally be included in your build package rather than downloaded during runtime.

  4. Launch Parameters: Your launch parameters look correct, but ensure the log file path is accessible and writable by the server process.

  5. Server SDK Version: You're using version 5.1.2, which should be compatible. However, double-check that this version is correctly specified when creating your build and fleet.

  6. Build Structure: Your build directory structure looks correct, but ensure that the executable is in the right location and named correctly as expected by GameLift.

  7. Fleet Configuration: Your fleet configuration seems appropriate, but you might want to try increasing the maximum concurrent processes to see if it affects the initialization.

  8. Logging: Enable detailed logging in your Unity server build to help diagnose what's happening during the initialization process. This can help identify where exactly the process is failing.

  9. Testing Locally: Before deploying to GameLift, test your server build locally to ensure it initializes correctly and can shut down properly.

  10. Unity and Plugin Versions: Ensure you're using compatible versions of Unity and the GameLift plugin.

If these steps don't resolve the issue, you may need to review your server code in detail, particularly the initialization process and shutdown handling. Consider reaching out to AWS support with your specific build and logs for more targeted assistance.
Sources
Amazon GameLift server SDK 4.x for C++: Actions - Amazon GameLift
Amazon GameLift server SDK 4.x for C#: Actions - Amazon GameLift
Amazon GameLift server SDK 5.x for C++: Actions - Amazon GameLift

profile picture
answered a month 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.

Guidelines for Answering Questions