Lambda: Invocation, Function and Runtime Errors

Types of possible errors in an AWS Lambda function and how to handle them

Dashbird is a monitoring platform for monitoring modern cloud infrastructure by providing alerts, insights and data visualisation.

Start a Free Trial Learn more

Invocation Errors

An AWS Lambda invocation can raise errors for a variety of reasons1. A few examples are listed below. Invocation errors will make Lambda return a 400-series or 500-series HTTP status code.

For a complete list of invocation errors, please refer to the AWS documentation2.

Event Payload

  • Larger than the Lambda limit3
  • Contains a parameter with invalid type


  • Trying to invoke an inexistent function
  • Client doesn’t have permissions to invoke the required function

AWS Account

  • Account services are suspended
  • Reached the limit of concurrent Lambda microVMs running

Function Errors

AWS Lambda Function errors happen when, for example:

  • Developer’s code raises an exception
  • There is a syntax error in the code preventing the execution
  • The execution reaches the timeout limit

AWS Lambda will automatically add the X-Amz-Function-Error header and a JSON as the response with details about the function error. Because of that, it is a good practice to avoid the code from raising exceptions, since it will expose internal implementation details. This could potentially compromise the application security.

To avoid this issue, developers should catch all exceptions in the function_handler, log them and return a sanitized and gentle response to the requester.

Runtime Errors

AWS provides guidance on handling function exceptions for all runtimes supported by Lambda. Below is list with reference pages for each runtime:


  1. Error Handling and Automatic Retries in AWS Lambda ↩︎

  2. Lambda API Invoke Errors ↩︎

  3. Lambda accepts event payloads with up to 6 MB in synchronous invocations and 256 KB for asynchronous mode ↩︎

Operate Cloud Applications at Highest Quality

Save time spent on debugging applications.

Increase development velocity and quality.

Get actionable insights to your infrastructure.

Finish setup in 2 minutes!