-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(serverless): 502 errors (#4170)
* feat(serverless): 502 errors * Apply suggestions from code review Co-authored-by: Benedikt Rollik <[email protected]> * fix(docs): doc review * fix(docs): doc review * fix(docs): doc review * fix(docs): doc review --------- Co-authored-by: Benedikt Rollik <[email protected]> Co-authored-by: SamyOubouaziz <[email protected]>
- Loading branch information
1 parent
c3dde8d
commit 0955b64
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
serverless/containers/troubleshooting/502-error-when-scaling.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
meta: | ||
title: Error code 502 | ||
description: Troubleshoot 502 error codes while sending requests to Serverless Containers. | ||
content: | ||
h1: Error code 502 | ||
paragraph: Troubleshoot 502 error codes while sending requests to Serverless Containers. | ||
tags: serverless Containers troubleshooting issue error 502 | ||
dates: | ||
validation: 2025-01-03 | ||
posted: 2025-01-03 | ||
categories: | ||
- 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**. | ||
|
||
You can configure [Custom health checks via the Scaleway API](https://www.scaleway.com/en/developers/api/serverless-containers/#path-containers-update-an-existing-container) with the `health_check` parameter. In this case, we recommend you implement a custom HTTP route on the Container that returns its readiness status. | ||
|
||
<Message type="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: "/" | ||
} | ||
} | ||
``` | ||
</Message> | ||
|
||
<Message type="note"> | ||
Custom healthcheck feature will be available in the Scaleway console for Q1 2025. | ||
</Message> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters