AWSLambda: Status Code: 500 insufficient capacity and got 504 status code

0

Hi Team, AWS Lambda getting response :

Failure Reason : "We currently do not have sufficient capacity in the region you requested. Our system will be working on provisioning additional capacity. You can avoid getting this error by temporarily reducing your request rate. (Service: AWSLambda; Status Code: 500; Error Code: ServiceException; Request ID: 82a3db4e-ba43-42cb-a8d0-985a7fb0fca7; Proxy: null)"

and

null (Service: AWSLambda; Status Code: 504; Error Code: null; Request ID: null; Proxy: null)

can you please help us to understand why we received 504 and whats the reason the same, also let us know how to avoid this issue in future

Regards, Prasanna lekprasa@amazon.com

asked 10 months ago678 views
3 Answers
0

I think this message is a message that could not be started due to insufficient capacity of physical resources (AWS side) in the region used by Lambda.
Similar messages often appear on EC2, so perhaps it is a lack of resources on the AWS side.

If it is a temporary resource shortage, it will be resolved by re-running the program after the resource shortage is cleared.
Or use a different region, etc.

profile picture
EXPERT
answered 10 months ago
0

Please check Service Health dashboard to verify the status of Lambda service in that region. To avoid similar issues you can consider one of these methods (depending on the use case):

  • Redesigning the architecture to use Lambda in multiple regions and not a single one (Multi-region approach)
  • Based on the use case and how the Lambda functions are called, you can devise a queue system such as SQS before executing Lambda to ensure that even if one execution fails, the message/event is not lost
  • If the execution cannot wait and you need to ensure correct execution at all times, you can consider using Lambda Provisioned Concurrency (extra cost) that allocates guaranteed execution environments
  • Revisiting how you are calling each Lambda function, looking at the possibility of reducing the call rate by grouping messages/events together and doing a batch processing.
AWS
answered 10 months ago
0

Similarly, EC2 can experience the same issue: https://repost.aws/knowledge-center/ec2-insufficient-capacity-errors.

Typically you need to wait or switch region.

profile picture
EXPERT
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions