Jugma
Jugma

Reputation: 21

How to fix the error when trying to bring up first-network

I am working with Hyperledger Fabric 1.3.0. I get the following error when I execute the "byfn.sh -m up" in the fabric-samples/first-network.

Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds Continue? [Y/n] Y proceeding ... LOCAL_VERSION=1.3.0 DOCKER_IMAGE_VERSION=1.3.0 Error: No such container: cli ERROR !!!! Test failed

Please help

I don't have docker-compose.yaml but what I do have is docker-compose-cli.yaml. The contents are below:

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

version: '2'

volumes:
  orderer.example.com:
  peer0.org1.example.com:
  peer1.org1.example.com:
  peer0.org2.example.com:
  peer1.org2.example.com:

networks:
  byfn:

services:

  orderer.example.com:
    extends:
      file:   base/docker-compose-base.yaml
      service: orderer.example.com
    container_name: orderer.example.com
    networks:
      - byfn

  peer0.org1.example.com:
    container_name: peer0.org1.example.com
    extends:
      file:  base/docker-compose-base.yaml
      service: peer0.org1.example.com
    networks:
      - byfn

  peer1.org1.example.com:
    container_name: peer1.org1.example.com
    extends:
      file:  base/docker-compose-base.yaml
      service: peer1.org1.example.com
    networks:
      - byfn

  peer0.org2.example.com:
    container_name: peer0.org2.example.com
    extends:
      file:  base/docker-compose-base.yaml
      service: peer0.org2.example.com
    networks:
      - byfn

  peer1.org2.example.com:
    container_name: peer1.org2.example.com
    extends:
      file:  base/docker-compose-base.yaml
      service: peer1.org2.example.com
    networks:
      - byfn

  cli:
    container_name: cli
    image: hyperledger/fabric-tools:$IMAGE_TAG
    tty: true
    stdin_open: true
    environment:
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      #- CORE_LOGGING_LEVEL=DEBUG
      - CORE_LOGGING_LEVEL=INFO
      - CORE_PEER_ID=cli
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
      - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
      - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
      - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: /bin/bash
    volumes:
        - /var/run/:/host/var/run/
        - ./../chaincode/:/opt/gopath/src/github.com/chaincode
        - ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
        - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
        - ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
    depends_on:`enter code here`
      - orderer.example.com
      - peer0.org1.example.com
      - peer1.org1.example.com
      - peer0.org2.example.com
      - peer1.org2.example.com
    networks:
      - byfn

Upvotes: 0

Views: 1827

Answers (1)

Diego Bascans
Diego Bascans

Reputation: 1159

Well, it seems you are having some issues with your versions, what I recommend is to clean all the containers and images of docker running:

docker rmi $(docker images -a -q) //for images

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q) //for containers

After that, re-download the fabric samples, I think that they updated the 1.3.0 stable version yesterday, setup again your crytogen path (this is very important if you are pointing to an old version of the cryptogen tool it won't work!

And give a try again, if that don't work, I recommend you to give us more information like.

Where are you running your First-Network? Windows? Mac? Linux? Version of Linux? Version of docker?

If you are still having troubles you can check out my guide of how yo setup an hyperledger fabric from scratch using the Basic-Network example, it's kinda easy and explain all the concepts that you need.

Setup Hyperledger Fabric in multiple physical machines

Update

Since you are in Windows, don't use your users Folder, create a simple folder structure like C:/HLF for example.

After that in your .env file add this line COMPOSE_CONVERT_WINDOWS_PATHS=1. This helps docker to understand the windows paths, cause they are different in linux.

Update #2

Let's try another solution then, go to your script.sh inside your script folder, look for the command peer channel create... and add this line just before the IF statement where are them MSYS_NO_PATHCONV=1

Review the Windows Extras section in the fabric solution, check that you have all installed.

Hyperledger Fabric - Windows Extras

After that re generate everything. Run the docker commands in my first answer and add this.

docker network prune

After that.

./byfn.sh down
./byfn.sh generate
./byfn.sh -m up

Update #3

I tested the fisrt-network using Windows 10 and Docker for windows (Using linux containers) with the configurations I mentioned before and it's working fine.

My docker version is: 18.06.1-ce

And I followed the Fabric Hyperledger official tutorial: Build Network

The only difference that I saw it's that I ran ./byfn.sh up instead of ./byfn.sh -m up

I recommend you to reinstall your docker for windows, maybe its something corrupted, that doesn't allow you to start a your network.

Hope that it helps!

Upvotes: 2

Related Questions