Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The most common reason for a 502 error code when using Promise.all() in AWS Lambda is that the function is timing out. By default, AWS Lambda has a timeout of 3 seconds for functions using the Node.js runtime environment. If the function takes longer than 3 seconds to complete, it will result in a 502 error code.

To resolve this issue, you can increase the timeout limit of the AWS Lambda function to allow for enough time to complete the Promise.all() operation. You can do this in the AWS Lambda console or by updating the function configuration using the AWS CLI. Another option is to optimize the Promise.all() operation to reduce the overall processing time of the function.