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?

asked 7 years ago524 views
9 Answers
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

answered 7 years ago
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

answered 7 years ago
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.

answered 7 years ago
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

answered 7 years ago
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.

answered 2 years ago
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.

answered 2 years ago
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.

answered a year 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