Fleet Initialization Failed: Cannot run program /local/game/install.sh

0

I'm running into a problem with getting my install script (install.sh) to run on the fleet's creation. I've packaged and uploaded my game build:

aws gamelift upload-build --name Game --build-version 1 --build-root C:/path/to/GameDir --operating-system AMAZON_LINUX --region us-east-1

My directory is currently structured like so:

Game/
  install.sh
  GameDir/
    install.sh
    game.exe

NOTE: I'm running the upload-build command while I'm inside of the Game/ directory. The instance doesn't seem to be able to find either of the install.sh files

FLEET_INITIALIZATION_FAILED
Cannot run program "/local/game/install.sh" (in directory "/local/game"): error=2, No such file or directory

My game seems to be uploaded to /local/game/GameDir so I'm not sure where its trying to get install.sh from. Any ideas?

已提问 7 年前530 查看次数
9 回答
0

Hello @REDACTEDUSER

install.sh (or install.bat) needs to be at the root of the build you upload the GameLift. If that's the case, then GameLift will run the file at Fleet creation time.

If my local directory looks like this:

  Game/ install.sh
GameDir/
game.exe

Then I would run this CLI command to upload a build:

aws gamelift upload-build --name MyGame --build-version 1 --build-root C:/path/to/Game --operating-system AMAZON_LINUX --region us-east-1

GameLift should be able to run the install.sh. Let me know if this is not the case.

That said, I notice that you have an *.exe file in your build and you're creating a Linux fleet. Is this the intention? There is a couple of options to do that, but I would like to know more about your use case here.

Regardless, let's assume this is what we want to do. Then, when creating the Fleet, I would make sure that the runtime configuration's launch path is:

/local/game/GameDir/game.exe

Which respects the folder structure of the build I uploaded before.

Does that make sense?

Cheers!

Alexis

已回答 7 年前
0

Thanks @REDACTEDUSER

I tried it again and ran into the same error message. install.sh is in the root directory, my game is in a subdirectory, and I specify the build-root as the root directory C:/path/to/Game. I don't believe I can ssh in to review the logs or folder structure either after its failed or while its activating

With regards to the Linux/.exe file we intend to run our game servers through wine. Part of the install.sh script will be responsible for installing and setting up wine

已回答 7 年前
0

If the fleet is in "Activating", "Active" or "Error" state you can connect to the instances. How to get the instance creds is pretty buried and you need to use the API to do so

Get your instances

aws gamelift describe-instances --fleet-******

Get the creds for an instance

aws gamelift get-instance-access --fleet-******

Make sure you also have the ssh port for linux and RDP port open in your port settings so you can connect.

已回答 7 年前
0

I would love to see some better logging with the fleet installation / creation, or the ability to prevent an instance from being terminated when there's an error. Its beginning to look like the error message isn't exactly accurate, and that its actually running into problems executing the script instead. I got rid of the Windows CRLF newlines and the error message doesn't come up anymore. However, I'm now presented with a new error

FLEET_STATE_ERROR
Fleet fleet-******

More importantly, getting rid of the install.sh script altogether allows my game to actually run

已回答 7 年前
0

I run into the same problem. install.sh is in the root, but

Cannot run program "/local/game/install.sh" (in directory "/local/game"): error=2, No such file or directory

If I do not add the install.sh there is an error that the file is missing.

Can someone post a working install.sh? Thanks.

已回答 2 年前
0

However, above page contains no install.sh script with the content required when deploying a Linux Build. I am looking for the default install.sh file content, requested per the GameLift Fleet creation process.

已回答 2 年前
0

I solved this problem. I'm leaving it because I think it'd help someone.

If you created <install.sh> on Window, this error is likely to occur.

Linux and Windows have different text formats.

Try open it via vi -b install.sh on Linux.

If you can see characters such as '^M', This error may occur when running it on a GameLift fleet.

已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则