Lambda 'Task timed out after 3.00 seconds' Error
Quick answer
The default Lambda timeout is 3 seconds. Raise the timeout, add memory (more CPU) and cut slow initialization or network waits.
Most likely fix: Increase the timeout
How to fix it
Try these in order — the most common fix is first.
1. Increase the timeout
- Lambda > function > Configuration > General configuration > Edit > Timeout
- Maximum is 15 minutes
Did this fix it?2. Increase memory
- Same screen: raise Memory; CPU scales with it
Did this fix it?3. Optimize initialization
- Move heavy imports and client creation outside the handler
- Reduce package size
Did this fix it?4. Check network path
- VPC functions need a NAT gateway (or VPC endpoints) to reach the internet or AWS APIs
- Check security groups and timeouts to the database
Did this fix it?5. Use CloudWatch logs to find the slow step
- Add timing logs; compare Init Duration and Duration in the REPORT line
Did this fix it?
Symptoms
Logs show 'Task timed out after 3.00 seconds' and the invocation fails.
Why it happens
- Timeout left at the default 3 seconds
- Slow init code or large dependencies
- Too little memory/CPU
- Function in a VPC with no route to the internet (NAT) calling external services
- Slow downstream database or API
- Unsettled promises in async handlers
This guide also covers
- lambda task timed out after 3.00 seconds
- aws lambda timeout
- lambda function timeout error
- lambda sandbox timedout
Still not working?
If AWS keeps failing, you're not alone. See every AWS problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other AWS errors
- AWS Unexpected Charges: Why Is My AWS Bill So High?
- AWS Charges After Free Tier: Why Am I Being Billed?
- AWS Account Suspended: How to Reactivate It
- EC2 SSH Connection Timed Out
- EC2 SSH 'Permission denied (publickey)' and Key File Errors
- S3 Access Denied (403 Forbidden) Error
- AWS 'Not Authorized to Perform' IAM Error
- CloudFront 403 Error: The Request Could Not Be Satisfied