TypeError: Cannot read property '0' of undefined
I have that traceback! :) I'm starting new issue because I'm almost 100% sure that it's note related to flashsocket issue.
if (data[0] == '\ufffd') {
^
TypeError: Cannot read property '0' of undefined
at Object.decodePayload (/home/data/node_modules/socket.io/lib/parser.js:226:11)
at JSONPPolling.onData (/home/data/node_modules/socket.io/lib/transports/http.js:85:25)
at IncomingMessage.
Is it easy to reproduce?
I can send you my server code. Server was just running on high load.
Code: http://dpaste.com/570866/
I am experiencing the same error during high load (~ 1.000 to 3.000 open tcp connections), also with the same stack trace:
.../node_modules/socket.io/lib/parser.js:226
if (data[0] == '\ufffd') {
^
TypeError: Cannot read property '0' of undefined
at Object.decodePayload (.../node_modules/socket.io/lib/parser.js:226:11)
at JSONPPolling.onData (.../node_modules/socket.io/lib/transports/http.js:85:25)
at IncomingMessage. (.../node_modules/socket.io/lib/transports/http.js:57:12)
at IncomingMessage.emit (events.js:61:17)
at HTTPParser.onMessageComplete (http.js:133:23)
at Socket.ondata (http.js:1026:22)
at Socket._onReadable (net.js:683:27)
at IOWatcher.onReadable [as callback] (net.js:177:10)
The server ran for 3 days and crashed 5 times with this error and another time it ran out of memory. I think it's not easy to reproduce because those crashes seem occasional.
Maybe some additional information:
- The debug level was 3 -- very verbose
- There were around 500 to 1.200 chat rooms
- The system was monitored by "god", which restarted the service upon crash
- The overall cpu usage and load was very low but at some point it started to rise dramatically
If you need more information, tell me.
Hey, i have the same problem every 2 - 3 days i have server crash because of that.
If i can help by adding to code base some debuging code pls post it.
2011-08-06_07:53:19.05452 Chat/js/lib/parser.js:226
2011-08-06_07:53:19.05453 if (data[0] == '\ufffd') {
2011-08-06_07:53:19.05455 ^
2011-08-06_07:53:19.05455 TypeError: Cannot read property '0' of undefined
2011-08-06_07:53:19.05456 at Object.decodePayload (Chat/js/lib/parser.js:226:11)
2011-08-06_07:53:19.05456 at JSONPPolling.onData (Chat/js/lib/transports/http.js:85:25)
2011-08-06_07:53:19.05457 at IncomingMessage.
Still experiencing the problem with the latest master.
What's the status of this issue? It seems like all the large, serious issues that prevent Socket.IO being used in the real world, arent getting enough attention.
Does this still happen, @nookiepl?