Runtime failed to start: fork/exec /var/task/bootstrap: exec format error <nil>
See original GitHub issueDescribe the bug I created a maven project according to this guide: https://github.com/quarkusio/quarkus/blob/master/docs/src/main/asciidoc/amazon-lambda.adoc
And got an error when I tried bash ./invoke-native.sh
Expected behavior
out
file is like following when I created the function with invoke.sh
.
{"result":"hello Bill","requestId":"1434f808-f8c4-4d8c-a507-fe4464273e6e"}
Actual behavior
out
file is:
{"errorType":"Runtime.ExitError","errorMessage":"RequestId: 6b8192ad-5a30-4efa-a3e1-2905cfe5542e Error: &{0xc000092240 map[invoke_id:6b8192ad-5a30-4efa-a3e1-2905cfe5542e sandbox_id:0] 2019-11-08 17:40:39.511112521 +0000 UTC m=+0.070780883 panic <nil> Runtime failed to start: fork/exec /var/task/bootstrap: exec format error <nil> }"}
To Reproduce Steps to reproduce the behavior:
- Prepare an IAM Role with basic lambda policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "*"
}
]
}
- Create a maven project with
mvn archetype:generate -DarchetypeGroupId=io.quarkus -DarchetypeArtifactId=quarkus-amazon-lambda-archetype -DarchetypeVersion=1.0.0.CR1
and editcreate-native.sh
’s IAM Role ARN. - Run
mvn clean install -Dnative
andbash ./create-native.sh
- And then
bash ./invoke-native.sh
shows error
START RequestId: 09c77434-b332-4f21-bfd4-686636bf9f54 Version: $LATEST
END RequestId: 09c77434-b332-4f21-bfd4-686636bf9f54
REPORT RequestId: 09c77434-b332-4f21-bfd4-686636bf9f54 Duration: 92.68 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 13 MB
RequestId: 09c77434-b332-4f21-bfd4-686636bf9f54 Error: &{0xc00005e2a0 map[invoke_id:09c77434-b332-4f21-bfd4-686636bf9f54 sandbox_id:0] 2019-11-08 18:09:38.736065039 +0000 UTC m=+0.047690988 panic <nil> Runtime failed to start: fork/exec /var/task/bootstrap: exec format error <nil> }
Runtime.ExitError
Configuration
quarkus.lambda.handler=test
Screenshots (If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
- Output of
uname -a
orver
: Darwin kdnakt.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64 - Output of
java -version
: openjdk version “11.0.2” 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) - GraalVM version (if different from Java): graalvm-ce-19.2.1
- Quarkus version or git rev: 1.0.0.CR1
Additional context (Add any other context about the problem here.)
The project is here: https://github.com/kdnakt/quarkus-lambda-sample (Though lambda role arn is not modified)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Error: Runtime failed to start: fork/exec /opt/bootstrap: no such ...
In AWS Lambda there is an answer it says check deployment again to steps and check result sometimes it's not probabily make dir...
Read more >When I try your example code and I create a lambda ... - Medium
Open in app ... AWS Lambda custom runtime + GraalVM native image ... failed to start: fork/exec /var/task/bootstrap: exec format error <nil> ...
Read more >My first experience with AWS Lambda - Grant Winney
exec format error. When I built the Ephemeral package and uploaded it to AWS, then tried to test it out, I got a...
Read more >graalvm/native-image - Gitter
I'm trying to use SAM local to invoke my quarkus native image but i continually get msg="Init failed" InvokeID= error="fork/exec /var/task/bootstrap: no ...
Read more >"exec format error" from SAM Local with Golang on Mac
I was getting my hands dirty with AWS SAM Local and Golang based functions the other day (since golang function support was added...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Having looked around a bit, it looks like in this case, either or both of you are building this native image on MacOS and then running it on Linux VM perhaps?
Can one you try using this command to build the native image locally:
This should generate the native image within a container and you can then use the
create-native.sh
andinvoke-native.sh
as usual to try out the AWS function.More details on generating a native-build through a container can be found here https://quarkus.io/guides/maven-tooling#build-a-container-friendly-executable
@jaikiran Thanks for your advice, I just confirmed it worked with Java11 following your advice!
Also, thank you for @goranopacic trying with Java8.