- Newest
- Most votes
- Most comments
Do you see a timeout error in the Lambda log?
Could it be that you are using versions and aliases? If so, you probably changed the timeout on the latest version, but you are still invoking an older version.
Hello.
What kind of processing does Lambda do?
For example, instead of Lambda timing out, is it possible that an API request running on Lambda is timing out?
1. Verify Deployment
Ensure that your Lambda function's new configuration (timeout) has been successfully deployed. After modifying the settings in the UI, you should confirm that the changes were saved and that there were no errors during the deployment process.
Try redeploying the function by making a small, non-impactful change and redeploying again.
2. Check for Other Timeouts
There may be additional layers (such as API Gateway or load balancer timeouts) impacting the function's execution. These could override or interfere with the Lambda timeout setting.
API Gateway Timeout: The maximum timeout for API Gateway is 29 seconds, but if it is set lower, it could cause your function to terminate early. ALB Timeout: If you're using an ALB, check the idle timeout settings.
3. Check Lambda Execution Logs (CloudWatch)
Inspect the function's logs in Amazon CloudWatch to see if any errors or timeout issues are being logged. The logs might reveal that the function is still hitting a timeout due to an unrelated issue (such as exceeding memory or processing capacity).
4. Test Locally via AWS CLI
Use the following CLI command to invoke the function with a payload and see if the timeout issue persists:
aws lambda invoke --function-name my-function --payload '{"key": "value"}' output.json
5. Verify CI/CD Configuration
If you are using a CI/CD pipeline to manage the Lambda function, ensure that the updated configuration (timeout change) has been pushed and applied through the pipeline.
Sometimes, CI/CD tools may override the configuration if the changes were only made through the console.
Relevant content
- Accepted Answer
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
Yep, we are using versions and alias. I pushed the code 2 days ago and saw that there was a request that had > 3seconds. So I think the timeout of 5 seconds is working. Just saw your reply and I think your answer is correct. Thanks