Fabric client java exception #fabric-sdk-java


Hi ,

I was trying to submit a transaction via fabric client (java). I got the below exception:

org.hyperledger.fabric.client.EndorseException: io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason

 I am using peer version 2.4
What maybe the reason for this?

Mark Lewis

It looks like a network communication failure between your client application and the Gateway service running in the peer. If it is a transient network failure then just re-submitting might work. If it persists then you might need to investigate the cause of the network issues.

One possibility is something along the route (like a firewall or ingress controller) terminating an idle connection. In these cases, setting appropriate keep-alive values on the gRPC  channel builder when creating the client connection that you pass to the Gateway connect can be helpful. See here for details on gRPC keep-alive:


Mark Lewis

I notice that the code you mailed direct to me includes:

ManagedChannel grpcChannel = ManagedChannelBuilder.forAddress(gatewayUrl, gatewayPort)

It is typical for a deployed Fabric network to use TLS connections, whereas your code is specifying a plain HTTP connection. This might be the cause of the connection failure. See the asset-transfer-basic sample for an example of configuring a TLS connection:


Please send any follow-ups to the list, not directly to me.


It was my mistake.Instead of group reply ,I clicked on reply to author