How to correctly prepare Linux Executables

After following the instructions to build an Amazon Linux Server, I tried to upload it to start a fleet, but I’ve been having some issues.

The build scripts outputs everything to a bin/ folder, in the end it includes a Main executable and the required dynamic libraries.

If I do ./Main from the Server terminal, it starts the process correctly.
I’m uploading the build passing --build-root PATH/bin/ and the AMAZON_LINUX flag for operative system.
The path I’m telling the Fleet to invoke is /Main with a dummy 1234 param.

However, my fleet fails to activate and the error:
Server Process exited without calling process ending with exit code 127. (/local/game/Main 1234)

What is the correct way to package / build / upload the Linux binaries?

What should the install.bat do? Should it be an install.sh instead? Is it sourced or executed in a different shell? What is the $PATH? Should we copy the binaries to that path in the install script?

using bin/Main doesn’t work either. (And as a note, the Web console will not allow ‘/’ on the path (even when the prefixed path has forward slashes))

FLEET_VALIDATION_LAUNCH_PATH_NOT_FOUND
No specified launch paths [/local/game/bin/Main] exist.

If I use just /local/game/Main as the launch path, the install.sh will get called (I got a 127 error when I typoed on a command), after fixing the typo I started getting error 1 and I get to activating (It passes the validation state)) whereas with bin/Main it fails earlier.

Upload:
#!/bin/sh

aws gamelift upload-build --operating-system “AMAZON_LINUX” --name “Polyminis Server 1” --build-version “0.0.1” --build-root …/bin

Build:
#!/bin/sh

mkdir -p …/bin

clang++ -std=c++11 -I…/thirdparty/gamelift/include/ -L…/thirdparty/gamelift/lib/amazon_linux_x64 -L…/thirdparty/dependencies/sio_libs -Wl,-rpath=. -o …/bin/Main …/src/Main.cpp -laws-cpp-sdk-gamelift-server -lsioclient -lboost_date_time -lboost_system

cp …/thirdparty/dependencies/sio_libs/lib*.so* …/bin/

cp …/thirdparty/dependencies/boost_libs/lib*.so* …/bin/

cp …/thirdparty/gamelift/lib/amazon_linux_x64/libaws-cpp-sdk-gamelift-server.so …/bin/

The build folder just has Main and the dynamic libraries required for it to run.

Hello @Polyminis,

Just checking in, did our recommendation help out with the issue you were experiencing?

Thanks!

Hi @darkblitz,

Unfortunately this doesn’t solve the problem. After changing the permissions of install.sh and Main (and adding a line to install.sh to change Main’s permissions when ran).

I got the same error:
Server Process exited without calling process ending with exit code 127. (/local/game/Main 1234)

Hello @Polyminis,

I sincerely apologize that you are still experiencing issues with GameLift. To help answer your remaining questions and to expedite the support, I have requested that the GameLift team reach out to you and you should receive an email from them shortly.

If there is anything else that I can help out with, please don’t hesitate to let me know!

Thanks!

Hello @Polyminis,

Interesting. Can you please post the commands that you used to package the build, upload the build, and possibly a picture of how the build structure looks like on your machine?

Thank you!

@darkblitz
Wondering if you had a chance to look into this.

Hello @Polyminis,

I have discussed this issue with the team here and was recommended that you try the following suggestion:

  • Ensure both the executable and install.sh have executable permissions through chmod before attempting to upload the build to GameLift.

Please let us know if that works out for you.

Thanks!

@darkblitz (couldn’t reply to your comment for some reason):

I appreciate all the help, but we’re spinning around some very basic stuff (chmod, libraries) that I am almost positive have nothing to do with the actual problem and it is starting to get frustrating. This shouldn’t be a hardcore investigative issue, but just a minor communication thing as I’m doing nothing but trying to run the most basic Gamelift Server.

Why I don’t believe is a library issue:
1.- I can run my program on the AWS Linux box. I can CD to my bin folder, ./Main and see output come. The process will stay running for ever and will output stuff about not finding the service endpoint (I’m assuming this is the process trying to find GameLift related services and failing since the box itself does not have them). This discards basically all of the suggestions you’ve posted: chmod, library issues, missing dependencies etc…
This is different from what is being reported by Gamelift.

2.- The error code is pretty specific: 127 means Command Not Found. So the first question would be, what command is being run? Given the documentation, the command being run is Main.
If I cd to my bin folder, and I type ‘Main’, I get command not found (as ./ is required, as in ./Main).
If your system is just doing that (cd /local/game) and then (Main) that is the exact same symptom and would require you adding /local/game to the path (or specify that this needs to be done from install.sh, which btw are you ‘sourcing’ or just executing?).
Missing libraries do not manifest as 127 (they manifest as exit code 1, generic error), so this replies feel almost condescending and completely missing the core of my issue.

Do you have an example that builds and runs in linux you can provide? Do you have any further documentation on how to dump or create logs? Is there a configuration we can use for an EC2 instance that replicates the Gamelift environment to test and get confidence?

I must confess at this point I’m feeling pretty discouraged by the whole Lumberyard ecosystem and am strongly considering dropping it all together for different engine / self-rolled AWS apps.

Hello @Polyminis,

We have investigated the issue further and it seems like the following issues have been surfaced during our investigation:

  1. missing the .so files (or wrong file name 1.55.0 vs 1.53.0) that Main is expecting.
  2. missing libprotobuf.so

Essentially, there are more dependencies that are missing from the uploaded build to GameLift.

Please let us know if this helps out!

Thanks!

Hello @Polyminis,

I sincerely apologize that you are having trouble with running a Linux build on GameLift.

I would highly recommend verifying the Launch Path that you provide to the GameLift Fleet when creating it. This path should be the full path to the Linux executable. In your case, that would be bin/Main. Please give that a shot and let us know if it works out for you.

You are correct in assuming that you should use install.sh on Linux. Again, apologies on that, we are working hard on on improving our documentation and tutorials to make this process easier for you. Your feedback is very important to us! Please reach out to us in the Tutorial Discussion for any feedback that you have.

I’m not sure what $PATH you are referring to but I can speak to how the install.sh script works. Essentially, it allows you to execute commands (like installing an SDK for example) before the game server is launched.

Please let us know if this works out for you.

Thank you!

Hello @Polyminis,

I am having the team look into it for you. We will hopefully have an answer for you soon.

If you don’t mind, would you please send an email to lumberyard-feedback@amazon.com with your fleet ID to help with the investigation?

Thank you!

FYI: https://github.com/zeliard/GameLift/tree/master/GameLiftLinuxServer