Skip to content

Instantly share code, notes, and snippets.

@3rd-Eden
Created October 7, 2010 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3rd-Eden/615009 to your computer and use it in GitHub Desktop.
Save 3rd-Eden/615009 to your computer and use it in GitHub Desktop.
Caught exception: Error: assertion error
[ 'Error: assertion error'
, ' at node.js:30:17'
, ' at Timer.callback (net:150:29)'
, ' at node.js:764:9'
]
Initializing client with transport "flashsocket"
Client 5877707917243242 connected
268 wtf.. clients internally queued.
Initializing client with transport "flashsocket"
Client 7412870274856687 connected
269 wtf.. clients internally queued.
Caught exception: Error: assertion error
[ 'Error: assertion error'
, ' at node.js:30:17'
, ' at Timer.callback (net:150:29)'
, ' at node.js:764:9'
]
Client 6639853832311928 disconnected
Client 9317042354959995 disconnected
Caught exception: Error: assertion error
[ 'Error: assertion error'
, ' at node.js:30:17'
, ' at Timer.callback (net:150:29)'
, ' at node.js:764:9'
]
Client 3484993949532509 disconnected
Client 5395396156236529 disconnected
Caught exception: Error: assertion error
[ 'Error: assertion error'
, ' at node.js:30:17'
, ' at Timer.callback (net:150:29)'
, ' at node.js:764:9'
]
@is
Copy link

is commented Oct 22, 2010

same problem...

@3rd-Eden
Copy link
Author

We should probably a timeout event to the request's. This should probably solve the issue.

@is
Copy link

is commented Nov 2, 2010

Yeah, I caught the timeout event, and the error gone. thanks.

@Shadowfiend
Copy link

Hm. Where did you add the timeout listener? Is it just a global one?

@is
Copy link

is commented Nov 24, 2010

I'm not sure which change resolve the problem indeed. i listen request & response error event and global uncaughtException event. Closing client timely is helpful, perhaps.

@3rd-Eden
Copy link
Author

I'll make sure the correct ontimeout handlers are added in the socket.io server. ( instead of patching my own version )

@Shadowfiend
Copy link

That would be epic :) We started running into the same issue. Right now it's possible I may have just put timeout handlers on every request I saw as I was in a hurry O:-)

@3rd-Eden
Copy link
Author

Yeh adding the ontimeout handlers to request will solve it because every requests we are dealing with can potentially time out and cause an uncaught exception.

@skillcoder
Copy link

Any one please put here the code for fix this "Error: assertion error"

@3rd-Eden
Copy link
Author

Havent seen that one yet

@skillcoder
Copy link

3rd-Eden, You wrote that solved the problem.

How exactly did you do it?

Please let me sample code "ontimeout" and please tell exactly where it needs to be set

Or tell please how to make at least a work around...

@skillcoder
Copy link

Problem is still relevant.
Please help.

How to get rid of node crashes ?

@skillcoder
Copy link

Problem is still relevant.
Please help.

@gilbert
Copy link

gilbert commented Feb 21, 2011

Agree, would like a formal solution to this.

@3rd-Eden
Copy link
Author

3rd-Eden commented Mar 3, 2011

My apologies for the late responses, but I have just moved to a new place and didn't have that much time to check up with new messages to this conversation. The suggest location of patching would be adding it inside the Client.prototype._onConnect on both the req and req.connection

@3rd-Eden
Copy link
Author

3rd-Eden commented Mar 3, 2011

Also @ skillcoder to get rid of node crashes you should add a global exception handler.. Using:

process.addListener( "uncaughtException", function captureException( err ){ console.log('Error occurred, prevented Node.js crash: '); console.dir( err ); });

@skillcoder
Copy link

Do I understand correctly you need to edit the file
./Socket.IO-node/lib/socket.io/client.js
on the client side so as not to fall a server?

@3rd-Eden
Copy link
Author

3rd-Eden commented Mar 3, 2011

Hi,

You need to edit the Client.prototype._onConnect in ./Socket.IO-node/lib/socket.io/client.js . I have also pushed the changes to my companies github repo and highlighted the position of the changes.
( Note: this is on socket.io 0.6.15 )
https://github.com/Hotelsnl/Socket.IO-node/blob/63624e5996b2719bb08f38a8af143c2019617da3/lib/socket.io/client.js#L63-103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment