Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Lambda Task timed out after 3.00 seconds

I created a simple Node.js script to connect to a RDS instance but sadly it always returns with timeout error. It is strange because it works perfectly from my machine.

The instance is public accessible and context.callbackWaitsForEmptyEventLoop = false;

have you got any idea?

like image 651
Frank Avatar asked Feb 28 '18 11:02

Frank


People also ask

How do I fix the Lambda timeout?

To troubleshoot the retry and timeout issues, first review the logs of the API call to find the problem. Then, change the retry count and timeout settings of the AWS SDK as needed for each use case. To allow enough time for a response to the API call, add time to the Lambda function timeout setting.

How do I increase Lambda timeout limit?

You cannot increase the runtime to more than 15 minutes. The AWS Lambda limit page states the Function timeout is 900 seconds (15 minutes) . If you need more than 15 minutes of execution time you have to look at other services. You could have a look if AWS Batch would suit your needs.

How long can an AWS Lambda function execute in seconds?

AWS Lambda functions can be configured to run up to 15 minutes per execution. You can set the timeout to any value between 1 second and 15 minutes.


2 Answers

Lambda has a property of time out. Have you checked this configuration in the Lambda via console (Basic configuration) or in your deployment template file?

like image 142
govako Avatar answered Sep 19 '22 15:09

govako


i have same error i fix with incress the timeout time

new aws UI

lambda function -> configuration -> General configuration -> Edit Timeout

enter image description here

like image 26
Justin J Avatar answered Sep 22 '22 15:09

Justin J