xmppo / node-xmpp-bosh

An XMPP BOSH & WebSocket server (connection manager) written on node.js using Javascript
https://github.com/xmppo/node-xmpp-bosh
263 stars 85 forks source link

Node instances crash using websocket #100

Closed kochka closed 10 years ago

kochka commented 10 years ago

Hello,

We are using node-xmpp-bosh for a long time (currently v0.7.10) with Bosh without any issues. We are now switching to Websocket. The service run flawlessly for some hours (with traffic) until some instances crash with the following error :

events.js:50
        throw new Error("Uncaught, unspecified 'error' event.");
        ^
Error: Uncaught, unspecified 'error' event.
    at WebSocket.emit (events.js:50:15)
    at Receiver.onerror (/opt/node-xmpp-bosh/node_modules/ws/lib/WebSocket.js:703:10)
    at Receiver.error (/opt/node-xmpp-bosh/node_modules/ws/lib/Receiver.js:301:8)
    at Receiver.processPacket (/opt/node-xmpp-bosh/node_modules/ws/lib/Receiver.js:187:10)
    at Receiver.add (/opt/node-xmpp-bosh/node_modules/ws/lib/Receiver.js:93:24)
    at Socket.firstHandler (/opt/node-xmpp-bosh/node_modules/ws/lib/WebSocket.js:662:22)
    at Socket.emit (events.js:67:17)
    at TCP.onread (net.js:367:14)

Any idea ? Thanks !

zlokomatic commented 10 years ago

I also get this error, is there a solution yet?

dhruvbird commented 10 years ago

Is it possible for you to run the server in trace logging mode and send me the log privately? If the log is too big, you can potentially trim all lines except for a few thousand just before the crash.

zlokomatic commented 10 years ago

I just created a pull request. It doesnt fix the underlying problem but prevents crashing. Error messages i get are:

"invalid error code" "reserved fields must be empty" "continuation frame cannot follow current opcode"

dhruvbird commented 10 years ago

@zlokomatic Looks good - as long as we are printing the actual error, we should be fine, since this seems to be a protocol issue. Potentially something invalid we or the client sends.