socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

Engine.io: Cannot read properties of undefined (reading 'end') error

Open azju opened this issue 2 years ago • 3 comments

Describe the bug We're sometimes seeing a very rare error while using uWebSockets.js (uws);

To Reproduce

It happens occasionally and can't reproduce locally

Socket.IO server version: 4.6.0

Expected behavior No to see the error or this error gets handled gracefully.

Platform:

  • Client device: Unknown
  • Client OS: Unknown
  • Server: x86_64 & arm64 Alpine linux
  • Socket.IO version: 4.6.0
  • uWebSockets.js version: 20.19.0

Additional context Cannot read properties of undefined (reading 'end')\nTypeError: Cannot read properties of undefined (reading 'end')\n at Polling.onDataRequest (/node_modules/engine.io/build/transports-uws/polling.js:104:51)\n at Polling.onRequest (/node_modules/engine.io/build/transports-uws/polling.js:47:18)\n at /node_modules/engine.io/build/userver.js:95:60\n at uServer.verify (/node_modules/engine.io/build/server.js:152:9)\n at /node_modules/engine.io/build/userver.js:82:18\n at /node_modules/engine.io/build/userver.js:74:13\n at /node_modules/engine.io/build/server.js:187:21\n at cors (/node_modules/cors/lib/index.js:188:7)\n at /node_modules/cors/lib/index.js:224:17\n at origin (/dist/socket.js:40:25)

azju avatar Feb 28 '23 05:02 azju

I think I've found the culprit, this should be fixed by https://github.com/socketio/engine.io/commit/8b2216290330b174c9e67be32765bec0c74769f9, included in [email protected] and thus in [email protected].

Please reopen if needed.

darrachequesne avatar May 03 '23 08:05 darrachequesne

socket.io

not, it does not fix that, also there is other error with uws

joacub avatar May 22 '23 02:05 joacub

we are facing a similar issues

TypeError: Cannot read property 'end' of undefined

at IncomingMessage.onData (/usr/local/readytech/acc-server/stage/node_modules/engine.io/build/transports/polling.js:128:35)
 at IncomingMessage.emit (events.js:197:13)
 at addChunk (_stream_readable.js:288:12)
 at readableAddChunk (_stream_readable.js:265:13)
 at IncomingMessage.Readable.push (_stream_readable.js:224:10)
 at HTTPParser.parserOnBody (_http_common.js:126:22)
Jul 20 08:07:58 dev-server systemd[1]: service: Main process exited, code=exited, status=1/FAILURE

dubisoft-solutions avatar Jul 20 '23 09:07 dubisoft-solutions