How do I troubleshoot Lambda function provisioned concurrency issues?

3 minute read
0

I configured provisioned concurrency for my AWS Lambda function but it failed to deploy with an "FUNCTION_ERROR_INIT_FAILURE" error.

Short description

The following reasons are possible causes for failure after you set up provisioned concurrency for your Lambda function:

  • You might have invoked the Lambda function with the $LATEST version of Lambda instead of the version with configured provisioned concurrency.
  • All provisioned concurrency is in use, so your Lambda function is invoked with standard concurrency. This causes cold starts.
  • Your account has exceeded its burst limit.
  • There are missing or mismatched environment variables or issues with the Lambda function code.
  • The Lambda service is unable to access or invoke the function code. For example, permissions settings might have been changed so that Lambda can no longer access your function code in Amazon Elastic Container Registry (Amazon ECR).

Resolution

Follow these steps to troubleshoot issues with provisioned concurrency:

  1. Verify that the Lambda function that you use to configure provisioned concurrency isn't set to $LATEST. Unpublished versions of Lambda functions don't support provisioned concurrency. For more information, see Lambda function versions and Configuring provisioned concurrency.
  2. In your Lambda function configuration, verify that your provisioned concurrency displays the Ready status.
  3. Use Amazon CloudWatch to review all logs that your function's code generates to identify potential issues. For more information, see Using CloudWatch Logs logs with Lambda.
  4. On the Metrics page of the CloudWatch console, check the ProvisionedConcurrencySpilloverInvocations metric. This metric shows the number of times your Lambda function runs with standard concurrency when all provisioned concurrency is used.
  5. Deploy the function without configuring provisioned concurrency. Then, test the Lambda function.
  6. Check if reserved concurrency is configured for the Lambda function. Reserved concurrency limits a functions ability to scale up.

If the preceding troubleshooting steps don't resolve your issue, then contact AWS Support. Include the following information in your support case:

  • The Lambda function ARN.
  • The workflow on the Lambda function setup with all included services.
  • Details about whether the issue is intermittent or continuous.
  • Complete CloudWatch logs in .txt format from when the issue occurred. These CloudWatch logs are used to identify Lambda function errors that include timeout issues, init durations, and permissions issues.
  • The exact timestamp of the issue with the time zone or timestamp in UTC.

Note: AWS Support representatives don't have access to customer CloudWatch logs due to security and privacy reasons.

For more troubleshooting information, see Lambda: cold starts with new versions.

Note: Unlike reserved concurrency, you incur additional costs when you use provisioned concurrency. See AWS Lambda pricing for details about provisioned concurrency costs. To keep provisioned concurrency costs low, it's a best practice to schedule provisioned concurrency usage for your organization. For more information, see Scheduling AWS Lambda provisioned concurrency for recurring peak usage.

Related information

Troubleshoot invocation issues in Lambda

AWS OFFICIAL
AWS OFFICIALUpdated 4 months ago