Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 1.78 KB

502-error-when-scaling.mdx

File metadata and controls

49 lines (37 loc) · 1.78 KB
meta content tags dates categories
title description
Error code 502
Troubleshoot 502 issues while sending requests to Serverless Containers.
h1 paragraph
Error code 502
Troubleshoot 502 issues while sending requests to Serverless Containers.
serverless Containers troubleshooting issue error 502
validation posted
2025-01-03
2025-01-03
serverless

Problem

502 errors can sometimes occur on Serverless Containers during the autoscaling process when new container instances are being created.

Cause

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 solutions

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 can be configured via the API; in this case, it's recommended to implement a custom HTTP route on the Container that returns its readiness status.

A simple health check to implement is just a simple `GET` on `/` to make sure the HTTP server is properly listening.

Example (incomplete) settings:

health_check: {
  http: {
      path: "/"
  }
  }
The custom health check feature will be available in the Scaleway console in Q1 2025.