Closed oed closed 3 years ago
Circuit needs some improved error handling, I'm seeing a few other areas we need to be catching errors.
Not sure on the underlying issues yet. Since msg.value
is undefined the read stream should have ended, so there might be a stream being opened without any request being send.
same here.. @jacobheun any updates about this issue? Thanks!!
(node:90237) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'type' of undefined
at ClassIsWrapper._onProtocol (.../node_modules/libp2p/src/circuit/index.js:46:21)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
i dont really know if that issue cause event.js
error because throw me throw er; // Unhandled 'error' event
after Rejection:
events.js:288
throw er; // Unhandled 'error' event
^
Error: connect EHOSTUNREACH 2a01:4f8:172:6c8::2:4002 - Local (:::63082)
at internalConnect (net.js:917:16)
at defaultTriggerAsyncIdScope (internal/async_hooks.js:311:12)
at net.js:1007:9
at processTicksAndRejections (internal/process/task_queues.js:79:11)
Emitted 'error' event on Socket instance at:
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'EHOSTUNREACH',
code: 'EHOSTUNREACH',
syscall: 'connect',
address: '2a01:4f8:172:6c8::2',
port: 4002
}
CC @vasco-santos
This second issue should be fixed by https://github.com/libp2p/js-libp2p-websockets/pull/118
With the upcoming libp2p@0.31
this will be fixed as with the types work the optional request value is validated before crashing on type
of undefined. Relevant change on: https://github.com/libp2p/js-libp2p/blob/v0.31.0-rc.2/src/circuit/transport.js#L61
This should be fixed with the new released we just fixed 🎉 If it is not the case, please reopen the issue
Type: Bug
Severity: Medium
Description:
We're seeing an unhandled promise rejection in the libp2p circuit code. The error looks like this:
Looking into the libp2p code it seems to be because
request
variable is undefined: https://github.com/libp2p/js-libp2p/blob/0.27.x/src/circuit/index.js#L45 Observing theStreamHandler
it appears that ifmsg.value
is undefined the method will not reach a return statement, which is likely what is causing the error: https://github.com/libp2p/js-libp2p/blob/0.27.x/src/circuit/circuit/stream-handler.js#L31-L42Looks like this code is the same in
0.28.x
.Steps to reproduce the error:
Unfortunately I don't yet know how to reproduce the issue. I've seen it a few times in our production environment.
Not really sure how sever this might be (we are currently investigating some service degradation, but this might be unrelated).