aws timeout_error ai_generated partial

Task timed out after X.XX seconds (Lambda timeout)

ID: aws/lambda-timeout

Also available as: JSON · Markdown
82%Fix Rate
85%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

Lambda function exceeded its timeout. Default is 3 seconds, max 15 minutes.

generic

Workarounds

  1. 90% success Increase timeout in function config to match expected execution time
    aws lambda update-function-configuration --function-name X --timeout 30

    Sources: https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-timeout

  2. 88% success Check what's slow: cold start, DB connections, external API calls
    Enable AWS X-Ray tracing to identify the slow segment: aws lambda update-function-configuration --function-name X --tracing-config Mode=Active. Check CloudWatch Logs for duration breakdown.

    Sources: https://docs.aws.amazon.com/lambda/latest/dg/lambda-troubleshooting.html

  3. 80% success Use provisioned concurrency to eliminate cold start delays
    aws lambda put-provisioned-concurrency-config --function-name X --qualifier prod --provisioned-concurrent-executions 5

    Sources: https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html

Dead Ends

Common approaches that don't work:

  1. Set timeout to 15 minutes for everything 60% fail

    Long timeouts waste money and may indicate a performance issue

Error Chain

Frequently confused with: