hyperledger-fabric

Hyperledger Fabric: ERROR [lib/handler.js] Chat stream with peer - on error: "Error: 14 UNAVAILABLE: EOF\n at createStatusError


Per this link, we are trying to run nodejs chaincode in dev mode using following command from inside a docker container

CORE_PEER_TLS_ENABLED=false CORE_CHAINCODE_LOGLEVEL=debug CORE_CHAINCODE_ID_NAME="mycc:1.0" /usr/local/bin/node --inspect chaincode.js --peer.address peer1-jnj:7052

but get this error:

2018-12-31T21:32:51.807Z INFO [lib/chaincode.js] Registering with peer peer1-jnj:7052 as chaincode "mycc:1.0" 
2018-12-31T21:32:51.814Z 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" 

What is wrong here and how can we fix it?


Solution

  • The issue here was that we had TLS enabled on the peers. CORE_PEER_TLS_ENABLED=true on the peer node. Only when we disabled TLS completely did it work.

    ##### 2019-01-03 23:34:35 CORE_PEER_TLS_ENABLED=false CORE_CHAINCODE_LOGLEVEL=debug CORE_CHAINCODE_ID_NAME="mycc:1.0" /usr/local/bin/node --inspect chaincode.js --peer.address peer1-jnj:7052
    Debugger listening on ws://127.0.0.1:9229/5e03e0d1-08c4-48f5-b08f-7fb62e76bf70
    For help see https://nodejs.org/en/docs/inspector
    2019-01-03T23:34:35.796Z INFO [lib/chaincode.js] Registering with peer peer1-jnj:7052 as chaincode "mycc:1.0" 
    2019-01-03T23:34:35.804Z INFO [lib/handler.js] Successfully registered with peer node. State transferred to "established" 
    2019-01-03T23:34:35.805Z INFO [lib/handler.js] Successfully established communication with peer node. State transferred to "ready"