New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blazor Server-Side Websocket closed with status code '1006' on real hosting #21546
Comments
Conducted some research: |
@Domivan thanks for contacting us and thanks for the details! We'll look into this issue and update it appropriately. Looping some SignalR folks and Server folks since they will know more. @BrennanConroy @Tratcher @jkotalik do you have any thoughts on what can be at play here? |
What is the memory usage of your process when the websocket is disconnected? If you're hitting the 2Gb limit then IIS will restart the app and you'll lose all connections. |
Cleared the milestone so this doesn't slip through cracks. |
Why are you configuring your Virtual Memory limit? By default it should be 0. As you observed switching to 32 bit "fixes" the issue. This is likely because 64 bit is more aggressive with using virtual memory. Also, you could try disabling server GC to see if less virtual memory is used. |
The virtual memory limit is strictly limited by the hosting provider; I cannot change this limit. |
Please share a solution to the problem. I found that all blazor server side applications somehow lose connection with error 1006, even the usual empty weather forecast template hosted on the IIS server. The time of occurrence of the error is not predictable. Reload the page after losing the connection is not a problem, but what about authorization? When disconnected, all authorization data is lost, you have to log in again. |
I mentioned one option, have you tried this out? You can also try specifying the GC heap limit to keep memory down: https://github.com/dotnet/docs/blob/ed5a85b61908468f050220d8956a6769192f631f/docs/core/run-time-config/garbage-collector.md#systemgcheaphardlimitcomplus_gcheaphardlimit |
Anything new on this? I am having the same issue running the site in Kestrel. |
If you're using Kestrel stand-alone then open a new issue. Otherwise the conversation above should solve the issue. Unless you have a different problem, in which case also open a new issue. |
@BrennanConroy I am having this issue on Windows with Apache. The connection is disconnected every few minutes and then reconnects. Sometimes, it has trouble reconnecting, and the app breaks. See the bolded "Error" below. This is what the console looks like when the app is left idle:
|
Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue. This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue! |
@mkArtakMSFT I’m not sure it makes sense for this to be closed. |
Good day!
Problem with server-side blazor.
On the real hosting, the application constantly loses connection with the server, reporting an error "websocket closed with status code 1006".
Already broke his head in search of a cause.
At the same time, the application works without problems on the local computer in development mode.
It got to the point that I decided to simulate everything from scratch.
It turned out that any blazor application loses its connection in the conditions of limitations of the iis server dedicated vitrual memory.
I created the start-up template of the blazor-server side application, didn’t add anything, published it on the local iis, in the iis settings I set 20Gb for virtual memory and 2Gb for allocated memory and I get websocket disconnections when the Click button on the Count page is clicked actively.
If you set the virtual memory size to 0, no shutdowns occur. But this does not meet the conditions of real hosting.
Friends, what's the problem?
The text was updated successfully, but these errors were encountered: