小编rob*_*beb的帖子

sam local start-api go lambda 在 Linux ubuntu 上返回 502“内部服务器错误”


在本地运行 aws sam 应用程序时返回“内部服务器错误”。

我使用以下命令创建了 aws sam hello-world 示例:
sam init --runtime go1.x --name robertsamlocallyhelloworld
Run Code Online (Sandbox Code Playgroud)

然后我使用以下命令在本地运行应用程序:

sam local start-api
Run Code Online (Sandbox Code Playgroud)

然后:

curl 127.0.0.1:3000/hello
Run Code Online (Sandbox Code Playgroud)

图像下载已开始,然后在一段时间后停止。

/hello端点返回:502 "Internal server error"

我正在使用:
Sam Cli:1.15.0
Docker:20.10.0

输出:

Invoking hello-world (go1.x)<br>
Image was not found.<br>
Building image....................................<br>
Skip pulling image and use local one: amazon/aws-sam-cli-emulation-image-go1.x:rapid-1.15.0.<br>

Mounting /home/robert/projects/try_dir/try_sam_go_daemons/robertsamlocallyhelloworld/hello-world as /var/task:ro,delegated inside runtime container<br>
START RequestId: 159c8e80-649d-4c71-8b54-3221387af308 Version: $LATEST<br>
fork/exec /var/task/hello-world: no such file or directory: PathError<br>
null<br>
END RequestId: 159c8e80-649d-4c71-8b54-3221387af308<br>
REPORT RequestId: 159c8e80-649d-4c71-8b54-3221387af308  Init Duration: …
Run Code Online (Sandbox Code Playgroud)

ubuntu go aws-lambda aws-sam-cli aws-sam

3
推荐指数
1
解决办法
9254
查看次数

标签 统计

aws-lambda ×1

aws-sam ×1

aws-sam-cli ×1

go ×1

ubuntu ×1