Error code 502
ProblemLink to this anchor
502 errors can sometimes occur on Serverless Containers during the autoscaling process when new container instances are being created.
CauseLink to this anchor
When a new instance is created, the Serverless health check verification is performed by default on the HTTP port. Once the port is opened, the resource is considered ready, and traffic starts being forwarded to it.
This issue typically occurs when traffic is sent too early to the newly created container before it is fully deployed.
Possible solutionsLink to this anchor
To ensure the Serverless Container is completely ready, both in terms of the HTTP port and the software scope, it is recommended to use custom health checks.
Custom health checks allow you to define a specific endpoint that the Serverless Container must respond to before it is considered ready to receive traffic. This ensures that the container is fully initialized and ready to handle requests.
Update your Serverless Container to use custom health checks by following the instructions in the Serverless Containers documentation.