metarhia / metarhia/Example

Remote: Unhandled error

Open
#107 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
211
Forks
82
PR merge metrics
No merged PRs in 30d

Description

OS: BigSur 11.2.3
node v15.14.0

19:05:21  W2   info    Listen port 8001 in worker 2
19:05:21  W1   info    Listen port 8000 in worker 1
19:05:21  W3   info    Listen port 8002 in worker 3
19:05:21  W1   debug   Start example plugin
19:05:21  W1   debug   { set: { key: 'keyName', val: 100 } }
19:05:21  W1   debug   { get: 'keyName', return: 100 }
19:05:21  W1   debug   { res: 100, cache: undefined }
19:05:21  W1   debug   Connect to redis
19:05:21  W1   debug   Connect to pg
19:05:21  W1   warn    No redis service detected, so quit client
19:05:21  W1   debug   Connect to metacom
19:05:22  W5   error   Error [ERR_UNHANDLED_ERROR]: Unhandled error. (ErrorEvent {
  target: WebSocket {
    _events: [Object: null prototype] { message: [Function], error: [Array] },
    _eventsCount: 2,
    _maxListeners: undefined,
    _binaryType: 'nodebuffer',
    _closeCode: 1006,
    _closeFrameReceived: false,
    _closeFrameSent: false,
    _closeMessage: '',
    _closeTimer: null,
    _extensions: {},
    _protocol: '',
    _readyState: 2,
    _receiver: null,
    _sender: null,
    _socket: null,
    _bufferedAmount: 0,
    _isServer: false,
    _redirects: 0,
    _url: 'ws://localhost:8001',
    _req: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 5,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: true,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: true,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [Socket],
      _header: 'GET / HTTP/1.1\r\n' +
        'Sec-WebSocket-Version: 13\r\n' +
        'Sec-WebSocket-Key: a3Nqj19jf3Be5inH15p34Q==\r\n' +
        'Connection: Upgrade\r\n' +
        'Upgrade: websocket\r\n' +
        'Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\r\n' +
        'Host: localhost:8001\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: {},
      agent: undefined,
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/',
      _ended: false,
      res: [IncomingMessage],
      aborted: true,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: [HTTPParser],
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'localhost',
      protocol: 'http:',
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(kError)]: undefined
    },
    [Symbol(kCapture)]: false
  },
  type: 'error',
  message: 'Unexpected server response: 200',
  error: Error: Unexpected server response: 200
    ClientRequest.<anonymous> (/node_modules/ws/lib/websocket.js:604:7)
    ClientRequest.emit (node:events:369:20)
    HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:646:27)
    HTTPParser.parserOnHeadersComplete (node:_http_common:129:17)
    Socket.socketOnData (node:_http_client:512:22)
    Socket.emit (node:events:369:20)
    addChunk (node:internal/streams/readable:313:12)
    readableAddChunk (node:internal/streams/readable:288:9)
    Socket.Readable.push (node:internal/streams/readable:227:10)
    TCP.onStreamRead (node:internal/stream_base_commons:190:23)
})
  new NodeError (node:internal/errors:329:5)
  Metacom.emit (node:events:358:17)
  WebSocket.<anonymous> (/node_modules/metacom/lib/client.js:59:12)
  WebSocket.onError (/node_modules/ws/lib/event-target.js:140:16)
  WebSocket.emit (node:events:381:22)
  abortHandshake (/node_modules/ws/lib/websocket.js:722:15)
  ClientRequest.<anonymous> (/node_modules/ws/lib/websocket.js:604:7)
  ClientRequest.emit (node:events:369:20)
  HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:646:27)
  HTTPParser.parserOnHeadersComplete (node:_http_common:129:17)
user@MacBook-Air Example % 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with macOS Big Sur, Node v15.14.0, and the logged services, then start in node_modules/metacom/lib/client.js and follow the WebSocket error path into ws/lib/websocket.js. Determine why the connection to ws://localhost:8001 receives HTTP 200 and triggers an unhandled error; done means the failure is handled or the connection succeeds without the reported exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.