aspnetcore
aspnetcore copied to clipboard
Signal R - Error: Server timeout elapsed without receiving a message from the server
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
There is already a ticket reported for this but is closed without proposing any solution. https://github.com/dotnet/aspnetcore/issues/39811
I am trying to test SignalR reconnected scenarios and a weird thing is happening that has caught my attention. If I turn off my wifi and reconnect it, my SignalR connection is reconnected successfully.
But soon after a few seconds, my web socket connection gets closed and the below-given log is printed in the console.
[2022-06-05T13:34:26.650Z] Trace: (WebSockets transport) sending data. String data of length 11. Utils.ts:192
[2022-06-05T13:34:34.703Z] Trace: (WebSockets transport) data received. String data of length 10683. Utils.ts:192
[2022-06-05T13:34:41.651Z] Trace: (WebSockets transport) sending data. String data of length 11. Utils.ts:192
[2022-06-05T13:35:34.767Z] Trace: (WebSockets transport) socket closed. Utils.ts:192
[2022-06-05T13:35:34.767Z] Debug: HttpConnection.stopConnection(undefined) called while in state Disconnecting. Utils.ts:182
[2022-06-05T13:35:34.767Z] Error: Connection disconnected with error 'Error: Server timeout elapsed without receiving a message from the server.'. Utils.ts:182
This is happening both in Chrome (102.0.5005.63 (Official Build) (64-bit)) and Edge (102.0.1245.30 (Official build) (64-bit)).
Expected Behavior
After reconnection, the SignalR connection should stay connected.
Steps To Reproduce
- Establish a SignalR connection with logging level trace.
- Close/Disconnect Wifi
- Wait for SignalR to go in reconnecting state
- Connect Wifi again
- Wait for SignalR to go in reconnected state
- Wait for 60 seconds max
- Open console and observe logs, you will be able to see this pattern.
Exceptions (if any)
Error: Connection disconnected with error 'Error: Server timeout elapsed without receiving a message from the server.'
.NET Core Version
3.1.1
Anything else?
Nuget package: Microsoft.AspNetCore.SignalR: 1.1.0 Client library: "@microsoft/signalr": "^5.0.7"
@asadmalik3 Triage: Since you are using 3.1.1, you do need the following package anymore: Microsoft.AspNetCore.SignalR: 1.1.0. On the client side can you use @microsoft/signalr 3.1.23 (https://www.npmjs.com/package/@microsoft/signalr/v/3.1.23) ?
Please try the 6.0.x or 7.0.x version of the @microsoft/signalr
package, 5.0.x isn't supported.
Additionally, please provide a minimal repro application as a github repository.
Hi @asadmalik3. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
See our Issue Management Policies for more information.