Gamelift fleet creation from real-time script stuck in "Activating" status with insufficient event logs

1

Hi community,

I was trying to initiate a Gamelift fleet using an zip file from s3 (created by CDK Asset). However the fleet created will get stuck in "Activating" for more than one hour and then error. No usable event log is emitted from console during "Activating". I can ssh into the game server in error status but not sure if that is helpful.

Any help would be appreciated on how to debug further.

(More context: the server files themselves are fine. I uploaded the zip file directly to create the script and the fleet from the script is created just fine). The s3 access rights seem to be okay too, I followed the example here . The CDK code for uploading server to s3 and creating the script is as follows)

import { Role, PolicyStatement, ServicePrincipal } from "aws-cdk-lib/aws-iam";
import { Asset } from "aws-cdk-lib/aws-s3-assets";
import { Bucket } from "aws-cdk-lib/aws-s3";
import { CfnScript } from "aws-cdk-lib/aws-gamelift";

...
// Upload gamelift real-time server script as cdk asset
    const scriptAsset = new Asset(this, "MyAsset", {
      path: pathToScript,
    });

    const assetBucket = Bucket.fromBucketName(
      this,
      "ScriptAssetBucket",
      scriptAsset.s3BucketName
    );
    
    const scriptAccessRole = new Role(this, "ScriptAccessRole", {
      assumedBy: new ServicePrincipal("gamelift.amazonaws.com"),
    });
    scriptAccessRole.addToPrincipalPolicy(
      new PolicyStatement({
        actions: ["s3:GetObject", "s3:GetObjectVersion"],
        resources: [`${assetBucket.bucketArn}/${scriptAsset.s3ObjectKey}`],
      })
    );

    const script = new CfnScript(this, "RealTimeScript", {
      name: `my-script`,
      version: "0.1",
      storageLocation: {
        bucket: scriptAsset.s3BucketName,
        key: scriptAsset.s3ObjectKey,
        roleArn: scriptAccessRole.roleArn,
      },
    });
    script.node.addDependency(scriptAccessRole);
  • Did you solve this issue? If yes, please share. I am stuck for 3 days.

  • Op here. I solved it. The actual reason seems to be: CDK Asset cannot be used to host a game lift script. I ended up using a custom s3 bucket and that solved it.

  • Sir, it's not happening. Even I am manually passing the s3 bucket and object key. It's not happening. Script size is showing 0 bytes. Error in Aws console is Resource fleet-2d5a0ff4-b794-4188-adbe-xxxxxxxx is not in a taggable state. In doing ssh, I am finding that code has been uploaded. But it's stuck in the Activating part for 1 hour. Also, I have tried manually, from the AWS console, same situation occurs. Only when I upload through the zip file (which is for less than 5 mb), then only the fleet gets activated. Please help me. I am simply uploading the most minimal code which is just having an init function for example purpose.

  • In my case I always uploaded the script as a zip file and no problem.

  • Maybe this post can help you: https://github.com/aws/aws-cdk/pull/21805 to disable automatic unzipping when uploading to s3.

asked 2 years ago239 views
1 Answer
0

Hi,

One common reason a fleet goes from the ACTIVATING status into ERROR is due to an invalid LaunchPath in the ServerProcess configuration https://docs.aws.amazon.com/gamelift/latest/apireference/API_ServerProcess.html

Hope that helps.

AWS
answered 2 years ago
  • There are 2 ways to upload the script; 1 by uploading zip file and 2 by using s3. It is clearly mentioned in the problem statement that when uploaded through the zip file directly, the fleet runs properly. During activation, the LaunchPath is checked separately. We see in the events sections. Hence, there should be no question about invalid launch Path. The real problem is the fleet is not activated when we create the fleet from the script uploaded by s3. Also, by ssh in fleet instance, we see that script is loaded in the fleet server from s3. Hence, there must be something that we are missing here. AWS console showing error Resource fleet-2d5a0ff4-b794-4188-adbe-xxxxxxxx is not in a taggable state

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