-
Notifications
You must be signed in to change notification settings - Fork 10
kurento-client always crashes on node.js >=6.3 (dependency bug) #116
kurento-client always crashes on node.js >=6.3 (dependency bug) #116
Comments
@igracia @gortazar @rbenitez |
I +1 this, as I also experience problems right now, after upgrading to latest node.js.
And I get this error:
Which leads to the same |
I hate to say +1, but…+1.
I’m not sure how to fix this. The naïve approach of forking the repositories and updating the dependency does not work, which isn’t surprising (I’m sure many APIs may have changed). This gives me the rather bizarre error message
|
We'd really like to update those deps too. The thing is that we can't estimate how long it would take us to fix things for the new versions, and since it's working in the LTS version of node.js, we haven't scheduled that yet. |
Great to see the bug being assigned :-D.
For the reconnect feature perhaps it would be worth looking at what engine.io (socket.io engine) is doing? Thanks and good luck! |
@bschmitlin yeah, we postponed this for too long, sorry! First we are going to try and update the forks, so it stops pestering devs using node >6.3. After that, we'll try and go for something like what you pointed or maybe reconnecting-websocket Will try and make the log more configurable, probably using winston or loglevel |
@bschmitlin We've submitted a patch that should fix this for now, until we move to a more stable ws with reconnection library. Had to update the reference to ws in the KurentoForks/reconnect-ws library, and tested some other things apart from that to see if we could use the latest code from reconnect-core too. Can you please check that this patch does indeed solves the issue? |
@igracia Thanks for the super quick patch. It works fine on node 6.7.0 in the somewhat limited testing I've done. |
@bschmitlin Thanks for the feedback. It works also in all the other tests that we have. It seems like we can close this issue then. Haven't done anything about logging yet, sorry! Will tackle that later on, as we have more pressing matters right now. Sorry it's bothering you, you'll have to put up with that a little longer ;-) |
The version of websocket-stream used depends on ws 0.4.32 and triggers this issue. |
@superdump In which version of node? Can you be a bit more specific with the report? |
v6.9.1 I am using
This happens very regularly. A bit of googling lead me here and I checked the ws version that is pulled in by websocket-stream and it has |
That is with KMS 6.6.1 and nightlies. |
@haggholm The error you see when upgrading are from these lines in kurento-jsonrpc-js: https://github.com/Kurento/kurento-jsonrpc-js/blob/master/lib/packers/JsonRPC.js#L63-L75 The reason is that when you bump the version of websocket-stream to something more modern (my testing indicates that the breaking change occurs when you go over 1.*) the unpack is no longer being called with a String but with an object. This object however can easily be made into a string (which is what is happening in the error printout later in the above code - when it is doing the "+ message") so the obvious patch is to introduce an extra toString when the message is not a String:
This seems to, with very limited testing, make the kurento client work also with latest websocket-stream. At least it does not stop on that error and the traffic seems to go through. |
I created PR for fix it. |
using node 6.4 with [email protected] connected to latest master branch kurento-server.
Due to (from my understanding) an incompatibility of the ws library with node.js 6.3, when opening the websocket kurento-client crashes the node app:
2016-08-19T09:13:32.432Z - error: RangeError: out of range index
at RangeError (native)
at fastCopy (/Users/benoit/git/rtc/node_modules/ws/lib/Receiver.js:317:24)
at Receiver.add (/Users/benoit/git/rtc/node_modules/ws/lib/Receiver.js:78:3)
at Socket.firstHandler (/Users/benoit/git/rtc/node_modules/ws/lib/WebSocket.js:663:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:177:18)
at Socket.Readable.push (_stream_readable.js:135:10)
at TCP.onread (net.js:542:20)
seems to be websockets/ws#778
which would affect [email protected] used by kurento-client. This bug is apparently fixed in [email protected].
The text was updated successfully, but these errors were encountered: