0

I am trying to implement the BYFN Hyperledger example form my Windows 10 Linux Subsystem (Ubuntu Xenial). However, the ./byfn.sh -m up command fails with the following output:

$GOPATH/fabric-samples/first-network$ ./byfn.sh -m up
Starting with channel 'mychannel' and CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
2018-04-24 22:12:44.343 UTC [main] main -> INFO 001 Exiting.....
LOCAL_VERSION=1.1.0
DOCKER_IMAGE_VERSION=1.1.0
Creating peer0.org1.example.com ... done
Creating orderer.example.com    ... done
Creating peer1.org1.example.com ... done
Creating peer0.org2.example.com ... done
Creating peer1.org2.example.com ... done
Creating cli                    ... done
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"scripts/script.sh\": stat scripts/script.sh: no such file or directory": unknown
ERROR !!!! Test failed

I see that only one container is built:

$GOPATH/fabric-samples/first-network$ dps
CONTAINER ID         NAMES              NETWORKS            STATUS              SIZE
3e66d31c6b9a         cli                net_byfn            Up 27 minutes       17B (virtual 1.46GB)

From the output it seems that the cli container cannot see the script.sh script. Thinking this maybe a docker-compose volume-bind issue I tried to check the binds in the cli container:

$GOPATH/fabric-samples/first-network$ docker exec -ti cli bash

root@3e66d31c6b9a:/opt/gopath/src/github.com/hyperledger/fabric/peer# ls scripts/

root@3e66d31c6b9a:/opt/gopath/src/github.com/hyperledger/fabric/peer# exit
exit
$GOPATH/fabric-samples/first-network$ ls scripts/
capabilities.json  script.sh  step1org3.sh  step2org3.sh  step3org3.sh  testorg3.sh  upgrade_to_v11.sh  utils.sh

Looking at the the docker-compose-cli.yaml file I see the following binds for the cli container:

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

My Docker settings:

$GOPATH/fabric-samples/first-network$ docker version
Client:
 Version:       18.03.0-ce
 API version:   1.37
 Go version:    go1.9.2
 Git commit:    0520e24
 Built: Wed Mar 21 23:05:52 2018
 OS/Arch:       linux/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      18.03.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   0520e24
  Built:        Wed Mar 21 23:14:32 2018
  OS/Arch:      linux/amd64
  Experimental: false
$GOPATH/fabric-samples/first-network$ docker-compose version
docker-compose version 1.21.0, build 5920eb0
docker-py version: 3.2.1
CPython version: 3.6.5
OpenSSL version: OpenSSL 1.0.1t  3 May 2016

My Go version:

$GOPATH/fabric-samples/first-network$ go version
go version go1.10.1 linux/amd64

Wondering if I'm missing something. I should mention that I used the following command to start form scratch, based on a fresh set of images (no prior images) as outlined in this script:

curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.1.0

Thanks

rartin
  • 13
  • 4

2 Answers2

0

Its most probably the version of golang---Fabric needs go version 1.9.x and the error message exec failed: container_linux.go:348: indicates the same thing.

adnan.c
  • 721
  • 5
  • 15
  • Thanks. This [documentation](https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html#go-programming-language) specifically mentions Go version 1.10.x for this particular implementation though. – rartin Apr 25 '18 at 17:56
  • I just read it, you are right, it does mention 1.10. So, when you downloaded the docker images, did you do `curl .......goo.gl/6wtTN5 | bash -s 1.1.0` like it says in the doc? that looks like 1.1.0 , not the latest, so may be its looking for golang 1.9 as mentioned in the Fabric 1.1 branch? – adnan.c Apr 25 '18 at 18:14
  • Yes I did; I pasted the full URL in the question body as this platform does not allow URL shorteners. – rartin Apr 25 '18 at 19:23
  • Tried it with go version go1.9.5; still getting the same error. Is there a way to implement a typical network from scratch (with out a script)? I'm hoping this way I can find out where it fails. I went through the script; looks like it just runs a few other scripts (besides sanity checks and setting environment variables). – rartin Apr 25 '18 at 23:32
  • its failing on the docker compose up step, so dont think going more granular would give more info than this. have you taken a look at https://stackoverflow.com/questions/45352547/hyperledger-get-bin-bash-scripts-script-sh-no-such-file-or-directory-whe or https://stackoverflow.com/questions/47508528/bin-bash-scripts-script-sh-no-such-file-or-directory-when-running-byfn-sh? – adnan.c Apr 26 '18 at 14:06
  • Thanks for the links. From the first link: "...you need to be running the byfn.sh script with the same user who was authenticated to share the drives on the container..." I used the Windows credentials to share the c: drive on Docker daemon. I assume these credentials are transparent to the Docker client on Ubuntu bash, where I'm running the 'byfn' script? This is the first time I try volume bind form the Ubuntu bash client; haven't had issues with binding from the Windows side so far. – rartin Apr 26 '18 at 17:20
0

In my case, it was the first Note on this page https://hyperledger-fabric.readthedocs.io/en/latest/install.html I'm running on Windows 10, but Docker won't work since i need Windows 10 Pro or better to run it. So i'm using Docker Toolbox, and must follow the Windows 7 trick of cloning the sources anywhere under C:\Users

JSlain
  • 566
  • 3
  • 20