1

When I try to use SAM cli to invoke my quarkus native function locally as per the tutorial it fails to run with bellow error no such file or directory for /var/task/bootstrap. Function.zip does exist and contain bootstrap, Anyone have any ideas how to solve?

OS: Ubuntu 18 (on VirtualBox)

walter@ubuntu18 brialambda/target $ sam local invoke --template sam.native.yaml --event ../payload.json
Invoking not.used.in.provided.runtime (provided)
Decompressing /home/walter/workspace/walterlambda/target/function.zip
Skip pulling image and use local one: public.ecr.aws/sam/emulation-provided:rapid-1.35.0-x86_64.

Mounting /tmp/tmp41trke88 as /var/task:ro,delegated inside runtime container
START RequestId: ee5e27d8-4bb7-4e0a-8873-f92c48459993 Version: $LATEST
time="2021-11-09T14:15:38.302" level=error msg="Init failed" InvokeID= error="fork/exec /var/task/bootstrap: no such file or directory"
Function 'WalterlambdaNative' timed out after 15 seconds
user1843591
  • 1,074
  • 3
  • 17
  • 37
  • the initial proposed solution below (now deleted) was incorrect, unable to reproduce the fix. still unable to fix above – user1843591 Nov 17 '21 at 22:09
  • If I step back from above and try to just invoke on AWS rather than SAM local I get the below error. i think this is the real issue... `target/manage.sh native invoke` `Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap] Runtime.InvalidEntrypoint {"errorMessage":"RequestId: 2051de27-3cfa-408b-99e0-cec59025ffb1 Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]","errorType":"Runtime.InvalidEntrypoint"}` – user1843591 Nov 18 '21 at 09:55

1 Answers1

0

I've seen that issue when people followed the non-native build process (https://quarkus.io/guides/amazon-lambda#build-and-deploy) but deployed as native. It is important to do the native build (https://quarkus.io/guides/amazon-lambda#deploy-to-aws-lambda-custom-native-runtime) by calling e.g.

./mvnw package -Dnative

or

./gradlew build -Dquarkus.package.type=native

There are two other related posts as well:

Dennis Kieselhorst
  • 1,280
  • 1
  • 13
  • 23