alexa-skills-kit-sdk-for-nodejs: First request lambda timeout, all next request timeout forever too
All my handler working fine after one request handler timeout then all next request timeout too. This is my log.
09:03:33
START RequestId: 91f3b0c1-1dcc-11e7-b0f1-85e057390cac Version: $LATEST
09:03:33
info: {"version":"1.0","session":{"new":true,"sessionId":"SessionId.b2d4fee6-c0f8-4c87-837b-0d4af004b7ae","application":{"applicationId":"amzn1.ask.skill.00a11412-2750-40a1-b522-571464b1bee2"},"attributes":{},"user":{"userId":"amzn1.ask.account.AGUEHIIGUAFBVDO37MD7KIXEECNN2E3LITFRR2OBMFPAA2PZDRHMBWID2JCFUHK2NQU2Q3DB2FFNJFW533A3ST463UZQS7GDY3B2UVVSRQCEVAPQAX44ODBZC657ZVXY3PTUDJCDU6DYWVOAPTKHYUGQING
09:03:34
2017-04-10T09:03:34.075Z 91f3b0c1-1dcc-11e7-b0f1-85e057390cac Warning: Application ID is not set
09:03:36
END RequestId: 91f3b0c1-1dcc-11e7-b0f1-85e057390cac
09:03:36
REPORT RequestId: 91f3b0c1-1dcc-11e7-b0f1-85e057390cac Duration: 3001.35 ms Billed Duration: 3000 ms Memory Size: 128 MB Max Memory Used: 36 MB
09:03:36
2017-04-10T09:03:36.951Z 91f3b0c1-1dcc-11e7-b0f1-85e057390cac Task timed out after 3.00 seconds
09:04:50
START RequestId: c0aac43e-1dcc-11e7-9e0b-75610f65f94e Version: $LATEST
09:04:53
END RequestId: c0aac43e-1dcc-11e7-9e0b-75610f65f94e
09:04:53
REPORT RequestId: c0aac43e-1dcc-11e7-9e0b-75610f65f94e Duration: 3000.73 ms Billed Duration: 3000 ms Memory Size: 128 MB Max Memory Used: 15 MB
09:04:53
2017-04-10T09:04:53.127Z c0aac43e-1dcc-11e7-9e0b-75610f65f94e Task timed out after 3.00 seconds
09:04:58
START RequestId: c5dcdfac-1dcc-11e7-87a6-e55860640538 Version: $LATEST
09:05:01
END RequestId: c5dcdfac-1dcc-11e7-87a6-e55860640538
09:05:01
REPORT RequestId: c5dcdfac-1dcc-11e7-87a6-e55860640538 Duration: 3001.96 ms Billed Duration: 3000 ms Memory Size: 128 MB Max Memory Used: 16 MB
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15
@nguyenthenguyen Lambda times out after 3 seconds, you can avoid this timeout by increasing the lambda function timeout (Configuration tab of the lambda function -> Advanced setting -> Timeout). This way your handle will complete execution. All your handlers will fail to complete execution if it takes more than 3 secs. Closing this issue, feel free to re-open if you need help.
Here’s Lambda FAQ: Q: How long can an AWS Lambda function execute?
All calls made to AWS Lambda must complete execution within 300 seconds. The default timeout is 3 seconds, but you can set the timeout to any value between 1 and 300 seconds.
@KrishFuriaAmazon Should we reopen this issues ?
I think your timeout in Lambda is still set to 3 seconds, which is the default. Because your
setTimeout
takes 4 seconds it will be terminated by lambda after 3 seconds. You can also see this in your logs.You should change your timeout in Lambda, then it should work (AWS Console -> Lambda -> Functions -> “your alexa skill function” -> Configuration -> Advanced Settings -> Timeout). Code looks fine.