NavigationContentFooter
Jump toSuggest an edit

Error code 502

Reviewed on 03 January 2025Published on 03 January 2025

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.

You can configure Custom health checks via the Scaleway API with the health_check parameter. In this case, we recommend you implement a custom HTTP route on the Container that returns its readiness status.

Tip

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: "/"
}
}
Note

Custom healthcheck feature will be available in the Scaleway console for Q1 2025.

Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2025 – Scaleway