.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 ?

已提問 2 個月前檢視次數 141 次
1 個回答
1
已接受的答案

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
專家
Artem
已回答 2 個月前
profile picture
專家
已審閱 2 個月前
profile picture
專家
已審閱 2 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南