SAM CLI 和 Quarkus:/var/task/bootstrap:没有这样的文件或目录

问题描述 投票:0回答:2

当我尝试使用 SAM cli 按照 tutorial 在本地调用我的 quarkus 本机函数时,它无法运行,并出现以下错误

no such file or directory
(对于
/var/task/bootstrap
)。 Function.zip 确实存在并且包含 bootstrap,有人知道如何解决吗?

操作系统:Ubuntu 18(在 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
amazon-web-services aws-lambda serverless quarkus aws-sam-cli
2个回答
0
投票

我也遇到了同样的问题,如果您正在为 golang 使用

bootstrap
运行时,请将可执行二进制文件命名为
PROVIDED_AL

例如

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


-1
投票

当人们遵循非本机构建过程 (https://quarkus.io/guides/amazon-lambda#build-and-deploy) 但部署为本机时,我就看到了这个问题。通过调用例如进行本机构建(https://quarkus.io/guides/amazon-lambda#deploy-to-aws-lambda-custom-native-runtime

)非常重要
./mvnw package -Dnative

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

还有另外两个相关帖子:

© www.soinside.com 2019 - 2024. All rights reserved.