Handling 1006 errors and unexepected disconnections
See original GitHub issuePusher version: 2.2.4
My organization has been using Pusher for awhile and we’ve noticed that occasionally it’ll just stop working. In most cases, it logs a 1066 error like so:
Pusher : Error : {"type":"WebSocketError","error":{"type":"PusherError","data":{"code":1006}}}
and will not send/receive any more events. Another error I’ve seen with less frequency is:
Pusher : Error : {"type":"WebSocketError","error":{"type":"PusherError","data":{"code":4201,"message":"Pong reply not received"}}}
Usually this event occurs if the user’s computer has been put to sleep and then re-awoken – but not always. I’m only occasionally able to reproduce it on my machine.
Any ideas on what I could do to ensure that Pusher connections stay alive or refresh them when they die? Also any recommendations on testing error/disconnected/fail scenarios with Pusher?
Sorry for the really vague issue but it’s all I have to work with.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Unexpected Disconnection with Code 1006 on Windows ...
1006 error usually happens when there is a timeout. In the library you are using, the ws timeout is 30 seconds: ...
Read more >Phoenix Channel Disconnect with 1006 error - Elixir Forum
Hello, community! We are faced a problem, phoenix sockets are reconnected randomly from time to time. We try to debug and find out...
Read more >Websocket: close 1006 error - OSS Support
Dear K6 experts, I use 40 websocket sessions during my performance test, sometimes I encounter “websocket: close 1006 error”, according to ...
Read more >What Is Meant By Channels Error 1006? - Pusher
When a WebSocket connection is closed without a "close frame", the pusher-js library emits an error with code 1006. Usually...
Read more >Error reading message from client / websocket: close 1006 ...
Here is the full error I got last night, when I was trying to read ... ”,“error”:“websocket: close 1006 (abnormal closure): unexpected EOF”}....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
code 1006
error occurs mostly because of missing cluster key while initializing pusher client. It should something like:var client = new Pusher('YOUR_APP_KEY', {cluster: 'CLUSTER_VALUE', encrypted: true});
@tquiroga pusher has auto-reconenct func