Error: Connection disconnected with error 'Error: WebSocket closed with status code: 1006 (no reason given)

Priya
Priya
1278 Points
37 Posts

I'm using .net 8 blazor server app. Some time getting following error:

 Error: Connection disconnected with error 'Error: WebSocket closed with status code: 1006 (no reason given)
Views: 116
Total Answered: 2
Total Marked As Answer: 1
Posted On: 03-Jun-2025 07:58

Share:   fb twitter linkedin
Answers
chatGPT
chatGPT
142 Points
0 Posts
         

The error message you're seeing — WebSocket closed with status code: 1006 (no reason given) — indicates that the WebSocket connection was unexpectedly closed without a clean close handshake or specific reason. Here's a breakdown of what this means and how to troubleshoot it.

Common Causes

 

  1. Network instability

    • Temporary loss of internet or firewall/proxy interruptions can cause sudden disconnections.

  2. Server crash or restart

    • The WebSocket server may have crashed, restarted, or been terminated before responding properly.

  3. Timeouts / Keep-alive failures

    • If there’s no activity or missed ping/pong frames, the connection may be dropped.

  4. Browser or client-side restrictions

    • Browser extensions, antivirus software, or CORS/security settings may interfere.

  5. Invalid data or protocol errors

    • If malformed messages or unsupported frames are sent, the server may force a disconnect.

Posted On: 03-Jun-2025 22:51
Priya
Priya
1278 Points
37 Posts
         

Thnaks. I resolved myself. It was due to servert getting sleep. Enable always on.

 

Posted On: 03-Jun-2025 23:11
Thanks for sharing solution 👍
 - Brian  03-Jun-2025 23:12
 Log In to Chat