Hyperledger Fabric starting startFabric sh Error proposal failed err rpc error code Unavailable desc transport is closing

0 votes
I am using Hyperledger Fabric on Windows 10 when I start ./startFabric.sh file then following error is showing

 Error: proposal failed (err: rpc error: code = Unavailable desc = transport is closing)

 hyperledger Fabric v 1.3.0

 docker -v 2.0.0.0

 startFabric.sh file code is below

 #!/bin/bash # # Copyright IBM Corp All Rights Reserved # # SPDX-License-Identifier: Apache-2.0 # # Exit on first error set -e # don't rewrite paths for Windows Git Bash users export MSYS_NO_PATHCONV=1 starttime=$(date +%s) LANGUAGE=${1:-"golang"} CC_SRC_PATH=github.com/fabcar/go if [ "$LANGUAGE" = "node" -o "$LANGUAGE" = "NODE" ]; then CC_SRC_PATH=/opt/gopath/src/github.com/fabcar/node fi # clean the keystore rm -rf ./hfc-key-store # launch network; create channel and join peer to channel cd ../basic-network ./start.sh # Now launch the CLI container in order to install, instantiate chaincode # and prime the ledger with our 10 cars docker-compose -f ./docker-compose.yml up -d cli docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode install -n fabcar -v 1.0 -p "$CC_SRC_PATH" -l "$LANGUAGE" docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l "$LANGUAGE" -v 1.0 -c '{"Args":[""]}' -P "OR ('Org1MSP.member','Org2MSP.member')" sleep 10 docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode invoke -o orderer.example.com:7050 -C mychannel -n fabcar -c '{"function":"initLedger","Args":[""]}' printf "\nTotal setup execution time : $(($(date +%s) - starttime)) secs ...\n\n\n" printf "Start by installing required packages run 'npm install'\n" printf "Then run 'node enrollAdmin.js', then 'node registerUser'\n\n" printf "The 'node invoke.js' will fail until it has been updated with valid arguments\n" printf "The 'node query.js' may be run at anytime once the user has been registered\n\n"
May 21, 2020 in Blockchain by Sagar
• 180 points

edited May 21, 2020 by Sagar 3,950 views

Hey, @Sagar,

Can you clarify a few things please:

  1. gRPC version. libprotoc is not gRPC version.
  2. Is the endpoint a gRPC server as well?
  3. Is there a proxy in between.

1 answer to this question.

0 votes
  1=grpc@1.24.2

    2= i have no idea

 
    3= No
answered May 21, 2020 by Sagar
• 180 points

Hi, @Sagar,

transport is closing" error is often caused by the server closing the connection. Try to look at the server-side logging and see if there's any transport error there.

 These errors are happening extremely early in the connection. You could try setting grpc.WithWaitForHandshake in your DialOptions and see if anything else shows up in the logs. My guess is the connection was never actually valid. Are you using TLS or WithInsecure?

It can be tricky to debug this because the error happens on the client-side but the root cause of the connection being closed is on the server-side. Turn on logging on both client and server, and see if there are any transport errors.

thanku soo much for your response

Hey, @Sagar,

Glad to help you with your query doubt. If you have a query on any technology do post it in the Edureka community, We will try our best.

i got this error after executed this cmd on gitbash 

curl -sSL http://bit.ly/2ysbOFE | bash -s 1.3.0

previously hyperledger fabric worked fine but due to docker reset all images of hyperledger fabric deleted and then i execute above cmd on gitbash ,after that i execute ./startFabric.sh file then out is following

$ ./startFabric.sh                                                              
                                                                                
# don't rewrite paths for Windows Git Bash users                                
export MSYS_NO_PATHCONV=1                                                       
                                                                                
docker-compose -f docker-compose.yml down                                       
Stopping couchdb             ... done                                           
Stopping ca.example.com      ... done                                           
Stopping orderer.example.com ... done                                           
Removing peer0.org1.example.com ... done                                        
Removing couchdb                ... done                                        
Removing ca.example.com         ... done                                        
Removing orderer.example.com    ... done                                        
Removing network net_basic                                                      
                                                                                
docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com pe
er0.org1.example.com couchdb                                                    
Creating network "net_basic" with the default driver                            
Creating orderer.example.com ... done                                           
Creating couchdb             ... done                                           
Creating ca.example.com      ... done                                           
Creating peer0.org1.example.com ... done                                        
                                                                                
# wait for Hyperledger Fabric to start                                          
# incase of errors when running later commands, issue export FABRIC_START_TIMEOU
T=                                                               
export FABRIC_START_TIMEOUT=10                                                  
#echo ${FABRIC_START_TIMEOUT}                                                   
sleep ${FABRIC_START_TIMEOUT}                                                   
                                                                                
# Create the channel                                                            
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/h
yperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer cha
nnel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configt
x/channel.tx                                                                    
2020-05-21 11:17:36.092 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and
 orderer connections initialized                                                
2020-05-21 11:17:36.313 UTC [cli/common] readBlock -> INFO 002 Received block: 0
# Join peer0.org1.example.com to the channel.                                   
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/h
yperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer cha
nnel join -b mychannel.block                                                    
2020-05-21 11:17:36.584 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and
 orderer connections initialized                                                
Error: proposal failed (err: rpc error: code = Unavailable desc = transport is c
losing)

plz sir help me

my logs data is following plz tell me where am i wrong 

Usage:                                                                          
  peer channel join [flags]                                                     
                                                                                
Flags:                                                                          
  -b, --blockpath string   Path to file containing genesis block                
                                                                                
Global Flags:                                                                   
      --cafile string                       Path to file containing PEM-encoded 
trusted certificate(s) for the ordering endpoint                                
      --certfile string                     Path to file containing PEM-encoded 
X509 public key to use for mutual TLS communication with the orderer endpoint   
      --clientauth                          Use mutual TLS when communicating wi
th the orderer endpoint                                                         
      --keyfile string                      Path to file containing PEM-encoded 
private key to use for mutual TLS communication with the orderer endpoint       
      --logging-level string                Default logging level and overrides,
 see core.yaml for full syntax                                                  
  -o, --orderer string                      Ordering service endpoint           
      --ordererTLSHostnameOverride string   The hostname override to use when va
lidating the TLS connection to the orderer.                                     
      --tls                                 Use TLS when communicating with the 
orderer endpoint                                                                
  -v, --version                             Display current version of fabric pe
er server                                                                       

Hi, @Malik,

Could you please confirm that you getting any kind of error while doing this?

yes i getting error

Error: proposal failed (err: rpc error: code = Unavailable desc = transport is c
losing)

Hi, @Malik,

"transport is closing" error is often caused by the server closing the connection. Try to look at the server-side logging and see if there's any transport error more there.

Could you please post the client-side logs and server-side logs? Because there might be errors are happening extremely early in the connection.

webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP