Welcome to the Linux Foundation Forum!

transport: error while dialing: dial tcp 127.0.0.1:7050: connect: connection refused

Hi, I started the official course about Hyperledger Fabric Developer, but when I run ./network.sh up createChannel -ca -s couchdb I get the following error:

  1. Error: failed to create deliver client for orderer: orderer client failed to connect to localhost:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:7050: connect: connection refused"
  2. Channel creation failed

I am running it from Ubuntu 20.04 in WSL2 (Windows).
Did anybody already face this problem? Any idea how to fix it?

Thank you!

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • Posts: 3

    OK never mind I found the cause. The instructions say to run ./network.sh up createChannel -ca -s couchdb, but instead I tried to run first ./network.sh up and then ./network.sh createChannel -ca -s couchdb.

  • Posts: 193

    Hello @alebaffa, Great to see you were able to determine the issue, Keep Learning!

  • Posts: 2
    edited September 2021

    Hi, I am getting the exact same error, but unfortunately it wasn't resolved by running the "up" and "createChannel" commands separately. If anyone has any ideas then please let me know.

  • Posts: 193

    @drcirculor,
    Hello, Let's see if we can figure this out. This error usually occurs when one of the dependencies is out of sync. Please go back and check the versions of the dependencies, especially Docker. Let me know if this helps. Bobbi

  • Posts: 2
    edited September 2021

    Thanks @Bobbijn

    Yes, you were right - I noticed this error when I brought up the network, "Local fabric binaries and docker images are out of sync."
    I ended up deleting the "fabric" and "fabric-samples" folders from "~/go/src/github.com/hyperledger", then repeating the curl and git steps in the "Hyperledger Fabric samples, binaries, and Docker images" section.
    The network startup and channel creation worked fine after that.

    Thanks for your help.

  • Posts: 1

    @drcirculor shukran yoh...had gotten stuck there for a couple of hours.

  • I am still having this issue:

    - My installation is on stand alone machine.- running Ubuntu 20.04.4

    I have verified the dependencies (we can add versions here) and running the correct command, but 

    - docker --version

    Docker version 20.10.13, build a224086

    - docker-compose --version 

    docker-compose version 1.25.0, build unknown

    For the last step, (running as a root)

    cd ~/go/src/github.com/hyperledger/fabric-samples/test-network/

    ./network.sh up createChannel -ca -s couchdb

    Creating channel 'mychannel'.

    If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'couchdb 

    Generating channel create transaction 'mychannel.tx'

    + configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/mychannel.tx -channelID mychannel

    2022-03-14 22:22:36.335 EDT [common.tools.configtxgen] main -> INFO 001 Loading configuration

    2022-03-14 22:22:36.376 EDT [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /root/go/src/github.com/hyperledger/fabric-samples/test-network/configtx/configtx.yaml

    2022-03-14 22:22:36.376 EDT [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 003 Generating new channel configtx

    2022-03-14 22:22:36.465 EDT [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 004 Writing new channel tx

    + res=0

    Creating channel mychannel

    Using organization 1

    + peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /root/go/src/github.com/hyperledger/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    + res=1

    + peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /root/go/src/github.com/hyperledger/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    + res=1

    + peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /root/go/src/github.com/hyperledger/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    + res=1

    + peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /root/go/src/github.com/hyperledger/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

    + res=1

    Error: failed to create deliver client for orderer: orderer client failed to connect to localhost:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:7050: connect: connection refused"

    Channel creation failed

    Earlier, I took out "name: fabric_test" from docker/docker-compose-ca.yaml file, it was complaining about name field

  • @farukansari i also faced the similar issue and i resolved it by applying below changes in docker-compose yaml files

    1. changed networks to this
      networks:
      fabric_test:

    2. Replaced
      image: hyperledger/fabric-orderer:latest
      image: hyperledger/fabric-peer:latest
      image: hyperledger/fabric-tools:latest

      TO
      image: hyperledger/fabric-orderer:2.2
      image: hyperledger/fabric-peer:2.2
      image: hyperledger/fabric-tools:2.2

    Run ./network.sh down and then ./network.sh up createChannel -ca -s couchdb

  • I had the same issue. I didn't change anything but just take it down and restart, it worked.

    Run ./network.sh down and then ./network.sh up createChannel -ca -s couchdb

  • Post > @ChetanGadgilwar said:

    @farukansari i also faced the similar issue and i resolved it by applying below changes in docker-compose yaml files

    1. changed networks to this
      networks:
      fabric_test:

    2. Replaced
      image: hyperledger/fabric-orderer:latest
      image: hyperledger/fabric-peer:latest
      image: hyperledger/fabric-tools:latest

      TO
      image: hyperledger/fabric-orderer:2.2
      image: hyperledger/fabric-peer:2.2
      image: hyperledger/fabric-tools:2.2

    Run ./network.sh down and then ./network.sh up createChannel -ca -s couchdb

    This worked for me. The only thing I did differently was to update to version 2.2.2.

    Thank you for the help!!

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training