From 17dbfedf38d3ebd36f64b2b57ad6a6f8f5f93434 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 10:31:50 -0700 Subject: [PATCH] Fix misleading skipNegotiation context in Response code 404 troubleshooting section (#36915) * Initial plan * Restructure Response code 404 section to separate causes by skipNegotiation setting Fixes #30691. The section previously framed all troubleshooting causes under skipNegotiation=true, but sticky-session and connection-ID-timeout scenarios only apply when skipNegotiation=false. Restructured into three clear subsections: general causes, default negotiation flow causes, and skipNegotiation=true causes. Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/AspNetCore.Docs/sessions/7cce18e9-cbc6-4b5c-8fe5-a60d9fe3d060 * Fix formatting of sticky-session explanation --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> Co-authored-by: Wade Pickett --- aspnetcore/signalr/troubleshoot.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/aspnetcore/signalr/troubleshoot.md b/aspnetcore/signalr/troubleshoot.md index 70c526d5c66c..628749c868e5 100644 --- a/aspnetcore/signalr/troubleshoot.md +++ b/aspnetcore/signalr/troubleshoot.md @@ -1,11 +1,12 @@ --- title: ASP.NET Core SignalR connection troubleshooting +ai-usage: ai-assisted author: wadepickett description: ASP.NET Core SignalR connection troubleshooting. monikerRange: '>= aspnetcore-2.1' ms.author: wpickett ms.custom: mvc -ms.date: 04/08/2020 +ms.date: 03/25/2026 uid: signalr/troubleshoot --- # Troubleshoot connection errors @@ -14,18 +15,26 @@ This section provides help with errors that can occur when trying to establish a ### Response code 404 -When using WebSockets and `skipNegotiation = true` ```log WebSocket connection to 'wss://xxx/HubName' failed: Error during WebSocket handshake: Unexpected response code: 404 ``` +**General causes (all configurations):** + +* Verify the client is connecting to the correct endpoint. For example, the server is hosted at `http://127.0.0.1:5000/hub/myHub` and the client is trying to connect to `http://127.0.0.1:5000/myHub`. + +**When using the default negotiation flow (`skipNegotiation = false`):** + * When using multiple servers without sticky sessions, the connection can start on one server and then switch to another server. The other server is not aware of the previous connection. -* Verify the client is connecting to the correct endpoint. For example, the server is hosted at `http://127.0.0.1:5000/hub/myHub` and client is trying to connect to `http://127.0.0.1:5000/myHub`. * If the connection uses the ID and takes too long to send a request to the server after the negotiate, the server: * Deletes the ID. * Returns a 404. +**When using WebSockets with `skipNegotiation = true`:** + +* Since negotiation is skipped and no connection ID is obtained from `/negotiate`, the sticky session and connection ID timeout scenarios don't apply. A 404 in this case typically means the WebSocket endpoint URL is incorrect or the hub isn't mapped on the server. + ### Response code 400 or 503 For the following error: