如何解决如何使用自定义运行时从 AWS Lambda 获取 ECR 容器日志
我终于在 ECR 上使用自定义运行时获得了一个 lambda 函数。它旨在通过 HTTP Api 访问。但是请求因内部服务器错误而失败。 日志给了我以下错误:
"Error":"Runtime exited with error":
exit status 1.
Check your Lambda function code and try again
但我不知道它为什么退出。如何查看容器的 stderr 输出?
这是我的日志事件的输出
{
"requestTime":"23/Jul/2021:14:31:45 +0000","requestId":"...","apiId":"...","resourcePath":"$default","path":"/ballot","httpMethod":"GET","stage":"$default","status":"500","integrationStatus":"200","integrationLatency":"25","responseLatency":"27","responseLength":"35","errorMessage":"Internal Server Error","format":"SLS_HTTP_API_LOG","version":"1.0.0","integrationErrorMessage":"The Lambda function returned the following error":"RequestId":"4199ecbe-8ef2-4c5c-8d4b-37f29742662d Error":"Runtime exited with error":exit status 1. Check your Lambda function code and try again.,"responseType":"INTEGRATION_FAILURE"
}
解决方法
有两个日志流。一个用于 http-api 并包含上述消息。另一个用于 lambda 并具有输出。就我而言,他们被命名为
/aws/http-api/finalfive-dev Never expire - - 1 subscription
/aws/lambda/FinalFive Never expire -
第二个包含我正在寻找的信息。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。