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

Runtime failed to start: fork/exec /var/task/bootstrap: exec format error <nil> #5340

Closed
kdnakt opened this issue Nov 8, 2019 · 7 comments
Closed
Labels
area/amazon-lambda kind/question Further information is requested

Comments

@kdnakt
Copy link
Contributor

kdnakt commented Nov 8, 2019

Describe 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:

  1. Prepare an IAM Role with basic lambda policy:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:PutLogEvents"
            ],
            "Resource": "*"
        }
    ]
}
  1. Create a maven project with mvn archetype:generate -DarchetypeGroupId=io.quarkus -DarchetypeArtifactId=quarkus-amazon-lambda-archetype -DarchetypeVersion=1.0.0.CR1 and edit create-native.sh's IAM Role ARN.
  2. Run mvn clean install -Dnative and bash ./create-native.sh
  3. 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 or ver: 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)

@kdnakt kdnakt added the kind/bug Something isn't working label Nov 8, 2019
@goranopacic
Copy link

+1

@jaikiran
Copy link
Member

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)

@kdnakt, Does it work if you use Java 8 instead of Java 11?

@goranopacic
Copy link

@jaikiran I have the same problem with Java 8:
% java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
Eclipse OpenJ9 VM (build openj9-0.17.0, JRE 1.8.0 Mac OS X amd64-64-Bit Compressed References 20191017_369 (JIT enabled, AOT enabled)
OpenJ9 - 77c1cf708
OMR - 20db4fbc
JCL - 97b5ec8f383 based on jdk8u232-b09)

@jaikiran
Copy link
Member

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:

mvn clean install -Dnative -Dquarkus.native.container-build=true

This should generate the native image within a container and you can then use the create-native.sh and invoke-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

@goranopacic
Copy link

thanks @jaikiran - it works now!

@jaikiran
Copy link
Member

@goranopacic Thank you for confirming. I'll close this now.

@kdnakt
Copy link
Contributor Author

kdnakt commented Nov 11, 2019

@jaikiran Thanks for your advice, I just confirmed it worked with Java11 following your advice!

Also, thank you for @goranopacic trying with Java8.

@gsmet gsmet added kind/question Further information is requested and removed kind/bug Something isn't working labels Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/amazon-lambda kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants