Skip to content

Commit e924ec4

Browse files
docs(srv): add troubleshooting on testing private resources MTA-5424 (#4211)
* docs(srv): add troubleshooting on testing private resources MTA-5424 * docs(srv): update * docs(srv): update * docs(srv): update * docs(srv): update * docs(srv): update
1 parent b5c92f0 commit e924ec4

File tree

5 files changed

+130
-0
lines changed

5 files changed

+130
-0
lines changed

menu/navigation.json

+12
Original file line numberDiff line numberDiff line change
@@ -3781,6 +3781,10 @@
37813781
{
37823782
"label": "My function fails after too many retries",
37833783
"slug": "too-many-retries"
3784+
},
3785+
{
3786+
"label": "Tests fail on functions",
3787+
"slug": "tests-fail-on-function"
37843788
}
37853789
],
37863790
"label": "Troubleshooting",
@@ -3838,6 +3842,10 @@
38383842
"label": "Secure a container",
38393843
"slug": "secure-a-container"
38403844
},
3845+
{
3846+
"label": "Test a container",
3847+
"slug": "test-a-container"
3848+
},
38413849
{
38423850
"label": "Monitor container logs and metrics",
38433851
"slug": "monitor-container"
@@ -3939,6 +3947,10 @@
39393947
{
39403948
"label": "My container stopped working after a redeploy",
39413949
"slug": "container-stopped-after-redeploy"
3950+
},
3951+
{
3952+
"label": "Tests fail on containers",
3953+
"slug": "tests-fail-on-container"
39423954
}
39433955
],
39443956
"label": "Troubleshooting",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
meta:
3+
title: How to test a container
4+
description: Instructions for testing your Serverless Containers on Scaleway.
5+
content:
6+
h1: How to test a container
7+
paragraph: Instructions for testing your Serverless Containers on Scaleway.
8+
tags: container serverless test-container
9+
dates:
10+
validation: 2025-01-14
11+
posted: 2025-01-15
12+
categories:
13+
- serverless
14+
---
15+
16+
This page shows you how to execute Serverless Containers from the [Scaleway console](https://console.scaleway.com). The **Test** feature of a container allows you to run your code using a selection of methods to make sure it behaves as expected.
17+
18+
<Message type="note">
19+
Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations. Refer to the [dedicated documentation](/serverless/functions/how-to/create-auth-token-from-console/) for more information on how to secure and test a private function.
20+
</Message>
21+
22+
<Macro id="requirements" />
23+
24+
- A Scaleway account logged into the [console](https://console.scaleway.com)
25+
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
26+
- [Created a container](/serverless/containers/how-to/deploy-container/)
27+
28+
1. Click **Containers** in the **Serverless** section of the side menu. The containers page displays.
29+
30+
2. Click the relevant containers namespace. A list of your containers displays.
31+
32+
3. Click the name of the container you want to test.
33+
34+
4. Open the **Test** tab.
35+
36+
5. Select the **method** you want to use from the drop-down menu.
37+
38+
6. Enter the **path** to your container. Leave the default `/` value if the host of your container is not located in a specific folder.
39+
40+
7. Click **+ Advanced options** to add any required HTTP header or parameter to your container.
41+
42+
8. Click **Run**.
43+
44+
The **Output** section displays the response from your container and the status code.
45+
46+
<Message type="note">
47+
If you encounter a message error while testing your container, refer to the [dedicated troubleshooting](/serverless/containers/troubleshooting/tests-fail-on-container/) for more information.
48+
</Message>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
meta:
3+
title: Tests fail on Serverless Containers
4+
description: I get error messages when testing Serverless Containers using the Scaleway Console
5+
content:
6+
h1: Tests fail on Serverless Containers
7+
paragraph: I get error messages when testing Serverless Containers using the Scaleway Console
8+
tags: serverless containers private troubleshooting issue error test authentication token unable
9+
dates:
10+
validation: 2025-01-14
11+
posted: 2025-01-14
12+
categories:
13+
- serverless
14+
---
15+
16+
## Problem
17+
18+
I get error messages when testing Serverless Containers using the Scaleway Console.
19+
20+
### Cause
21+
22+
Testing **Private** Serverless Containers is not possible using the Scaleway console due to CORS limitations.
23+
24+
### Possible solutions
25+
26+
- Change the visibility of your function to **public**. Public containers can be executed anonymously.
27+
28+
- Make sure you have created an [authentication token](/serverless/containers/how-to/create-auth-token-from-console/) for your private function, then exexute a `curl` request from a terminal, as shown below:
29+
```sh
30+
curl -H "X-Auth-Token: <YOUR_AUTH_TOKEN>" \ <YOUR_CONTAINER_ENDPOINT>
31+
```

serverless/functions/how-to/test-a-function.mdx

+8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ categories:
1515

1616
This page shows you how to execute Serverless Functions from the [Scaleway console](https://console.scaleway.com). The **Test** feature of a function allows you to run your code using a selection of methods to make sure it behaves as expected.
1717

18+
<Message type="note">
19+
Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations. Refer to the [dedicated documentation](/serverless/functions/how-to/create-auth-token-from-console/) for more information on how to secure and test a private function.
20+
</Message>
21+
1822
<Macro id="requirements" />
1923

2024
- A Scaleway account logged into the [console](https://console.scaleway.com)
@@ -38,3 +42,7 @@ This page shows you how to execute Serverless Functions from the [Scaleway conso
3842
8. Click **Run**.
3943

4044
The **Output** section displays the response from your function and the status code.
45+
46+
<Message type="note">
47+
If you encounter a message error while testing your function, refer to the [dedicated troubleshooting](/serverless/functions/troubleshooting/tests-fail-on-function/) for more information.
48+
</Message>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
meta:
3+
title: Tests fail on Serverless Functions
4+
description: I get error messages when testing Serverless Functions using the Scaleway Console
5+
content:
6+
h1: Tests fail on Serverless Functions
7+
paragraph: I get error messages when testing Serverless Functions using the Scaleway Console
8+
tags: serverless functions private troubleshooting issue error test authentication token unable
9+
dates:
10+
validation: 2025-01-14
11+
posted: 2025-01-14
12+
categories:
13+
- serverless
14+
---
15+
16+
## Problem
17+
18+
I get error messages when testing Serverless Functions using the Scaleway Console.
19+
20+
### Cause
21+
22+
Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations.
23+
24+
### Possible solutions
25+
26+
- Change the visibility of your function to **public**. Public functions can be executed anonymously.
27+
28+
- Make sure you have created an [authentication token](/serverless/functions/how-to/create-auth-token-from-console/) for your private function, then exexute a `curl` request from a terminal, as shown below:
29+
```sh
30+
curl -H "X-Auth-Token: <YOUR_AUTH_TOKEN>" \ <YOUR_FUNCTION_ENDPOINT>
31+
```

0 commit comments

Comments
 (0)