LiskArchive / lisk-sdk

🔩 Lisk software development kit
https://lisk.com
Apache License 2.0
2.72k stars 454 forks source link

Failed to register RPC methods on peer #1946

Closed ManuGowda closed 6 years ago

ManuGowda commented 6 years ago

Expected behavior

If the socket doesn't exists then it should log an error rather than trying to register RPC methods on peer.

Actual behavior

Source: /home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/api/ws/rpc/connect.js:131

          peer.socket
>>          .call(rpcProcedureName, data)
            .then(res => {
              setImmediate(rpcCallback, null, res);
Stack Trace
TypeError: Cannot read property 'call' of undefined
    at Object.peerExtendedWithRPC.rpc.(anonymous function) [as status] (/home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/api/ws/rpc/connect.js:131:7)
    at async.each (/home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/modules/peers.js:818:18)
    at /home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/node_modules/async/dist/async.js:3060:16
    at eachOfArrayLike (/home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/node_modules/async/dist/async.js:1003:9)
    at eachOf (/home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/node_modules/async/dist/async.js:1051:5)
    at Object.eachLimit (/home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/node_modules/async/dist/async.js:3122:5)
    at updatePeers (/home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/modules/peers.js:808:12)
    at /home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/node_modules/async/dist/async.js:3830:24
    at replenish (/home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/node_modules/async/dist/async.js:946:17)
    at iterateeCallback (/home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/node_modules/async/dist/async.js:931:17)
    at /home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/node_modules/async/dist/async.js:906:16
    at Immediate.<anonymous> (/home/lisk/lisk-1.0.0-beta.6-Linux-x86_64/node_modules/async/dist/async.js:3835:13)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)

Steps to reproduce

Found the issue on keymetrics: https://app.keymetrics.io/#/bucket/5ad73247b65d1e2c3c076c6a/exceptions?minutes=realtime

Which version(s) does this affect? (Environment, OS, etc...)

1.0.0

shuse2 commented 6 years ago

Sorry, I think this was caused from my test. In the current scenario, this would not happen

ManuGowda commented 6 years ago

ok, lets observer this on beta-7.0 release and we can close this issue if it doesn't happen again.

ManuGowda commented 6 years ago

Closing this issue as its no longer valid.