Skip to content

Commit ed19d8e

Browse files
authored
Add common issue and secure warning.
1 parent 33f3de6 commit ed19d8e

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: "Troubleshooting guide for Azure Web PubSub Service"
3+
description: Learn how to troubleshoot common issues
4+
author: JialinXin
5+
ms.service: signalr
6+
ms.topic: how-to
7+
ms.date: 04/28/2023
8+
ms.author: jixin
9+
ms.devlang: csharp
10+
---
11+
12+
# Troubleshooting guide for common issues
13+
14+
This article provides troubleshooting guidance for some of the common issues that customers might encounter. Listed errors are available to check by turn on `LiveTrace` tool or collect from diagnostics following [Capture resource logs](https://learn.microsoft.com/azure/azure-web-pubsub/howto-troubleshoot-resource-logs).
15+
16+
## 404 from HttpHandlerUnexpectedResponse
17+
18+
### Possible errors
19+
20+
`Sending message during operation hub:<your-hub>,event:connect,type:sys,category:connections,requestType:Connect got unexpected response with status code 404.`
21+
22+
### Root cause
23+
24+
This error indicates the event is registered in Web PubSub settings but fail to get a response from registered upstream URL.
25+
26+
### Troubleshooting guide
27+
28+
- Check your upstream server function or method whether it is good to work.
29+
- Check whether this event is intended to register. If not, simply remove it from the hub settings in Web PubSub side.
30+
31+
## 500 from HttpHandlerUnexpectedResponse
32+
33+
### Possible errors
34+
35+
- `Sending message during operation handshake got unexpected response with status code 500. Detail: Get error from upstream: 'Request is denied as target server is invalid'`
36+
- `Sending message during operation hub:<your-hub>,event:connect,type:sys,category:connections,requestType:Connect got unexpected response with status code 500.`
37+
38+
### Root cause
39+
40+
This error indicates event request get a `500` response from registered upstream.
41+
42+
### Troubleshooting guide
43+
44+
- Check upstream side logs to investigate if there's some errors during handling the reported event.
45+
46+
## AbuseProtectionResponseMissingAllowedOrigin
47+
48+
Web PubSub follows the [CloudEvents Abuse Protection](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection) to validate the upstream webhook. Every registered upstream webhook URL will be validated by this mechanism. The `WebHook-Request-Origin` request header is set to the service domain name `<web-pubsub-name>.webpubsub.azure.com`, and it expects the response to have a header `WebHook-Allowed-Origin` to contain this domain name or `*`.
49+
50+
### Possible errors
51+
52+
- `Abuse protection for 'https://<upstream-host>/<upstream-path>' missing allowed origins: .`
53+
54+
### Troubleshooting guide
55+
56+
Review the upstream side code to ensure when upstream receives the `OPTIONS` preflight request from Web PubSub service, it's correctly handled following the rule that contains the expected header `WebHook-Allowed-Origin` and value.
57+
58+
Besides, you can update to convenience server SDK which automatically handles `Abuse Protection` for you.
59+
60+
- [@web-pubsub-express for JaveScript ](https://www.npmjs.com/package/@azure/web-pubsub-express)
61+
- [Microsoft.Azure.WebPubSub.AspNetCore for C#](https://www.nuget.org/packages/Microsoft.Azure.WebPubSub.AspNetCore)
62+
63+
## 401 Unauthorized from AbuseProtectionResponseInvalidStatusCode
64+
65+
### Possible errors
66+
67+
- `Abuse protection for 'https://<upstream-host>/<upstream-path>' failed: 401.`
68+
69+
### Root cause
70+
71+
This error indicates the `Abuse Protection` request get a `401` response from the registered upstream URL. See [`Abuse Protection`](https://learn.microsoft.com/azure/azure-web-pubsub/howto-develop-eventhandler#upstream-and-validation) for more details.
72+
73+
### Troubleshooting guide
74+
75+
- Check if there's any authentication enabled in upstream side, for example, the `App Keys` for a `WebPubSubTrigger` Azure Function is set correctly, see [example](https://learn.microsoft.com/azure/azure-web-pubsub/quickstart-serverless?#configure-the-web-pubsub-service-event-handler).
76+
- Check upstream side logs to investigate how is the `Abuse Protection` request processed.
77+
78+
## Client connection drops
79+
80+
When the client is connected to Azure Web PubSub, the persistent connection between the client and Azure Web PubSUb can sometimes drop for different reasons. This section describes several possibilities causing such connection drop and provides some guidance on how to identify the root cause.
81+
82+
You can check the metric `Connection Close Count` from Azure Portal.
83+
84+
### Possible reasons and root cause
85+
86+
| Reason | Root cause |
87+
| -- | -- |
88+
| Normal | Close by clients |
89+
| ClosedByAppServer | Close by server triggered Rest API call like [`CloseConnection`](https://learn.microsoft.com/rest/api/webpubsub/dataplane/web-pub-sub/close-connection?tabs=HTTP) |
90+
| ServiceReload | Close by service due to regular maintenance or backend auto scales |
91+
| PingTimeout | Close by service due to client status unhealthy that service doesn't receive any regular pings |
92+
| SlowClient | Close by service due to clients are not able to receive buffered messages fast enough |
93+
94+
### Troubleshooting guide
95+
96+
`PingTimeout` and `SlowClient` indicates that you have some clients not able to afford current traffic load. It's suggested to control the message sending speed and investigate client traces if client side performance can be improved.
97+
98+
## ConnectionCountLimitReached
99+
100+
Web PubSub different tiers have a hard limit on concurrent connection. This error indicates your traffic is beyond the supported connection count. See [Web PubSub pricing](https://azure.microsoft.com/en-us/pricing/details/web-pubsub/) for details.
101+
102+
### Solution
103+
104+
Scale up to a paid tier(Standard or Premium) to have at least 1000 connections or scale out to more units that supports more connections.
105+

articles/azure-web-pubsub/key-concepts.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Here are some important terms used by the service:
1919

2020
[!INCLUDE [Terms](includes/terms.md)]
2121

22+
> [!IMPORTANT]
23+
> `Hub`, `Group`, `UserId` are important roles when you manage clients and send messages. They will be required parameters in different REST API calls as plain text. So __DO NOT__ put sensitive information in these fields. For example, credentials or bearer tokens which will have high leak risk.
24+
2225
## Workflow
2326

2427
A typical workflow using the service is shown as below:

articles/azure-web-pubsub/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
href: howto-troubleshoot-network-trace.md
104104
- name: Capture resource logs
105105
href: howto-troubleshoot-resource-logs.md
106+
- name: Common issues
107+
href: howto-troubleshoot-common-issues.md
106108
- name: Move across regions
107109
href: howto-move-across-regions.md
108110
- name: Scale

0 commit comments

Comments
 (0)