From b4d365417e36ffc7ed240a3c10aa7eac0a4d18da Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Tue, 14 Jan 2025 11:49:41 +0100 Subject: [PATCH 1/6] docs(srv): add troubleshooting on testing private resources MTA-5424 --- .../tests-fail-on-private-function.mdx | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 serverless/functions/troubleshooting/tests-fail-on-private-function.mdx diff --git a/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx b/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx new file mode 100644 index 0000000000..3e2da25dd8 --- /dev/null +++ b/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx @@ -0,0 +1,30 @@ +--- +meta: + title: Tests fail on private Serverless Functions + description: I get error messages when testing private Serverless Functions using the Scaleway Console +content: + h1: Tests fail on private Serverless Functions + paragraph: I get error messages when testing private Serverless Functions using the Scaleway Console +tags: serverless functions private troubleshooting issue error test authentication token unable +dates: + validation: 2025-01-14 + posted: 2024-01-14 +categories: + - serverless +--- + +## Problem + +I get error messages when testing private Serverless Functions using the Scaleway Console. + +### Cause + +This issue can happen for the following reasons: + +- You have created too many Serverless Functions namespaces and reached [your account's quota](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#serverless-functions). + +- You have created too many Registry namespaces and reached [your account's quota](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#container-registry). + +### Possible solutions + +Make sure that you have not exceeded the maximum number of allowed namespaces with the [Scaleway console](https://console.scaleway.com/) or with the [API](https://www.scaleway.com/en/developers/api/serverless-functions/#path-namespaces-list-all-your-namespaces). \ No newline at end of file From 8e6f4be79cdccc524d9722724626ec5d27ded3bd Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Tue, 14 Jan 2025 14:52:10 +0100 Subject: [PATCH 2/6] docs(srv): update --- .../troubleshooting/tests-fail-on-private-function.mdx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx b/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx index 3e2da25dd8..43b262df6b 100644 --- a/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx +++ b/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx @@ -8,7 +8,7 @@ content: tags: serverless functions private troubleshooting issue error test authentication token unable dates: validation: 2025-01-14 - posted: 2024-01-14 + posted: 2025-01-14 categories: - serverless --- @@ -19,12 +19,8 @@ I get error messages when testing private Serverless Functions using the Scalewa ### Cause -This issue can happen for the following reasons: - -- You have created too many Serverless Functions namespaces and reached [your account's quota](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#serverless-functions). - -- You have created too many Registry namespaces and reached [your account's quota](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#container-registry). +[Private](/serverless/functions/concepts/#privacy-policy) functions require a `X-Auth-Token` HTTP header when being run or tested. ### Possible solutions -Make sure that you have not exceeded the maximum number of allowed namespaces with the [Scaleway console](https://console.scaleway.com/) or with the [API](https://www.scaleway.com/en/developers/api/serverless-functions/#path-namespaces-list-all-your-namespaces). \ No newline at end of file +Make sure that you have [created an authentication token](/serverless/functions/how-to/create-auth-token-from-console/) from the Scaleway console, and passed it as a HTTP header while [testing your function](/serverless/functions/how-to/test-a-function). \ No newline at end of file From d33488984bcd9011b7d2f1523dd0351325da22f1 Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Tue, 14 Jan 2025 15:41:41 +0100 Subject: [PATCH 3/6] docs(srv): update --- menu/navigation.json | 12 ++++++ .../containers/how-to/test-a-container.mdx | 40 +++++++++++++++++++ .../tests-fail-on private-container.mdx | 26 ++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 serverless/containers/how-to/test-a-container.mdx create mode 100644 serverless/containers/troubleshooting/tests-fail-on private-container.mdx diff --git a/menu/navigation.json b/menu/navigation.json index e845642fe4..ab4683aa9b 100644 --- a/menu/navigation.json +++ b/menu/navigation.json @@ -3781,6 +3781,10 @@ { "label": "My function fails after too many retries", "slug": "too-many-retries" + }, + { + "label": "Tests fail on private functions", + "slug": "tests-fail-on-private-function" } ], "label": "Troubleshooting", @@ -3838,6 +3842,10 @@ "label": "Secure a container", "slug": "secure-a-container" }, + { + "label": "Test a container", + "slug": "test-a-container" + }, { "label": "Monitor container logs and metrics", "slug": "monitor-container" @@ -3939,6 +3947,10 @@ { "label": "My container stopped working after a redeploy", "slug": "container-stopped-after-redeploy" + }, + { + "label": "Tests fail on private containers", + "slug": "tests-fail-on-ùprivate-container" } ], "label": "Troubleshooting", diff --git a/serverless/containers/how-to/test-a-container.mdx b/serverless/containers/how-to/test-a-container.mdx new file mode 100644 index 0000000000..5fdd8dad1e --- /dev/null +++ b/serverless/containers/how-to/test-a-container.mdx @@ -0,0 +1,40 @@ +--- +meta: + title: How to test a container + description: Instructions for testing your Serverless Containers on Scaleway. +content: + h1: How to test a container + paragraph: Instructions for testing your Serverless Containers on Scaleway. +tags: container serverless test-container +dates: + validation: 2025-01-14 + posted: 2025-01-15 +categories: + - serverless +--- + +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. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [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 +- [Created a container](/serverless/containers/how-to/deploy-container/) + +1. Click **Containers** in the **Serverless** section of the side menu. The containers page displays. + +2. Click the relevant containers namespace. A list of your containers displays. + +3. Click the name of the container you want to test. + +4. Open the **Test** tab. + +5. Select the **method** you want to use from the drop-down menu. + +6. Enter the **path** to your container. Leave the default `/` value if the host of your container is not located in a specific folder. + +7. Click **+ Advanced options** to add any required HTTP header or parameter to your container. + +8. Click **Run**. + +The **Output** section displays the response from your container and the status code. diff --git a/serverless/containers/troubleshooting/tests-fail-on private-container.mdx b/serverless/containers/troubleshooting/tests-fail-on private-container.mdx new file mode 100644 index 0000000000..e1accacc45 --- /dev/null +++ b/serverless/containers/troubleshooting/tests-fail-on private-container.mdx @@ -0,0 +1,26 @@ +--- +meta: + title: Tests fail on private Serverless Containers + description: I get error messages when testing private Serverless Containers using the Scaleway Console +content: + h1: Tests fail on private Serverless Containers + paragraph: I get error messages when testing private Serverless Containers using the Scaleway Console +tags: serverless containers private troubleshooting issue error test authentication token unable +dates: + validation: 2025-01-14 + posted: 2025-01-14 +categories: + - serverless +--- + +## Problem + +I get error messages when testing private Serverless Containers using the Scaleway Console. + +### Cause + +[Private](/serverless/containers/concepts/#privacy-policy) containers require a `X-Auth-Token` HTTP header when being run or tested. + +### Possible solutions + +Make sure that you have [created an authentication token](/serverless/containers/how-to/create-auth-token-from-console/) from the Scaleway console, and passed it as a HTTP header while [testing your container](/serverless/containers/how-to/test-a-container). \ No newline at end of file From 0d3aa1a32b2c872985d368142ec476d6df95fe37 Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Tue, 14 Jan 2025 15:44:36 +0100 Subject: [PATCH 4/6] docs(srv): update --- serverless/containers/how-to/test-a-container.mdx | 4 ++++ serverless/functions/how-to/test-a-function.mdx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/serverless/containers/how-to/test-a-container.mdx b/serverless/containers/how-to/test-a-container.mdx index 5fdd8dad1e..4d63a5915a 100644 --- a/serverless/containers/how-to/test-a-container.mdx +++ b/serverless/containers/how-to/test-a-container.mdx @@ -38,3 +38,7 @@ This page shows you how to execute Serverless Containers from the [Scaleway cons 8. Click **Run**. The **Output** section displays the response from your container and the status code. + + +If you encounter a message error while testing your container, refer to the [dedicated troubleshooting](/serverless/containers/troubleshooting/tests-fail-on-private-container/) for more information. + \ No newline at end of file diff --git a/serverless/functions/how-to/test-a-function.mdx b/serverless/functions/how-to/test-a-function.mdx index be4f554437..87f66283ce 100644 --- a/serverless/functions/how-to/test-a-function.mdx +++ b/serverless/functions/how-to/test-a-function.mdx @@ -38,3 +38,7 @@ This page shows you how to execute Serverless Functions from the [Scaleway conso 8. Click **Run**. The **Output** section displays the response from your function and the status code. + + +If you encounter a message error while testing your function, refer to the [dedicated troubleshooting](/serverless/functions/troubleshooting/tests-fail-on-private-function/) for more information. + \ No newline at end of file From d1bf1c8a215f0d9db911a69900c3c81deb71bd25 Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Wed, 15 Jan 2025 10:51:12 +0100 Subject: [PATCH 5/6] docs(srv): update --- menu/navigation.json | 6 ++-- .../containers/how-to/test-a-container.mdx | 2 +- .../tests-fail-on private-container.mdx | 26 ---------------- .../tests-fail-on-container.mdx | 31 +++++++++++++++++++ .../functions/how-to/test-a-function.mdx | 2 +- .../tests-fail-on-function.mdx | 31 +++++++++++++++++++ .../tests-fail-on-private-function.mdx | 26 ---------------- 7 files changed, 67 insertions(+), 57 deletions(-) delete mode 100644 serverless/containers/troubleshooting/tests-fail-on private-container.mdx create mode 100644 serverless/containers/troubleshooting/tests-fail-on-container.mdx create mode 100644 serverless/functions/troubleshooting/tests-fail-on-function.mdx delete mode 100644 serverless/functions/troubleshooting/tests-fail-on-private-function.mdx diff --git a/menu/navigation.json b/menu/navigation.json index ab4683aa9b..bbc830ec01 100644 --- a/menu/navigation.json +++ b/menu/navigation.json @@ -3783,8 +3783,8 @@ "slug": "too-many-retries" }, { - "label": "Tests fail on private functions", - "slug": "tests-fail-on-private-function" + "label": "Tests fail on functions", + "slug": "tests-fail-on-function" } ], "label": "Troubleshooting", @@ -3950,7 +3950,7 @@ }, { "label": "Tests fail on private containers", - "slug": "tests-fail-on-ùprivate-container" + "slug": "tests-fail-on-container" } ], "label": "Troubleshooting", diff --git a/serverless/containers/how-to/test-a-container.mdx b/serverless/containers/how-to/test-a-container.mdx index 4d63a5915a..a653440a01 100644 --- a/serverless/containers/how-to/test-a-container.mdx +++ b/serverless/containers/how-to/test-a-container.mdx @@ -40,5 +40,5 @@ This page shows you how to execute Serverless Containers from the [Scaleway cons The **Output** section displays the response from your container and the status code. -If you encounter a message error while testing your container, refer to the [dedicated troubleshooting](/serverless/containers/troubleshooting/tests-fail-on-private-container/) for more information. +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. \ No newline at end of file diff --git a/serverless/containers/troubleshooting/tests-fail-on private-container.mdx b/serverless/containers/troubleshooting/tests-fail-on private-container.mdx deleted file mode 100644 index e1accacc45..0000000000 --- a/serverless/containers/troubleshooting/tests-fail-on private-container.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -meta: - title: Tests fail on private Serverless Containers - description: I get error messages when testing private Serverless Containers using the Scaleway Console -content: - h1: Tests fail on private Serverless Containers - paragraph: I get error messages when testing private Serverless Containers using the Scaleway Console -tags: serverless containers private troubleshooting issue error test authentication token unable -dates: - validation: 2025-01-14 - posted: 2025-01-14 -categories: - - serverless ---- - -## Problem - -I get error messages when testing private Serverless Containers using the Scaleway Console. - -### Cause - -[Private](/serverless/containers/concepts/#privacy-policy) containers require a `X-Auth-Token` HTTP header when being run or tested. - -### Possible solutions - -Make sure that you have [created an authentication token](/serverless/containers/how-to/create-auth-token-from-console/) from the Scaleway console, and passed it as a HTTP header while [testing your container](/serverless/containers/how-to/test-a-container). \ No newline at end of file diff --git a/serverless/containers/troubleshooting/tests-fail-on-container.mdx b/serverless/containers/troubleshooting/tests-fail-on-container.mdx new file mode 100644 index 0000000000..701f2c16a0 --- /dev/null +++ b/serverless/containers/troubleshooting/tests-fail-on-container.mdx @@ -0,0 +1,31 @@ +--- +meta: + title: Tests fail on Serverless Containers + description: I get error messages when testing Serverless Containers using the Scaleway Console +content: + h1: Tests fail on Serverless Containers + paragraph: I get error messages when testing Serverless Containers using the Scaleway Console +tags: serverless containers private troubleshooting issue error test authentication token unable +dates: + validation: 2025-01-14 + posted: 2025-01-14 +categories: + - serverless +--- + +## Problem + +I get error messages when testing Serverless Containers using the Scaleway Console. + +### Cause + +Testing **Private** Serverless Containers is not possible using the Scaleway console due to CORS limitations. + +### Possible solutions + +- Change the visibility of your function to **public**. Public containers can be executed anonymously. + +- 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: + ```sh + curl -H "X-Auth-Token: " \ + ``` \ No newline at end of file diff --git a/serverless/functions/how-to/test-a-function.mdx b/serverless/functions/how-to/test-a-function.mdx index 87f66283ce..e9b74465e2 100644 --- a/serverless/functions/how-to/test-a-function.mdx +++ b/serverless/functions/how-to/test-a-function.mdx @@ -40,5 +40,5 @@ This page shows you how to execute Serverless Functions from the [Scaleway conso The **Output** section displays the response from your function and the status code. -If you encounter a message error while testing your function, refer to the [dedicated troubleshooting](/serverless/functions/troubleshooting/tests-fail-on-private-function/) for more information. +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. \ No newline at end of file diff --git a/serverless/functions/troubleshooting/tests-fail-on-function.mdx b/serverless/functions/troubleshooting/tests-fail-on-function.mdx new file mode 100644 index 0000000000..42b5d4fa10 --- /dev/null +++ b/serverless/functions/troubleshooting/tests-fail-on-function.mdx @@ -0,0 +1,31 @@ +--- +meta: + title: Tests fail on Serverless Functions + description: I get error messages when testing Serverless Functions using the Scaleway Console +content: + h1: Tests fail on Serverless Functions + paragraph: I get error messages when testing Serverless Functions using the Scaleway Console +tags: serverless functions private troubleshooting issue error test authentication token unable +dates: + validation: 2025-01-14 + posted: 2025-01-14 +categories: + - serverless +--- + +## Problem + +I get error messages when testing Serverless Functions using the Scaleway Console. + +### Cause + +Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations. + +### Possible solutions + +- Change the visibility of your function to **public**. Public functions can be executed anonymously. + +- 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: + ```sh + curl -H "X-Auth-Token: " \ + ``` \ No newline at end of file diff --git a/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx b/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx deleted file mode 100644 index 43b262df6b..0000000000 --- a/serverless/functions/troubleshooting/tests-fail-on-private-function.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -meta: - title: Tests fail on private Serverless Functions - description: I get error messages when testing private Serverless Functions using the Scaleway Console -content: - h1: Tests fail on private Serverless Functions - paragraph: I get error messages when testing private Serverless Functions using the Scaleway Console -tags: serverless functions private troubleshooting issue error test authentication token unable -dates: - validation: 2025-01-14 - posted: 2025-01-14 -categories: - - serverless ---- - -## Problem - -I get error messages when testing private Serverless Functions using the Scaleway Console. - -### Cause - -[Private](/serverless/functions/concepts/#privacy-policy) functions require a `X-Auth-Token` HTTP header when being run or tested. - -### Possible solutions - -Make sure that you have [created an authentication token](/serverless/functions/how-to/create-auth-token-from-console/) from the Scaleway console, and passed it as a HTTP header while [testing your function](/serverless/functions/how-to/test-a-function). \ No newline at end of file From 89ca3dbc1ddd7ac8e754b6854f89a0ba6252e863 Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Wed, 15 Jan 2025 11:02:21 +0100 Subject: [PATCH 6/6] docs(srv): update --- menu/navigation.json | 2 +- serverless/containers/how-to/test-a-container.mdx | 4 ++++ serverless/functions/how-to/test-a-function.mdx | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/menu/navigation.json b/menu/navigation.json index bbc830ec01..e87765a113 100644 --- a/menu/navigation.json +++ b/menu/navigation.json @@ -3949,7 +3949,7 @@ "slug": "container-stopped-after-redeploy" }, { - "label": "Tests fail on private containers", + "label": "Tests fail on containers", "slug": "tests-fail-on-container" } ], diff --git a/serverless/containers/how-to/test-a-container.mdx b/serverless/containers/how-to/test-a-container.mdx index a653440a01..97dc2bbdf2 100644 --- a/serverless/containers/how-to/test-a-container.mdx +++ b/serverless/containers/how-to/test-a-container.mdx @@ -15,6 +15,10 @@ categories: 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. + +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. + + - A Scaleway account logged into the [console](https://console.scaleway.com) diff --git a/serverless/functions/how-to/test-a-function.mdx b/serverless/functions/how-to/test-a-function.mdx index e9b74465e2..a5e69b03a9 100644 --- a/serverless/functions/how-to/test-a-function.mdx +++ b/serverless/functions/how-to/test-a-function.mdx @@ -15,6 +15,10 @@ categories: 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. + +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. + + - A Scaleway account logged into the [console](https://console.scaleway.com)