socketcluster icon indicating copy to clipboard operation
socketcluster copied to clipboard

Socket Connect Error: Unknown request

Open happilymarrieddad opened this issue 5 years ago • 3 comments

Hello, I've been trying to dockerize a really old socketcluster app that we have here and it keeps trying to connect to some other service... I can't find in the code where this is happening. Is there a way to show what endpoint it is trying to connect to? I think if I knew what it was trying to do then it would be a lot easier to diagnosis where this is failing. Thanks!

{ SocketProtocolError: Socket hung up
    at SCClientSocket._onSCClose (/app/node_modules/socketcluster-client/lib/scclientsocket.js:654:15)
    at SCTransport.<anonymous> (/app/node_modules/socketcluster-client/lib/scclientsocket.js:304:12)
    at SCTransport.Emitter.emit (/app/node_modules/component-emitter/index.js:133:20)
    at SCTransport._onClose (/app/node_modules/socketcluster-client/lib/sctransport.js:217:28)
    at WebSocket.SCTransport.wsSocket.onerror (/app/node_modules/socketcluster-client/lib/sctransport.js:81:12)
    at WebSocket.onError (/app/node_modules/socketcluster-client/node_modules/ws/lib/event-target.js:128:16)
    at emitOne (events.js:116:13)
    at WebSocket.emit (events.js:211:7)
    at ClientRequest.req.on (/app/node_modules/socketcluster-client/node_modules/ws/lib/websocket.js:535:10)
    at emitOne (events.js:116:13)
  name: 'SocketProtocolError',
  message: 'Socket hung up',
  code: 1006 }

happilymarrieddad avatar Jul 02 '19 18:07 happilymarrieddad

Maybe something like `Attempted to connect to 'some DNS.com' or something like that.

happilymarrieddad avatar Jul 02 '19 18:07 happilymarrieddad

@happilymarrieddad Socket hung up can also happen on sudden disconnect; not only for failed connect attempts. But I guess it might help to improve the error message to give more details about the host/port.

In the meantime you can use socket.options to check where it was trying to connect. There should the the hostname and port in there.

jondubois avatar Jul 02 '19 18:07 jondubois

ok cool thanks!

happilymarrieddad avatar Jul 03 '19 18:07 happilymarrieddad