JumpCloud无服务器Lambda函数超时错误

0

【以下的问题经过翻译处理】 我在运行一个无服务器应用的Lambda函数时遇到了问题。我使用这个应用程序从远程节点下载文件并将其存储到S3存储桶中。之前一切都运行正常,突然间停止获取文件源位置。在调试问题时,我观察到完成一个测试事件需要很长时间。在CloudWatch日志中,我看到了以下错误日志。

***START RequestId: 052226a9-5344-45f1-88bf-5c00242baee0 Version: $LATEST END RequestId: 052226a9-5344-45f1-88bf-5c00242baee0

REPORT RequestId: 052226a9-5344-45f1-88bf-5c00242baee0 Duration: 180625.18 ms Billed Duration: 180000 ms Memory Size: 192 MB Max Memory Used: 193 MB Init Duration: 587.37 ms

XRAY TraceId: 1-626104fb-16ae94a33273f6404d180e41 SegmentId: 1010be2c3227cfab Sampled: true

REPORT RequestId: 052226a9-5344-45f1-88bf-5c00242baee0 Duration: 180625.18 ms Billed Duration: 180000 ms Memory Size: 192 MB Max Memory Used: 193 MB Init Duration: 587.37 ms XRAY TraceId: 1-626104fb-16ae94a33273f6404d180e41 SegmentId: 1010be2c3227cfab Sampled: true

2022-04-21T07:20:17.417Z 052226a9-5344-45f1-88bf-5c00242baee0 Task timed out after 180.63 seconds***

我已尝试增加内存和超时参数,但仍出现同样的错误。在 X-Ray 跟踪日志中得到了以下响应。

serverlessrepo-JumpCloud--DirectoryInsightsFunctio-fgqp218AtLpYAWS::Lambda serverlessrepo-JumpCloud--DirectoryInsightsFunctio-fgqp218AtLpY OK 202 17ms Dwell Time OK

47ms Attempt #1 Error (4xx) 200 3.03min Attempt #2 Error (4xx) 200 3.00min Attempt #3 Error (4xx) 200 3.00min
serverlessrepo-JumpCloud--DirectoryInsightsFunctio-fgqp218AtLpYAWS::Lambda::Function serverlessrepo-JumpCloud--DirectoryInsightsFunctio-fgqp218AtLpY Error (4xx)
3.01min Initialization OK
587ms Invocation Error (4xx)
3.01min serverlessrepo-JumpCloud--DirectoryInsightsFunctio-fgqp218AtLpY Error (4xx)
3.00min Initialization OK
611ms Invocation Error (4xx)
3.00min serverlessrepo-JumpCloud--DirectoryInsightsFunctio-fgqp218AtLpY Error (4xx)
3.00min Initialization OK
549ms Invocation Error (4xx)

3.00min

有人可以建议我是否遗漏了任何调试步骤吗?

profile picture
专家
已提问 5 个月前12 查看次数
1 回答
0

【以下的回答经过翻译处理】 如果某个任务突然需要三分钟才能完成(之前不需要),而且涉及到"remote node",我会怀疑是网络方面的问题。可能是DNS、可达性、远程端点的防火墙等等。我会在代码的每个步骤中添加带有时间戳的调试语句,弄清楚发生了什么。这是一种强制的方法,不太优雅,但却非常有效解决问题。

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则