Hyperledger Fabric v1 : Error connecting to orderer:7050 due to grpc: timed out when dialing

error: failed to create deliver client: orderer client failed to connect to
hyperledger fabric docker
hyperledger fabric container
hyperledger fabric tutorial github
install hyperledger fabric ubuntu
make sure the chaincode tutorial network has been successfully instantiated
github com hyperledger fabric samples
hyperledger fabric bootstrap

I'm trying to test the latest version of Hyperledger Fabric, the v1 in incubation. I have an issue with the latest version of Hyperledger Fabric.

I'm following the instructions here to install Fabric: https://hyperledger-fabric.readthedocs.io/en/latest/asset_setup/

I'm using Docker to spawn network entities & create/join a channel :

sudo docker --version Docker version 1.13.1, build 092cba3

sudo docker-compose --version docker-compose version 1.11.2, build dfed245

When I'm performing :

sudo docker-compose -f docker-compose-gettingstarted.yml up

My five containers are running :

CONTAINER ID        IMAGE                                                          COMMAND                  CREATED             STATUS              PORTS                                            NAMES
f1b6d6128d43        sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0      "sh -c './channel_..."   21 minutes ago      Up About a minute                                                    cli
8f9df755c160        sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0      "peer node start -..."   21 minutes ago      Up About a minute   0.0.0.0:8056->7051/tcp                           peer2
2de6ee624d28        sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0      "peer node start -..."   21 minutes ago      Up About a minute   0.0.0.0:8055->7051/tcp                           peer1
31ac53b6e5db        sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0      "peer node start -..."   21 minutes ago      Up About a minute   0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp   peer0
d98fc2a8652f        sfhackfest22017/fabric-ca:x86_64-0.7.0-snapshot-6294c57        "sh -c 'sleep 10; ..."   21 minutes ago      Up About a minute   0.0.0.0:8054->7054/tcp                           ca
07dcfceb86cc        sfhackfest22017/fabric-orderer:x86_64-0.7.0-snapshot-c7b3fe0   "orderer"                21 minutes ago      Up About a minute   0.0.0.0:8050->7050/tcp                           orderer

but I get this error on the last line :

 2017-03-01 14:55:32.183 UTC [msp] newIdentity -> INFO 016 Creating identity instance for ID &{DEFAULT IDENTITY}
cli               | 2017-03-01 14:55:32.270 UTC [peer] GetManagerForChain -> INFO 017 Created new msp manager for chain testchainid
cli               | 2017-03-01 14:55:32.270 UTC [msp] Setup -> INFO 018 Setting up the MSP manager (1 msps)
cli               | 2017-03-01 14:55:32.270 UTC [msp] Setup -> INFO 019 Setting up MSP
cli               | 2017-03-01 14:55:32.270 UTC [msp] NewBccspMsp -> INFO 01a Creating BCCSP-based MSP instance
cli               | 2017-03-01 14:55:32.270 UTC [msp] Setup -> INFO 01b Setting up MSP instance DEFAULT
cli               | 2017-03-01 14:55:32.270 UTC [msp] newIdentity -> INFO 01c Creating identity instance for ID &{DEFAULT IDENTITY}
cli               | 2017-03-01 14:55:32.270 UTC [msp] newIdentity -> INFO 01d Creating identity instance for ID &{DEFAULT IDENTITY}
cli               | 2017-03-01 14:55:32.271 UTC [msp] newIdentity -> INFO 01e Creating identity instance for ID &{DEFAULT IDENTITY}
cli               | 2017-03-01 14:55:32.271 UTC [msp] newIdentity -> INFO 01f Creating identity instance for ID &{DEFAULT IDENTITY}
cli               | 2017-03-01 14:55:32.275 UTC [msp] newIdentity -> INFO 020 Creating identity instance for ID &{DEFAULT IDENTITY}
cli               | 2017-03-01 14:55:32.275 UTC [msp] newIdentity -> INFO 021 Creating identity instance for ID &{DEFAULT IDENTITY}
cli               | 2017-03-01 14:55:32.275 UTC [msp] newIdentity -> INFO 022 Creating identity instance for ID &{DEFAULT IDENTITY}
cli               | 2017-03-01 14:55:32.275 UTC [msp] Setup -> INFO 023 MSP manager setup complete, setup 1 msps
cli               | 2017-03-01 14:55:32.275 UTC [logging] InitFromViper -> DEBU 024 Setting default logging level to DEBUG for command 'channel'
cli               | 2017-03-01 14:55:32.275 UTC [peer] GetLocalMSP -> INFO 025 Returning existing local MSP
cli               | 2017-03-01 14:55:32.275 UTC [msp] GetDefaultSigningIdentity -> INFO 026 Obtaining default signing identity
cli               | Error: Error getting broadcast client: Error connecting to orderer:7050 due to grpc: timed out when dialing

How can I fix it ?

And when I perform :

sudo docker exec -it cli bash
[sudo] Mot de passe de blockchain : 
root@f1b6d6128d43:/opt/gopath/src/github.com/hyperledger/fabric/peer# cat results.txt
ERROR on CHANNEL CREATION

Here is my Docker_compose.yml :

version: '2'
networks:
   bridge:

services:

  ccenv_latest:
    container_name: ccenv_latest
    build: ./ccenv
    image: hyperledger/fabric-ccenv:latest
    volumes:
        - ./ccenv:/opt/gopath/src/github.com/hyperledger/fabric/orderer/ccenv

  ccenv_snapshot:
    container_name: ccenv_snapshot
    build: ./ccenv
    image: hyperledger/fabric-ccenv:x86_64-0.7.0-snapshot-c7b3fe0
    volumes:
        - ./ccenv:/opt/gopath/src/github.com/hyperledger/fabric/orderer/ccenv

  ca:
    image: sfhackfest22017/fabric-ca:x86_64-0.7.0-snapshot-6294c57
    ports:
      - 8054:7054
    environment:
      - CA_CERTIFICATE=peerOrg0_cert.pem
      - CA_KEY_CERTIFICATE=peerOrg0_pk.pem
    volumes:
        - ./tmp/ca:/.fabric-ca
    command: sh -c 'sleep 10; fabric-ca server start -ca /.fabric-ca/$$CA_CERTIFICATE -ca-key /.fabric-ca/$$CA_KEY_CERTIFICATE -config /etc/hyperledger/fabric-ca/server-config.json -address "0.0.0.0"'
    container_name: ca


  orderer:
    container_name: orderer
    image: sfhackfest22017/fabric-orderer:x86_64-0.7.0-snapshot-c7b3fe0
    environment:
      - ORDERER_GENERAL_LEDGERTYPE=ram
      - ORDERER_GENERAL_BATCHTIMEOUT=10s
      - ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10
      - ORDERER_GENERAL_MAXWINDOWSIZE=1000
      - ORDERER_GENERAL_ORDERERTYPE=solo
      - ORDERER_GENERAL_LOGLEVEL=debug
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_LISTENPORT=7050
      - ORDERER_RAMLEDGER_HISTORY_SIZE=100
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
    command: orderer
    ports:
      - 8050:7050
    networks:
      - bridge

  peer0:
    container_name: peer0
    image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
    environment:
      - CORE_PEER_ADDRESSAUTODETECT=true
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_LOGGING_LEVEL=DEBUG
      - CORE_PEER_NETWORKID=peer0
      - CORE_NEXT=true
      - CORE_PEER_ENDORSER_ENABLED=true
      - CORE_PEER_ID=peer0
      - CORE_PEER_PROFILE_ENABLED=true
      - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
      - CORE_PEER_GOSSIP_ORGLEADER=true
      - CORE_PEER_GOSSIP_IGNORESECURITY=true

    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer

    command: peer node start --peer-defaultchain=false
    ports:
      - 8051:7051
      - 8053:7053
    links:
      - orderer:orderer
    volumes:
        - /var/run/:/host/var/run/
        - ./tmp/peer0:/etc/hyperledger/fabric/msp/sampleconfig
    networks:
      - bridge

  peer1:
    container_name: peer1
    image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
    environment:
      - CORE_PEER_ADDRESSAUTODETECT=true
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_LOGGING_LEVEL=DEBUG
      - CORE_PEER_NETWORKID=peer0
      - CORE_NEXT=true
      - CORE_PEER_ENDORSER_ENABLED=true
      - CORE_PEER_ID=peer1
      - CORE_PEER_PROFILE_ENABLED=true
      - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
      - CORE_PEER_GOSSIP_ORGLEADER=true
      - CORE_PEER_GOSSIP_IGNORESECURITY=true
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    ports:
      - 8055:7051
    command: peer node start --peer-defaultchain=false
    links:
      - orderer:orderer
      - peer0:peer0
    volumes:
        - /var/run/:/host/var/run/
        - ./tmp/peer1:/etc/hyperledger/fabric/msp/sampleconfig
    networks:
      - bridge

  peer2:
    container_name: peer2
    image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
    environment:
      - CORE_PEER_ADDRESSAUTODETECT=true
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_LOGGING_LEVEL=DEBUG
      - CORE_PEER_NETWORKID=peer0
      - CORE_NEXT=true
      - CORE_PEER_ENDORSER_ENABLED=true
      - CORE_PEER_ID=peer2
      - CORE_PEER_PROFILE_ENABLED=true
      - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
      - CORE_PEER_GOSSIP_ORGLEADER=true
      - CORE_PEER_GOSSIP_IGNORESECURITY=true
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer

    ports:
      - 8056:7051
    command: peer node start --peer-defaultchain=false
    links:
      - orderer:orderer
      - peer0:peer0
      - peer1:peer1
    volumes:
        - /var/run/:/host/var/run/
        - ./tmp/peer2:/etc/hyperledger/fabric/msp/sampleconfig
    networks:
      - bridge

  cli:
    container_name: cli
    image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
    tty: true
    environment:
      - GOPATH=/opt/gopath
      - CORE_PEER_ADDRESSAUTODETECT=true
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_LOGGING_LEVEL=DEBUG
      - CORE_NEXT=true
      - CORE_PEER_ID=cli
      - CORE_PEER_ENDORSER_ENABLED=true
      - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
      - CORE_PEER_ADDRESS=peer0:7051
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: sh -c './channel_test.sh; sleep 10000'
#   command: /bin/sh
    links:
      - orderer:orderer
      - peer0:peer0
      - peer1:peer1
      - peer2:peer2
    volumes:
        - /var/run/:/host/var/run/
        #in the "- <HOST>:/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part
        #should be modified to the path on the host. This will work as is in the Vagrant environment
        - ./src/github.com/example_cc/example_cc.go:/opt/gopath/src/github.com/hyperledger/fabric/examples/example_cc.go
        - ./tmp/peer3:/etc/hyperledger/fabric/msp/sampleconfig
        - ./channel_test.sh:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel_test.sh
    networks:
      - bridge

And this is my channel_test.sh :

#!/bin/sh

# find address of peer0 in your network
PEER0_IP_ADDRESS=`perl -e 'use Socket; $a = inet_ntoa(inet_aton("peer0")); print "$a\n";'`

# create an anchor file
cat<<EOF>anchorPeer.txt
$PEER0_IP_ADDRESS
7051
-----BEGIN CERTIFICATE-----
MIICjDCCAjKgAwIBAgIUBEVwsSx0TmqdbzNwleNBBzoIT0wwCgYIKoZIzj0EAwIw
fzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNh
biBGcmFuY2lzY28xHzAdBgNVBAoTFkludGVybmV0IFdpZGdldHMsIEluYy4xDDAK
BgNVBAsTA1dXVzEUMBIGA1UEAxMLZXhhbXBsZS5jb20wHhcNMTYxMTExMTcwNzAw
WhcNMTcxMTExMTcwNzAwWjBjMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGgg
Q2Fyb2xpbmExEDAOBgNVBAcTB1JhbGVpZ2gxGzAZBgNVBAoTEkh5cGVybGVkZ2Vy
IEZhYnJpYzEMMAoGA1UECxMDQ09QMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE
HBuKsAO43hs4JGpFfiGMkB/xsILTsOvmN2WmwpsPHZNL6w8HWe3xCPQtdG/XJJvZ
+C756KEsUBM3yw5PTfku8qOBpzCBpDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYw
FAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFOFC
dcUZ4es3ltiCgAVDoyLfVpPIMB8GA1UdIwQYMBaAFBdnQj2qnoI/xMUdn1vDmdG1
nEgQMCUGA1UdEQQeMByCCm15aG9zdC5jb22CDnd3dy5teWhvc3QuY29tMAoGCCqG
SM49BAMCA0gAMEUCIDf9Hbl4xn3z4EwNKmilM9lX2Fq4jWpAaRVB97OmVEeyAiEA
25aDPQHGGq2AvhKT0wvt08cX1GTGCIbfmuLpMwKQj38=
-----END CERTIFICATE-----
EOF

#create
echo "Creating channel on Orderer"
CORE_PEER_GOSSIP_IGNORESECURITY=true CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 -a anchorPeer.txt >>log.txt 2>&1
cat log.txt
   grep -q "Exiting" log.txt
   if [ $? -ne 0 ]; then
      echo "ERROR on CHANNEL CREATION" >> results.txt
      exit 1
   fi
echo "SUCCESSFUL CHANNEL CREATION" >> results.txt
sleep 5
TOTAL_PEERS=3
i=0
while test $i -lt $TOTAL_PEERS  
do
echo "###################################### Joining peer$i"
CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 CORE_PEER_ADDRESS=peer$i:7051 peer channel join -b myc1.block >>log.txt 2>&1
cat log.txt
echo '-------------------------------------------------'
grep -q "Join Result: " log.txt
   if [ $? -ne 0 ]; then
      echo "ERROR on JOIN CHANNEL" >> results.txt
      exit 1
   fi
echo "SUCCESSFUL JOIN CHANNEL on PEER$i" >> results.txt
echo "SUCCESSFUL JOIN CHANNEL on PEER$i"
i=$((i+1))
sleep 10
done
echo "Peer0 , Peer1 and Peer2 are added to the channel myc1"
cat log.txt
exit 0

i faced similar problem and found it’s DNS issue then corrected at "hosts" file. the cause is the hostname "orderer". FYR.

Error: Error getting broadcast client: Error connecting to orderer , Hyperledger Fabric v1 : Error connecting to orderer:7050 due to grpc: timed out when dialing - hyperledger. Bootstrapping Hyperledger Fabric fails for two builds due to the following error, FAB-4773: Fetching of a channel genesis block bootstrap.Bootstrapping Hyperledger Fabric.

What OS you are using? I had the same issue running this getting started guide with VirtualBox running Ubuntu 16.04 LTS on Windows 7. After that I tried installing Ubuntu side-by-side with Windows and it worked from the first shot.

Blockchain Hyperledger Fabric, client: Error connecting to orderer:7050 due to grpc: timed out when dialing instantiate -v 1.0 -n test_cc -p github.com/hyperledger/fabric I've seen this issue in versions from the v1.0.0-alpha to the latest master code: launching the peer in production mode in the Vagrant VM, it can't find the orderer. I get errors like this: 2017-04-13 19:04:31.566 UTC [ConnProducer] NewConnection -> ERRO 038 Failed connecting to orderer:7050 , error: grpc: timed out when dialing

May be because of docker containers are in the different container .

If the new organization in the different network the peers can not communicate with Orderer which is in the other network.

check the networks : docker network ls

Peer can't find orderer when running in prod , please note that, I have faced “n” number of errors while I was working in client: orderer client failed to connect to orderer.example.com:7050: failed to Solution: You are trying to run fabric v1.1, but it pulls out fabric v1.2 Solutions: This error mostly would occur due to the fact that, chaincode would grpc: addrConn. please note that, I have faced “n” number of errors while I was working in Blockchain project, I have spent countless hours reading out articles, reaching out experts to fix the same. This

Hyperledger peer start node, Component/s: fabric-peer. Labels: None. Description. Issue. I've seen this issue in versions from the v1.0.0-alpha to the latest master connecting to orderer:​7050 , error: grpc: timed out when dialing Thanks in advance. we have created a network of peers and one orderer. we are trying to create a channel from a CLI container (not a peer node). we have initialized the msp folder with credentials of an admin. also we have copied the orderer's ca chainfile (ord-ca-chain.pem) to the container. we also set FABRIC_CFG_PATH to current dir.

Building Your First Network - Hyperledger Fabric Docs, this problem, i will suggest you to check the following things : you should expose the port 7050 with the option "-p" when you start the orderer. core_peer_committer_ledger_orderer=orderer:5005 But in configtx.yaml it was not updated Orderer: &OrdererDefaults # Orderer Type: The orderer implementation to start.

Deploying to a single organization Hyperledger Fabric, Generating certs and genesis block for channel 'mychannel' with CLI timeout of '​10' Transactions and communications within Hyperledger Fabric are signed by an entity's peer chaincode instantiate -o orderer.example.com:7050 --tls --cafile Error connecting: rpc error: code = 14 desc = grpc: RPC failed fast due to  Hello, In this article I wanted to share some of the errors you might face & the possible solutions. please note that, I have faced “n” number of errors while I was working in Blockchain project, I have spent countless hours reading out articles, reaching out experts to fix the same.

Comments
  • I'm stuck at the very same problem. Could you solve it? Would appreciate your insights.
  • Did you find a solution for this ?