Quarkus: Error with native image on AWS Lambda

Created on 5 Mar 2020  路  7Comments  路  Source: quarkusio/quarkus

Describe the bug
Impossible to run a native image on AWS Lambda

Expected behavior
No error should arise

Actual behavior
The custom runtine seems not to be supported by AWS Lambda. It works well on classic EC2

To Reproduce
Steps to reproduce the behavior:

  1. Follow the https://quarkus.io/guides/amazon-lambda guilde (native)
  2. Update your function.zip as custom runtine on AWS
  3. Save + Test

Configuration

# Add your application.properties here, if applicable.
quarkus.lambda.handler=test
quarkus.package.uber-jar=true
quarkus.native.additional-build-args =-H:-AllowVMInspection

Screenshots
(If applicable, add screenshots to help explain your problem.)
lambda

Environment (please complete the following information):

  • Output of uname -a or ver: Linux localhost.localdomain 5.4.10-200.fc31.x86_64 #1 SMP Thu Jan 9 19:58:12 UTC 2020 x86_64 x86_64 x86_64 GNU/Linu
  • Output of java -version: openjdk version "11.0.6" 2020-01-14
    OpenJDK Runtime Environment GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07)
    OpenJDK 64-Bit Server VM GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07, mixed mode, sharing)
  • GraalVM version (if different from Java):
  • Quarkus version or git rev: 1.2.1.Final
  • Build tool (ie. output of mvnw --version or gradlew --version):
    Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
    Maven home: /home/bertrand/.sdkman/candidates/maven/current
    Java version: 11.0.6, vendor: Oracle Corporation, runtime: /home/bertrand/.sdkman/candidates/java/19.3.1.r11-grl
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "5.4.10-200.fc31.x86_64", arch: "amd64", family: "unix"

Additional context
Some indications can be found here :
https://qiita.com/kencharos/items/69e43965515f368bc4a3
https://github.com/oracle/graal/issues/841
https://github.com/kencharos/try-graal-lambda
https://github.com/kencharos/graal-native-on-lambda

areamazon-lambda kinbug triagduplicate

All 7 comments

/cc @patriot1burke

--environment Variables={DISABLE_SIGNAL_HANDLERS=true}

@gsmet The docs used to go over the function creation scripts and important flags passed, but, against my wishes the current version of the docs removed this. I guess I have to go update the docs to describe the important flags to pass again.

This documentation : https://quarkus.io/guides/amazon-lambda shoud be update according to that documentation : https://quarkus.io/guides/amazon-lambda-http

With :

Finally, there鈥檚 an environment variable that must be set for native GraalVM deployments. If you look at sam.native.yaml you鈥檒l see this:

    Environment:
      Variables:
        DISABLE_SIGNAL_HANDLERS: true

This environment variable resolves some incompatibilities between Quarkus and the Amazon Lambda Custom Runtime environment.

@geniusit See above, there's a command line switch you can pass when you create the lambda:
--environment Variables={DISABLE_SIGNAL_HANDLERS=true}

@geniusit See above, there's a command line switch you can pass when you create the lambda:
--environment Variables={DISABLE_SIGNAL_HANDLERS=true}

Yes, it works with that env variable. Thank you!

Was this page helpful?
0 / 5 - 0 ratings