Not working after Gamelift Server SDK (C#) Upgrade 4.0.2 to 5.1.1

0

For my Unity game I used end of 2020 the Gamelift Server SDK 4.0.2 which worked fine since then. I downloaded the GameLift-CSharp-ServerSDK-4.0.2.zip, created the dll (Net45) files and copied them into my Unity project. The sessions worked and I could afterwards download the logs from the sessions.

But with the upgrade to Gamelift Server SDK 5.1.1 it does not work anymore. Again I build the dll (Net462) files, and replaced the old ones (I don't want to use the Gamelift-Unity-Plugin, since it creates other problems). Also for the upload-build command I deliver the option --server-sdk-version 5.1.1. The activation of the fleet works fine, so it seems to call GameLiftServerAPI.InitSDK() (without a parameter, because I don't want to use this new Anywhere-fleet). (Note: Without the option --server-sdk-version 5.1.1 it does not call InitSDK() and the fleet gets not activated)

And as soon as I start a gameSession, it does not call GameLiftServerAPI.ActivateGameSession(). If the session gets terminated and I download the logs it just tells:

Game Server Logs
Error: Missing file/directory /local/game/logs/myserver.log

Like before, I add the logFile path to the LaunchPath parameters. And sure, my old version is already 3 years old, but still, I changed nothing in my Unity project, only upgraded the dlls. Do I miss something here?

  • So why is it successfully calling GameLiftServerAPI.InitSDK(), but not GameLiftServerAPI.ActivateGameSession() anymore?
  • And why does it create no log file anymore?
  • (Accessing the instance does also not work for me: An error occurred (TargetNotConnected) when calling the StartSession operation: i-12345 is not connected.)
Elijah
asked 4 months ago209 views
1 Answer
1

Hello,

Accessing the instance does also not work for me

Did you follow this doc (Connect to an instance (server SDK 5) section) https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html#fleets-remote-access-connect When trying to access the instance? There're some changes for SDK 5 vs SDK4

why does it create no log file anymore?

If you were previously using LogPaths parameter to assign the log path, the parameter is no longer used. Please refer to https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-initialize to provide logPath when calling ProcessReady() instead.

Hopefully with instance and log access and you will be able to find the cause of the start game session issue

AWS
fzehao
answered 4 months ago
  • Hi fzehao, thanks for your answer!

    "Did you follow this doc[...]?" Yes, I followed the steps for SDK 5. E.g. if I manipulate a token in the "export AWS_*" step, it even tells me that I'm not authorized (expected).

    "If you were previously using LogPaths parameter to assign the log path[...]" I was not even aware of this parameter before ^^, so yes, I'm using ProcessReady() to provide the logPath, like I did before with SDK 4. I changed nothing there.

    PS: What I also tried, was adding an amazon-cloudwatch-agent.json (together with a install.sh) to the build before the upload, which observes the logPath, so I can see the results in Cloudwatch. This worked with SDK 4, but not SDK 5. Usually with SDK 4 I could even see my log messages, which were created when initSDK() was called. But with SDK 5 there is "nothing" -which is weird, because the fleet is active.

  • For SDK5, the new shared credentials feature was recently added to support CloudWatch Agent: https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateFleet.html#gamelift-CreateFleet-request-InstanceRoleCredentialsProvider https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-resources.html

    For the instance access issue, according to ssm doc, the issue might occur when the compute is in a different region. Did you call aws ssm start-session with the right --region <aws-region> flag? Also a sanity check, is the instance still active while trying to access it?

  • "For SDK5, the new shared credentials feature was recently added to support CloudWatch Agent" I followed this tutorial to set it up: https://aws.amazon.com/de/blogs/gametech/game-server-observability-with-amazon-gamelift-and-amazon-cloudwatch/ I went through the link you provided, but I don't think there is much difference. I added now "--instance-role-credentials-provider SHARED_CREDENTIAL_FILE" as parameter to the "create-fleet" command, but it didn't change anything (Before I had already added --instance-role-arn) But let's assume that the error reported by the terminated gameSession is correct: "Error: Missing file/directory /local/game/logs/myserver.log" Then anyways, if there is no log file, then it can't be observed. "Did you call aws ssm start-session with the right --region <aws-region> flag?" Yup I did (My region for everything is "eu-central-1") "Also a sanity check, is the instance still active while trying to access it?" Yes, it is still active after trying to access it. I don't know how exactly it works under the hood. If my SDK-5 dll is somehow broken, or there are missing dll's, should I still be able to connect to the instance? Or is the SDK dll responsible for that?

  • You should still be able to access the instance if the dll is broken. In this case, I recommend reaching out to AWS support with information like the fleet id so the service team can help investigate the issue

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