Running composer network install in Hyperledger throws out an error - hyperledger-fabric

I am trying to deploy BNA to Fabric but getting this error
$ composer network install -c PeerAdmin#hlfv1 -a ~/Downloads/comment-network.bna
✖ Installing business network. This may take a minute...
Error: Error trying install business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 14 UNAVAILABLE: Connect Failed
Command failed
Already got docker running.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4a1452a6773a hyperledger/fabric-peer:x86_64-1.1.0 "peer node start" 14 minutes ago Up 14 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
59221c711615 hyperledger/fabric-ca:x86_64-1.1.0 "sh -c 'fabric-ca-se…" 14 minutes ago Up 14 minutes 0.0.0.0:7054->7054/tcp ca.org1.example.com
eec390a547e5 hyperledger/fabric-couchdb:x86_64-0.4.6 "tini -- /docker-ent…" 14 minutes ago Up 14 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
c7d462facea6 hyperledger/fabric-orderer:x86_64-1.1.0 "orderer" 14 minutes ago Up 14 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
I installed Fabric using step 4 of this guide then ran
./startFabric.sh
./createPeerAdminCard.sh
prior to deploying BNA.
EDIT:
$ docker -v
Docker version 18.02.0-ce, build fc4de44
$ system_profiler SPSoftwareDataType
Software:
System Software Overview:
System Version: macOS 10.13.2 (17C88)
Kernel Version: Darwin 17.3.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: COMPUTER NAME
User Name: USERNAME
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 13 days 18:28

I concluded that my issue was because of me using docker-machine to run Docker instead of running Docker via daemon.
I solved it by adding the ports used to VirtualBox.

Related

Hyperledger fabric chaincode | Abstore Go application build giving permission issue

I am trying to run a sample chaincode application on hyperledger fabric by following the steps mentioned in their github url
I am able to start the network using docker compose, below are the running containers:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4992a3502034 hyperledger/fabric-tools "/bin/bash -c ./scri…" 44 minutes ago Up 44 minutes cli
4646e6ebf6c0 hyperledger/fabric-ccenv "/bin/sh -c 'sleep 6…" 44 minutes ago Up 44 minutes chaincode
c43bf3621a92 hyperledger/fabric-peer "peer node start --p…" 44 minutes ago Up 44 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer
f0095379384b hyperledger/fabric-orderer "orderer" 44 minutes ago Up 44 minutes 0.0.0.0:7050->7050/tcp orderer
Now when I try to build the sample abstore Go application from within the chaincode container, I get the below error everytime.
/opt/gopath/src/chaincode/abstore/go $ go build -o abstore go build
github.com/hyperledger/fabric-samples/chaincode/abstore/go: open
abstore: permission denied.
Can someone guide me here where I am going wrong.
The issue was resolved after giving complete access to the folders using :
sudo chmod -R 777 .

Hyperledger composer network upgrade timout error

I am getting this error while upgrading bna file on network:-
Error trying to upgrade business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: REQUEST_TIMEOUT
Any solution to this?
first i installed the initial version of bna file and start the network and it works perfect with these commands:-
composer network install -c PeerAdmin#hlfv1 -a medicalprovenance#0.0.0.bna
composer network start --networkName medicalprovenance
--networkVersion 0.0.0 -A admin -S adminpw -c
PeerAdmin#hlfv1
but when i tried to upgrade the network with these commands :-
composer network install -a medicalprovenance#0.0.1.bna -c PeerAdmin#hlfv1
composer network upgrade --networkName medicalprovenance --networkVersion
0.0.1 -c PeerAdmin#hlfv1
it fails with timeout error as described in question
I am using fabric dev server single organisation network.
name and version information in package.json file is:-
"name":"medicalprovenance","version":"0.0.1"
docker ps -a output is:-
5d86afea3b9f dev-peer0.org1.example.com-medicalprovenance-0.0.0-fccf8faa81606e91484c24fcd1f851b4d93c9632dce32d2ff3a90b0f12ed12f4 "/bin/sh -c 'cd /usr…" 24 minutes ago Up 24 minutes dev-peer0.org1.example.com-medicalprovenance-0.0.0
a9d40b271b2c hyperledger/fabric-peer:x86_64-1.1.0 "peer node start" 26 minutes ago Up 26 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
c1b90e2f062f hyperledger/fabric-orderer:x86_64-1.1.0 "orderer" 26 minutes ago Up 26 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
795e16cdaca1 hyperledger/fabric-ca:x86_64-1.1.0 "sh -c 'fabric-ca-se…" 26 minutes ago Up 26 minutes 0.0.0.0:7054->7054/tcp ca.org1.example.com
f5c65f2cce16 hyperledger/fabric-couchdb:x86_64-0.4.6 "tini -- /docker-ent…" 26 minutes ago Up 26 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb

composer network install command gives error as Error: 14 UNAVAILABLE: EOF

I am using Hyperledger Composer version v0.19.9 and Hyperledger Fabric version v1.1.
I have setup my blockchain network using Fabric and made all docker containers up and running. Following docker containers are running:
1. cli
2. orderer.sterlite.com
3. peer0.orga.sterlite.com
4. ca.orga.sterlite.com
5. peer0.orgb.sterlite.com
I have created a Peer Admin card using Composer CLI named PeerAdminOrgA#sterlite.
Now, when I try to install a business network using below command, I am getting an error:
composer network install -c PeerAdminOrgA#sterlite -a com-fab-bn.bna
Following is the error:
safvan#safvan-VirtualBox:~/blockchain/fabric-sdk/fabric-sdk-go/src/github.com/sterliteChain/config$ composer network install -c PeerAdminOrgA#sterlite -a com-fab-bn.bna
Installing business network. This may take a minute...
Error: Error trying install business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 14 UNAVAILABLE: EOF
Command failed
Following is the outcome of docker ps command:
safvan#safvan-VirtualBox:~/blockchain/fabric-sdk/fabric-sdk-go/src/github.com/sterliteChain/config$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3645759c804d hyperledger/fabric-tools:latest "/bin/bash" About a minute ago Up About a minute cli
7f72016afeef hyperledger/fabric-orderer:latest "orderer" 19 hours ago Up About a minute 0.0.0.0:7050->7050/tcp orderer.sterlite.com
74f6a3c3f493 hyperledger/fabric-peer:latest "peer node start" 19 hours ago Up About a minute 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.orga.sterlite.com
6c3ab687ec95 hyperledger/fabric-ca:latest "sh -c 'fabric-ca-seâ¦" 19 hours ago Up About a minute 0.0.0.0:7054->7054/tcp ca.orga.sterlite.com
c6187a82e300 hyperledger/fabric-peer:latest "peer node start" 19 hours ago Up About a minute 0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp peer0.orgb.sterlite.com
Kindly help me fix this issue.

No valid responses from any peers while deploying the BNA file with "composer network start"

I am following the link: https://hyperledger.github.io/composer/tutorials/deploy-to-fabric-multi-org to deploy bna file in 2 different peers.
Up to step-16 everything is working fine, but when I am trying to deploy the .bna file getting following error.
After importing the identity cards to composer when I have run "install runtime" command for Org1, it is successfully processed but when I am running for Org2 it is showing "No valid responses from any peers" error.
Following are the output.
amandai#ubuntultop:~/block chain/fabric-samples V1/ess-multipeer-sample/network$ composer network start -c PeerAdmin#amsnetwork-essbbsr -a amsnetwork.bna -o endorsementPolicyFile=endorsement-policy.json -A chinmayak -C chinmayak/admin-pub.pem -A kkumarbabu -C kkumarbabu/admin-pub.pem
Starting business network from archive: amsnetwork.bna
Business network definition:
Identifier: amsnetwork#0.2.0-20180102082548
Description: The Hello World of Hyperledger Composer samples
Processing these Network Admins:
userName: chinmayak
userName: kkumarbabu
✖ Starting business network definition. This may take a minute...
Error: Error trying to instantiate composer runtime. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: REQUEST_TIMEOUT
Response from attempted peer comms was an error: Error: REQUEST_TIMEOUT
Command failed
Even all the peers are up.
amandai#ubuntultop:~/block chain/fabric-samples V1/ess-multipeer-sample/network$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c83e1a245386 hyperledger/fabric-tools "/bin/bash -c './s..." 6 minutes ago Up 6 minutes cli
46bf68ca719e hyperledger/fabric-peer "peer node start" 6 minutes ago Up 6 minutes 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer0.ezone.esspl.com
2e740ce743fe hyperledger/fabric-ca "sh -c 'fabric-ca-..." 6 minutes ago Up 6 minutes 0.0.0.0:7054->7054/tcp ca_peerEssbbsr
cc48b8ee44db hyperledger/fabric-orderer "orderer" 6 minutes ago Up 6 minutes 0.0.0.0:7050->7050/tcp orderer.esspl.com
46077fc3888a hyperledger/fabric-peer "peer node start" 6 minutes ago Up 6 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.essbbsr.esspl.com
3f65239e7315 hyperledger/fabric-ca "sh -c 'fabric-ca-..." 6 minutes ago Up 6 minutes 0.0.0.0:8054->7054/tcp ca_peerEzone
Please help how to resolve this. Thanks
I did the following modification in "peer-base.yaml" file and issue has been resolved.
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_byfn
To
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=network_amsnetwork
Here "network_amsnetwork" is the network name. You can find your network name by using "docker network ls" command

v0.18.1 error , can't start network

when I run
composer network start -c PeerAdmin#hlfv1 -a test-network.bna -A admin -S adminpw
it took a long time then got a timeout error
Error: Error trying to instantiate composer runtime. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: REQUEST_TIMEOUT
docker ps
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
84daf56fde06 hyperledger/fabric-peer:x86_64-1.1.0-rc1 "peer node start" 12 minutes ago Up 12 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
a6835cf4ed34 hyperledger/fabric-orderer:x86_64-1.1.0-rc1 "orderer" 12 minutes ago Up 12 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
3ab21e84dc6e hyperledger/fabric-couchdb:x86_64-0.4.6 "tini -- /docker-ent…" 12 minutes ago Up 12 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
64acf6dc5db7 hyperledger/fabric-ca:x86_64-1.1.0-rc1 "sh -c 'fabric-ca-se…" 12 minutes ago Up 12 minutes 0.0.0.0:7054->7054/tcp ca.org1.example.com
$ docker logs peer0.org1.example.com
2018-03-15 03:02:51.419 UTC [endorser] simulateProposal -> ERRO 4bf [composerchannel][9b4c096b] failed to invoke chaincode name:"lscc" ,
error: timeout expired while starting chaincode test-network:0.18.1(networkid:dev,peerid:peer0.org1.example.com,tx:9b4c096bcffd303acdafbc46ca17a2d69c33de917ccc0d47965b43dd67484960)
The composer network start command is creating a new docker container and using npm install within that container, so your timeout could be a result of a slow system creating the container, and/or slow performance of the npm install command.
The default timeout is 300 seconds, but you can increase that value with the environment variable CORE_CHAINCODE_EXECUTETIMEOUT=800s
If you look at the docker-compose yaml file that is used to start your Fabric (specifically the Peer) then you can add an additional line for this environment variable.
If you are using the default Dev Fabric, the file you are looking for is probably: ~/fabric-tools/fabric-scripts/hlfv11/composer/docker-compose.yml

Resources