fabric-sdk-node icon indicating copy to clipboard operation
fabric-sdk-node copied to clipboard

gRPC connection drop in fabric-nodejs

Open tittuvarghese opened this issue 2 years ago • 9 comments

When I use fabric node sdk for invokes, at times getting the below connection drop errors and during retry it's getting executed without any issues.

2023-01-12T12:25:49.557Z - error: [Endorser]: sendProposal[peer2-org1.example.com:30002] - Received error response from: grpcs://peer2-org1.example.com:30002 error: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.557Z - error: [Endorser]: sendProposal[peer2-org1.example.com:30002] - rejecting with: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.558Z - error: [Endorser]: sendProposal[peer3-org0.example.com:30002] - Received error response from: grpcs://peer3-org0.example.com:30002 error: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.558Z - error: [Endorser]: sendProposal[peer3-org0.example.com:30002] - rejecting with: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.558Z - error: [Endorser]: sendProposal[peer3-org2.example.com:30002] - Received error response from: grpcs://peer3-org2.example.com:30002 error: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.558Z - error: [Endorser]: sendProposal[peer3-org2.example.com:30002] - rejecting with: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.558Z - error: [Endorser]: sendProposal[peer3-org1.example.com:30002] - Received error response from: grpcs://peer3-org1.example.com:30002 error: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.558Z - error: [Endorser]: sendProposal[peer3-org1.example.com:30002] - rejecting with: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.559Z - error: [Endorser]: sendProposal[peer2-org0.example.com:30002] - Received error response from: grpcs://peer2-org0.example.com:30002 error: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.559Z - error: [Endorser]: sendProposal[peer2-org0.example.com:30002] - rejecting with: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.559Z - error: [Endorser]: sendProposal[peer4-org2.example.com:30002] - Received error response from: grpcs://peer4-org2.example.com:30002 error: Error: 14 UNAVAILABLE: Connection dropped 2023-01-12T12:25:49.559Z - error: [Endorser]: sendProposal[peer4-org2.example.com:30002] - rejecting with: Error: 14 UNAVAILABLE: Connection dropped peer=peer2-org0.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer3-org0.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer3-org1.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer2-org1.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer3-org2.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer4-org2.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer2-org0.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer3-org0.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer3-org1.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer2-org1.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer3-org2.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped peer=peer4-org2.example.com:30002, status=grpc, message=14 UNAVAILABLE: Connection dropped

tittuvarghese avatar Jan 13 '23 07:01 tittuvarghese

It might be the connections to the peers are being closed by something along the network path (like an ingress controller or firewall) if they are idle too long. If this is the case, configure appropriate gRPC keep-alive settings for your environment:

  • https://hyperledger.github.io/fabric-sdk-node/release-2.2/tutorial-grpc-settings.html
  • https://github.com/grpc/grpc/blob/master/doc/keepalive.md

bestbeforetoday avatar Jan 13 '23 12:01 bestbeforetoday

it is passing through HAProxy and Nginx Ingress controller. Whenever connection drop happens, it drops for all peers in same time.

tittuvarghese avatar Jan 17 '23 05:01 tittuvarghese

it is passing through HAProxy and Nginx Ingress controller. Whenever connection drop happens, it drops for all peers in same time.

tittuvarghese avatar Jan 17 '23 05:01 tittuvarghese

it is passing through HAProxy and Nginx Ingress controller. Whenever connection drop happens, it drops for all peers in same time.

tittuvarghese avatar Jan 17 '23 05:01 tittuvarghese

I am facing the same issue and no firewall is used

Ethereumx avatar Jan 25 '23 14:01 Ethereumx

Is this an issue that has only started occurring after picking up a newer Node SDK version? If so, do you know the versions that worked and the one that is demonstrating problems? If not, do configuring appropriate keepalive settings solve it?

bestbeforetoday avatar Jan 25 '23 15:01 bestbeforetoday

@tittuvarghese Did you have any luck solving the disconnection issues by configuring appropriate keep-alive and related gRPC settings?

bestbeforetoday avatar Feb 28 '23 12:02 bestbeforetoday

@bestbeforetoday I started getting stable connection after removing Haproxy from the connection path (tried different configs in haproxy but nothing worked out).

But sill I observe some drop connections / commit failures randomly at the orderer level. (This started coming when we distributed the orderer geographically. (between two different region with in the country))

tittuvarghese avatar Mar 05 '23 18:03 tittuvarghese

Are there any settings for HTTP/2 connections, such as load balancer sticky sessions?

Regarding Haproxy, you have to adjust your "timeout client" and "timeout server" as well as the keep-alive settings.

filipeandre avatar Jun 13 '24 07:06 filipeandre