gRPC communication fails between nodejs app and peer

10/23/2019

I have a Hyperledger Fabric 1.4 network (using raft) running in a Kubernetes cluster, alongside with a nodejs application running in its own pod in the same k8s namespace. The app should communicate with a specific peer (namely peer 1 of Org1) to query and invoke chaincode.

The app is able to communicate with the CA of Org1 and I can enroll admin and register users. The problem comes when trying to reach the peer using grpcs protocol, using "node query.js") (like in fabcar tutorial for example: https://hyperledger-fabric.readthedocs.io/en/release-1.4/write_first_app.html).

On the side of the peer, the logs show the following line when the app tries to connect :

    grpc: Server.Serve failed to create ServerTransport: connection error: desc = "transport: http2Server.HandleStreams failed to receive the preface from client: read tcp 100.96.76.154:30110->100.96.75.17:58932: read: connection reset by peer"

On the side of the app, the error displayed is:

"Error: Failed to connect before the deadline URL:grpcs://blockchain-org1peer1:30110".

It seems like the error comes either from the http/2 preface, or from the reset of the connection by the peer, but I can't figure out how to fix it.

-- Skyfan
grpc
hyperledger-fabric
kubernetes

0 Answers