question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handling 1006 errors and unexepected disconnections

See original GitHub issue

Pusher 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:closed
  • Created 7 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
amrendraw3commented, Feb 7, 2018

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});

0reactions
aeolusheathcommented, Jan 17, 2018

@tquiroga pusher has auto-reconenct func

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found