Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batch job failed: "exec /entry.sh: no such file or directory" #1

Open
Dan-Carruthers opened this issue Dec 2, 2022 · 11 comments
Open

Comments

@Dan-Carruthers
Copy link

Apologies in advance if I'm missing something obvious, I'm new to AWS.

I'm deploying as per the instructions:
npm install in the cloned repository (after changing region in sst.json and instance type in awsconfig.json)
npm run deploy -- --stage Prod

It deploys and gives me the bucket name, I upload my image and upload an empty file named "dispatch".
Then the batch job changes status to runnable, but then after a few minutes changes status to failed.
The log says "exec /entry.sh: no such file or directory".

I thought it might be to do with my windows 10 machine saving the entry.sh files with windows line endings instead of unix line endings so saved them as unix, but I still get the issue.

I haven't changed any of the code apart from sst.json and awsconfig.json as above.
Do you have any idea why this is or am I missing an important step?

@TotallyGatsby
Copy link
Owner

I'll take a look this weekend. Could be I missed something from my local env.

@TotallyGatsby
Copy link
Owner

What instance type?

@Dan-Carruthers
Copy link
Author

      r6g.4xlarge

@TotallyGatsby
Copy link
Owner

Does the same issue occur with r6gd.4xlarge? I wonder if the lack of ephemeral storage is something I hadn't considered.

@Dan-Carruthers
Copy link
Author

Just tried it with r6gd.4xlarge I still had the same error unfortunately.

@TotallyGatsby
Copy link
Owner

Hmmm... strange. I don't think Windows line endings are the culprit. The dockerfile should be copying the entry.sh (it correctly has a COPY command), and the CDK should be including/uploading that file in the DockerImageAsset (line 86 of DroneYardStack.)

I'll set up a windows machine and see if I can replicate it over here.

@Dan-Carruthers
Copy link
Author

Just checking if you got a chance to try to replicate it on a windows machine.

@AlexCarusoFan4
Copy link

'Slightly' late, but also experiencing the same issue - deploying the CDK stack from a windows machine.

Going to try deploying from a Linux machine as a workaround.

@AlexCarusoFan4
Copy link

Some progress.

From both a linux machine and converting script files to LF, now getting this error:

exec /entry.sh: exec format error

Haven't been able to troubleshoot this yet.

@AlexCarusoFan4
Copy link

Quick update - got the fix.

Looks like it's two issues (at least in my case).

First one was indeed the line endings - as it was in the wrong format (thanks to my Windows environment), it was being ignored by Docker COPY. This is why you get the "exec /entry.sh: no such file or directory" error message.

Next issue was the instance type.

If you choose an ARM CPU architecture instance type, the script file can not be run, and results in the "exec /entry.sh: exec format error" error message.

Choosing a x86/64 or Standard CPU architecture instance type, and updating the contents of DroneYardStack.js to use an AMI hardware type of 'STANDARD' for the AWS Batch compute environment worked.

In this case I opted for r5.4xlarge.

@TotallyGatsby
Copy link
Owner

Apologies! My notifications were off. I'll update the line endings and add some documentation about instance type/AMI selection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants