amazon-web-servicesaws-lambdaserverlessquarkusaws-sam-cli

SAM CLI and Quarkus: /var/task/bootstrap: no such file or directory


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

Solution

  • I had the same issue, make sure your executable binary is named bootstrap if you are using PROVIDED_AL runtime for golang.

    e.g. go build -o .bin/bootstrap ./lambda/main.go