Hyperledger fabric Error: 14 UNAVAILABLE: TCP Write failed
Asked Answered
C

2

7

When chaincode container remains idle for some time then it stops with error:

ERROR [lib/handler.js] Chat stream with peer - on error: "Error: 14 UNAVAILABLE: EOF\n    at createStatusError (/usr/local/src/node_modules/grpc/src/client.js:64:15)\n    at ClientDuplexStream._emitStatusIfDone (/usr/local/src/node_modules/grpc/src/client.js:270:19)\n at ClientDuplexStream._receiveStatus (/usr/local/src/node_modules/grpc/src/client.js:248:8)\n    at /usr/local/src/node_modules/grpc/src/client.js:804:12"

And when the first request comes after idle time it gives an error of

Error: 14 UNAVAILABLE: TCP Write failed

After that for second request error changes to following:

Error: SERVICE_UNAVAILABLE
at ClientDuplexStream.broadcast.on (/app/node_modules/fabric-client/lib/Orderer.js:172:22)
at emitOne (events.js:116:13)
at ClientDuplexStream.emit (events.js:211:7)
at ClientDuplexStream._emitStatusIfDone (/app/node_modules/grpc/src/client.js:236:12)
at ClientDuplexStream._receiveStatus (/app/node_modules/grpc/src/client.js:213:8)
at Object.onReceiveStatus (/app/node_modules/grpc/src/client_interceptors.js:1290:15)
at InterceptingListener._callNext (/app/node_modules/grpc/src/client_interceptors.js:564:42)
at InterceptingListener.onReceiveStatus (/app/node_modules/grpc/src/client_interceptors.js:614:8)
at /app/node_modules/grpc/src/client_interceptors.js:1110:18

From third request onwards all works fine.

I was using fabric-shim 1.2.0 but after upgrading it to 1.3.0 the error appears randomly.

I am using fabric 1.3.0.

Edit: After upgrading fabric shim to 1.3.1, the error is changed to following:

error: [Orderer.js]: sendBroadcast - on error: "Error: 14 UNAVAILABLE: TCP Write failed\n    at Object.exports.createStatusError (/app/node_modules/grpc/src/common.js:87:15)\n    at ClientDuplexStream._emitStatusIfDone (/app/node_modules/grpc/src/client.js:235:26)\n    at ClientDuplexStream._receiveStatus (/app/node_modules/grpc/src/client.js:213:8)\n    at Object.onReceiveStatus (/app/node_modules/grpc/src/client_interceptors.js:1290:15)\n    at InterceptingListener._callNext (/app/node_modules/grpc/src/client_interceptors.js:564:42)\n    at InterceptingListener.onReceiveStatus (/app/node_modules/grpc/src/client_interceptors.js:614:8)\n    at /app/node_modules/grpc/src/client_interceptors.js:1110:18"
Error: SERVICE_UNAVAILABLE
    at ClientDuplexStream.broadcast.on (/app/node_modules/fabric-client/lib/Orderer.js:172:22)
    at emitOne (events.js:116:13)
    at ClientDuplexStream.emit (events.js:211:7)
    at ClientDuplexStream._emitStatusIfDone (/app/node_modules/grpc/src/client.js:236:12)
    at ClientDuplexStream._receiveStatus (/app/node_modules/grpc/src/client.js:213:8)
    at Object.onReceiveStatus (/app/node_modules/grpc/src/client_interceptors.js:1290:15)
    at InterceptingListener._callNext (/app/node_modules/grpc/src/client_interceptors.js:564:42)
    at InterceptingListener.onReceiveStatus (/app/node_modules/grpc/src/client_interceptors.js:614:8)
    at /app/node_modules/grpc/src/client_interceptors.js:1110:18
Celadon answered 23/11, 2018 at 10:58 Comment(7)
For fabric 1.3, try using fabric-shim 1.3.1 or higher version of 1.3 (if available)Namaqualand
Okay. I will try by that but is it okay to use fabric-shim 1.3.1 with fabric 1.3.0?Celadon
Yes, its fine to use that versionNamaqualand
I tried by using fabric-shim 1.3.1 but the error is still persistCeladon
@HoneyShah Did you find a solution to this problem?Oregano
@ManojPR I tried it with fabric 1.3.1, I resolved this specific issue but there is one new issue is still going. I have edited the question with new issueCeladon
@ManojPR I am still getting this error frequently. Did you find any solution?Celadon
P
0

First add your user to the docker group

sudo usermod -aG docker $USER

And then change the access permissions

sudo chmod 777 /var/run/docker.sock
Provolone answered 27/1, 2021 at 6:13 Comment(0)
R
-1

This issue seems related to grpc version change , can you try with stable grpc version

Roundhead answered 12/3, 2019 at 12:23 Comment(4)
Please keep suggestions in comments and use answers for definitive answers.Slaby
Can you please suggest how to change grpc version?Celadon
npm install grpc <grpc version >Roundhead
@kamleshnagware I haven't manually installed grpc. I mean it is inbuilt to fabric sdk.Celadon

© 2022 - 2024 — McMap. All rights reserved.