I have a hyperledger fabric network deployed in GCP. I use fabric node sdk to communicate to the network.
When there's no activity between sdk and network, If i try to invoke the chaincode, the API call fails at sendTransaction to the Orderer with below logs.
error: [Orderer.js]: sendBroadcast - on error: "Error: 14 UNAVAILABLE: TCP Read failed\n at createStatusError (/usr/src/app/node_modules/grpc/src/client.js:64:15)\n at ClientDuplexStream._emitStatusIfDone (/usr/src/app/node_modules/grpc/src/client.js:270:19)\n at ClientDuplexStream._receiveStatus (/usr/src/app/node_modules/grpc/src/client.js:248:8)\n at /usr/src/app/node_modules/grpc/src/client.js:804:12" Request failed: POST /channels/stanfinandcredth/chaincodes/sc1547746253: SERVICE_UNAVAILABLE Error: SERVICE_UNAVAILABLE at ClientDuplexStream. (/usr/src/app/node_modules/fabric-client/lib/Orderer.js:136:21) at emitOne (events.js:116:13) at ClientDuplexStream.emit (events.js:211:7) at ClientDuplexStream._emitStatusIfDone (/usr/src/app/node_modules/grpc/src/client.js:271:12) at ClientDuplexStream._receiveStatus (/usr/src/app/node_modules/grpc/src/client.js:248:8) at /usr/src/app/node_modules/grpc/src/client.js:804:12 Error: SERVICE_UNAVAILABLE at ClientDuplexStream. (/usr/src/app/node_modules/fabric-client/lib/Orderer.js:136:21) at emitOne (events.js:116:13) at ClientDuplexStream.emit (events.js:211:7) at ClientDuplexStream._emitStatusIfDone (/usr/src/app/node_modules/grpc/src/client.js:271:12) at ClientDuplexStream._receiveStatus (/usr/src/app/node_modules/grpc/src/client.js:248:8) at /usr/src/app/node_modules/grpc/src/client.js:804:12
It seems that SDK is not able to reach to Orderer. The immediate next invoke request succeeds. this happens eerytime after idle time of 15 mins.
I tried setting grpc timeouts for the connection but it doesn't seem to help.