.net Server app deploy on gamelift fleet

0

I just upload the build with install.sh to gamelift, but cause error"FLEET_INITIALIZATION_FAILED Cannot run program "/local/game/install.sh" (in directory "/local/game"): error=2, No such file or directory"

But Extrating Build logs shows it has this file

 Extracted files from build: 
	/local/game/amazon-cloudwatch-agent.json
	/local/game/common-config.toml
	/local/game/install.sh

And install.sh:

#!/bin/bash

sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo yum install dotnet-sdk-5.0

# Download and install the agent
wget https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm
sudo rpm -U ./amazon-cloudwatch-agent.rpm

# Copy the cloudwatch agent configuration file to the right directory
sudo cp amazon-cloudwatch-agent.json /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json

# Copy the common-config.toml to the right directory to set shared credentials access with the Fleet role
sudo cp common-config.toml /opt/aws/amazon-cloudwatch-agent/etc/common-config.toml

# Start the agent
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s

Is there something wrong ?

asked a month ago129 views
1 Answer
1
Accepted Answer

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

Linux and Windows have different text formats.

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

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

profile picture
EXPERT
Artem
answered a month ago
profile picture
EXPERT
reviewed a month ago
profile picture
EXPERT
reviewed a month 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