Reputation: 331
Failed to invoke successfully :: TypeError: Cannot read property 'getConnectivityState' of undefined /opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355 if(self._stream) state = self.stream.call.channel.getConnectivityState(); ^
TypeError: Cannot read property 'getConnectivityState' of undefined
at ClientDuplexStream.<anonymous> (/opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355:56)
at emitOne (events.js:116:13)
at ClientDuplexStream.emit (events.js:211:7)
at ClientDuplexStream._emitStatusIfDone (/opt/share/hyperledger/node_modules/grpc/src/client.js:236:12)
at ClientDuplexStream._readsDone (/opt/share/hyperledger/node_modules/grpc/src/client.js:201:8)
at /opt/share/hyperledger/node_modules/grpc/src/client_interceptors.js:705:15
I am using latest version of pre-requisites as mentioned in below link:
http://hyperledger-fabric.readthedocs.io/en/release-1.1/getting_started.html#install-prerequisites
Can anybody tell me where am i going wrong?
Upvotes: 1
Views: 2116
Reputation: 55
I was trying to connect the composer bna to IBM blockchain, and I tried out installing grpc 1.9.1.. and even 1.10.1.. I tried out like everything, and the only thing that worked was doing as Kataus suggested, I commented out the lines relate to the getConnectivity state, and it finally connected to the IBM blockchain network I had.
Upvotes: 0
Reputation: 161
Faced the same issue while building the web docker edit package.json add the line "dependencies": { "grpc" : "1.9.1",
build the docker again issue the docker compose agin ! it works
Upvotes: 0
Reputation: 35
I'm still getting below error after commenting the line in EventHub.js
Failed to invoke successfully :: TypeError: Cannot read property 'getConnectivityState' of undefined
Previous detailed error:
TypeError: Cannot read property 'getConnectivityState' of undefined at ClientDuplexStream. (/fabric-samples/fabcar/node_modules/fabric-client/lib/EventHub.js:308:56) at emitOne (events.js:116:13) at ClientDuplexStream.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at ClientDuplexStream.Readable.push (_stream_readable.js:208:10) at Object.onReceiveMessage (/fabric-samples/fabcar/node_modules/grpc/src/client_interceptors.js:1302:19) at InterceptingListener.recvMessageWithContext (/fabric-samples/fabcar/node_modules/grpc/src/client_interceptors.js:629:19) at /fabric-samples/fabcar/node_modules/grpc/src/client_interceptors.js:728:14
Upvotes: 0
Reputation: 331
Yes, this is due to a new version of grpc released 3 days ago (v1.11.0). The version is controlled by fabric-client and it takes the latest available. You need to delete the grpc module and reinstall it with npm install [email protected]
. This will fix the issue. Going forward you may need to have grpc fixed at 1.9.1 in your package.json until Hyperledger resolve this issue.
Reference: https://chat.hyperledger.org/channel/general?msg=FME6aDfnfMexWTm6g
Upvotes: 4
Reputation: 1
I commented these lines in EventHub.js
.
It's required only for state log.
For example:
<br/>
<i> var state = -1;<br/>
//if(self._stream) state = self._stream.call.channel_.getConnectivityState();<br/>
logger.debug('on.data - grpc stream state :%s',state);<br/>
</i><br/><br/>
it works fine now.
Upvotes: 0