Gamelift SDK 5.2.0 InitSDK Failed + UE 5.4

0

After downloading Official AWS UE Plugin, base on the README file in GameLiftServerSDK folder. I had setup the InitSDK function as below.

		if (FParse::Value(FCommandLine::Get(), TEXT("-authtoken="), serverParameters.m_authToken))
		{
			UE_LOG(LogGameLift, Log, TEXT("AUTH_TOKEN: %s"), *serverParameters.m_authToken)
		}
    
		//The Host/compute-name of the GameLift Anywhere instance.
		if (FParse::Value(FCommandLine::Get(), TEXT("-hostid="), serverParameters.m_hostId))
		{
			UE_LOG(LogGameLift, Log, TEXT("HOST_ID: %s"), *serverParameters.m_hostId)
		}
    
		//The EC2 or Anywhere Fleet ID.
		if (FParse::Value(FCommandLine::Get(), TEXT("-fleetid="), serverParameters.m_fleetId))
		{
			UE_LOG(LogGameLift, Log, TEXT("FLEET_ID: %s"), *serverParameters.m_fleetId)
		}
    
		//The WebSocket URL (GameLiftServiceSdkEndpoint).
		if (FParse::Value(FCommandLine::Get(), TEXT("-websocketurl="), serverParameters.m_webSocketUrl))
		{
			UE_LOG(LogGameLift, Log, TEXT("WEBSOCKET_URL: %s"), *serverParameters.m_webSocketUrl)
		}
    
		//The PID of the running process
		serverParameters.m_processId = FString::Printf(TEXT("%d"), GetCurrentProcessId());
		
		GameLiftSdkModule->InitSDK(serverParameters);	

I can't seem to find out what was the issue it failing to InitSDK, not sure my setup was wrong or documentation was outdated? I had also test running this on my local machine which the error I had was: [error] Failed to generate SigV4 Query Parameters due to AwsRegion is required [error] Networking outcome failure when init SDK I not sure is this relate to why sdk failed to init for gamelift EC2.

Question:

  1. base on above is there anything I could setup wrong or missing?
  2. Is Generate a shared credentials file when creating fleet is must check?
  3. Are we suppose to use with server parameter for Gamelift EC2? (previous we are only require to call InitSDK() without parameter);
  4. if the issue was require AwsRegion to set, how can I do it? is there any documentation?

Edited: I was testing on Windows Server Build, wonder is the InitSDK will be different for Linux and Windows?

asked a month ago41 views
1 Answer
0

Based on the information provided, there are a few points to consider regarding your GameLift SDK initialization issue:

  1. For GameLift managed EC2 fleets, you should not use server parameters when calling InitSDK(). The correct approach is to call InitSDK() with NULL or no parameters. Your current setup appears to be using server parameters, which is typically only necessary for GameLift Anywhere fleets.

  2. The error message about AwsRegion being required is likely related to running the SDK on your local machine, not on the GameLift EC2 instance. When running on an actual GameLift fleet, the region information is automatically provided by the environment.

  3. Generating a shared credentials file is not typically necessary for GameLift EC2 fleets. The EC2 instances in a GameLift fleet are pre-configured with the necessary permissions and credentials.

  4. For GameLift EC2 fleets, you should simplify your InitSDK call to:

    GameLiftSdkModule->InitSDK();
    

    Remove all the parameter parsing and serverParameters object creation for EC2 fleets.

  5. If you're testing locally and need to set the AWS region, you can do so through environment variables or AWS configuration files. However, this is not necessary when running on actual GameLift EC2 instances.

  6. Make sure you're using the correct version of the GameLift SDK that's compatible with your Unreal Engine version. Incompatibilities can sometimes cause initialization failures.

  7. When running on the actual GameLift EC2 fleet, check the game session logs for more detailed error messages. You can access these logs by remotely connecting to the fleet instances.

If you continue to experience issues after simplifying the InitSDK call for EC2 fleets, you may need to review your fleet configuration and ensure that all necessary permissions and settings are correctly set up in the AWS GameLift console.
Sources
SERVER_PROCESS_SDK_INITIALIZATION_TIMEOUT Error Occurs in Initsdk. Please Help. | AWS re:Post
What is GameLiftWebSocket? | AWS re:Post

profile picture
answered a month ago
  • It seem InitSDK() function was outdated method to call?

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