morpheus
morpheus

Reputation: 20290

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?

Upvotes: 3

Views: 1160

Answers (2)

Badr Bellaj
Badr Bellaj

Reputation: 12821

This error can be caused by a wrong peer port or unreachable one. If you face such error try to change the used port

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::7051

Another reason is if you are running docker you'll need to check if containers are on the same network and if COMPOSE_PROJECT_NAME is set since

- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_test

Last Note: This can happen if no free disk is available so check! df -h

Upvotes: 0

morpheus
morpheus

Reputation: 20290

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" 

Upvotes: 1

Related Questions