Problem running Hyperledger fabric basic-network: error validating ReadSet - hyperledger-fabric

I'm trying to run the tutorial on hyperledger fabric documents but when I run the ./start.sh command I get this error:
docker-compose -f docker-compose.yml down
Removing network net_basic
WARNING: Network net_basic not found.
docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb
Creating network "net_basic" with the default driver
Creating ca.example.com ... done
Creating couchdb ... done
Creating orderer.example.com ... done
Creating peer0.org1.example.com ... done
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f799f0b5a94b hyperledger/fabric-peer "peer node start" 3 seconds ago Up Less than a second 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
036e92d414df hyperledger/fabric-orderer "orderer" 9 seconds ago Up 5 seconds 0.0.0.0:7050->7050/tcp orderer.example.com
78255d10ae02 couchdb:2.3 "tini -- /docker-ent…" 9 seconds ago Up 3 seconds 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
55f3ade84d52 hyperledger/fabric-ca "sh -c 'fabric-ca-se…" 9 seconds ago Up 4 seconds 0.0.0.0:7054->7054/tcp ca.example.com
# wait for Hyperledger Fabric to start
# incase of errors when running later commands, issue export FABRIC_START_TIMEOUT=<larger number>
export FABRIC_START_TIMEOUT=60
#echo ${FABRIC_START_TIMEOUT}
sleep ${FABRIC_START_TIMEOUT}
# Create the channel
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin#org1.example.com/msp" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
2019-12-21 09:24:37.078 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not succesfully apply update to template configuration: error authorizing update: error validating ReadSet: existing config does not contain element for [Group] /Channel/Application/Org1MSP but was in the read set
First I tryed to change FABRIC_START_TIMEOUT to 60 seconds (it was 10) but the problem still persists. I tryed to see logs for peer0.org1.example.com and get this warning:
2019-12-21 09:36:05.735 UTC [couchdb] handleRequest -> WARN 00e Retrying couchdb request in 1m4s. Attempt:10 Error:Get http://couchdb:5984/: dial tcp 172.30.0.4:5984: connect: connection refused
so I increased FABRIC_START_TIMEOUT to 300 seconds to fix the connection refused problem but I still get the error validating ReadSet error.
How can I fix this problem?

I ran into this issue and solved it by checking out the latest stable tag (v1.4.4) and running the script again.
$ git checkout v1.4.4
$ ./start.sh

Related

Unable to start Fabric on Mac OS, startFabric.sh gives daemon error

I am following the setup as per https://hyperledger.github.io/composer/latest/installing/development-tools.html. But when I run ./startFabric.sh, I run into error as per below logs
docker ps -a:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
53263f6dc18e hyperledger/fabric-peer:1.2.1 "peer node start" 20 minutes ago Exited (1) 13 minutes ago peer0.org1.example.com
8e558708b7f6 hyperledger/fabric-orderer:1.2.1 "orderer" 20 minutes ago Exited (1) 13 minutes ago orderer.example.com
0c373a640583 hyperledger/fabric-couchdb:0.4.10 "tini -- /docker-ent…" 20 minutes ago Up 13 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
e86a4960ab44 hyperledger/fabric-ca:1.2.1 "sh -c 'fabric-ca-se…" 20 minutes ago Up 13 minutes 0.0.0.0:7054->7054/tcp ca.org1.example.com
e30099dbd318 hello-world "/hello" 23 minutes ago Exited (0) 15 minutes ago hungry_zhukovsky
cd fabric-dev-servers/ && ./startfabric.sh:
Development only script for Hyperledger Fabric control
Running 'startfabric.sh'
FABRIC_VERSION is set to 'hlfv12'
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
Stopping couchdb ... done
Stopping ca.org1.example.com ... done
Removing peer0.org1.example.com ... done
Removing orderer.example.com ... done
Removing couchdb ... done
Removing ca.org1.example.com ... done
Removing network composer_default
Creating network "composer_default" with the default driver
Creating couchdb ... done
Creating orderer.example.com ... done
Creating ca.org1.example.com ... done
Creating peer0.org1.example.com ... done
sleeping for 15 seconds to wait for fabric to complete start up
Error response from daemon: Container
3e81f3aa41969a7ae3f7a09c5c42c16aa55e2527958aef319ad93988ca942f7f is not running
On checking the logs for this container, i see this error :
2019-09-06 09:27:49.868 UTC [msp] getPemMaterialFromDir -> DEBU 020 Reading directory /etc/hyperledger/peer/msp/signcerts
2019-09-06 09:27:49.868 UTC [main] main -> **ERRO 021 Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/peer/msp: could not load a valid signer certificate from directory /etc/hyperledger/peer/msp/signcerts: stat /etc/hyperledger/peer/msp/signcerts: no such file or directory**
I get the same error when I try to start the peer container from Kitematic
My setup is as per below:
docker --version: Docker version 19.03.1, build 74b1e89
composer --version: v0.20.9
I found same issue https://github.com/hyperledger/composer/issues/4202 on Windows 10 however I am facing this on Mac OS X 10.11.6.
2019-09-06 09:27:49.868 UTC [main] main -> ERRO 021 Cannot run peer
because error when setting up MSP of type bccsp from directory
/etc/hyperledger/peer/msp: could not load a valid signer certificate
from directory /etc/hyperledger/peer/msp/signcerts: stat
/etc/hyperledger/peer/msp/signcerts: no such file or directory
It Means running container cannot able to access the mounted certificates folder
Please check volume mount !! in the docker-compose file

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

Error when reading core config file: Unsupported Config Type

I am trying to pass in the channel configuration transaction artifact to the order-er using the command:
peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls --cafile
/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
But I get an error:
2018-03-17 20:55:21.380 GMT [main] main -> ERRO 001 Fatal error
when initializing core config : error when reading core
config file: Unsupported Config Type ""
What does this error mean? and how can I fix it?
Using docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5c27fce33911 hyperledger/fabric-tools:latest "/bin/bash" 3 minutes ago Up 3 minutes cli
aabf72f81352 hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
73ddcafb5ce6 hyperledger/fabric-orderer:latest "orderer" 3 minutes ago Up 3 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
205448f5479a hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer1.org1.example.com
4e5ba2999f54 hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp peer0.org2.example.com
fcc6b25b6422 hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp peer1.org2.example.com
2f1536ffe265 dev-peer0.org1.example.com-fabcar-1.0-5c906e402ed29f20260ae42283216aa75549c571e2e380f3615826365d8269ba "chaincode -peer.add…" 24 hours ago Exited (255) 3 minutes ago dev-peer0.org1.example.com-fabcar-1.0
6ae48101bc34 hyperledger/fabric-ca "sh -c 'fabric-ca-se…" 24 hours ago Exited (255) 3 minutes ago 0.0.0.0:7054->7054/tcp ca.example.com
dc9e5bb3cc8e hyperledger/fabric-couchdb "tini -- /docker-ent…" 24 hours ago Exited (255) 3 minutes ago 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
this is the log of orderer.example.com
You should be inside the CLI container to execute the peer channel create command.
You will enter the CLI container using the docker exec command:
docker exec -it cli bash
If successful you should see the following:
root#0d78bb69300d:/opt/gopath/src/github.com/hyperledger/fabric/peer#
Over there, you should run the peer channel create command like this:
root#0d78bb69300d:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
Before running this command, please note that you should also run commands for creating environment variables for CHANNEL_NAME and other Environment variables for PEER0 within this CLI Container.
export FABRIC_CFG_PATH=$PWD. it will resolve this issue.
This is the error you get when the core.yaml is not found. Like the Mukesh mentioned above, running command within the CLI Container will not throw the Error.
See this link for more detail.
Can you try running this command: echo $FABRIC_CFG_PATH
Whatever value you get, can you navigate to that directory and confirm if you can see the configtx.yaml file in there.
From the docs here, it says the error is as a result of inappropriately setting the value of that variable.

How can I reconnect the restarted peer to the peers' network correctly with Hyperledger v1.0 alpha?

I followed the procedure of Quickstart in the link below to setup the peers' network with Hyperledger v1.0 alpha.
https://hyperledger.github.io/composer/installing/quickstart.html
In the procedure, using "docker-compose up" to boot the four peer node as follows.
hlfv1 git:(master) ✗ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
76ac234a65ed hyperledger/fabric-peer:x86_64-1.0.0-alpha "peer node start -..." 30 seconds ago Up 28 seconds 0.0.0.0:7056->7051/tcp, 0.0.0.0:7058->7053/tcp peer1
5075165661f3 hyperledger/fabric-peer:x86_64-1.0.0-alpha "peer node start -..." 32 seconds ago Up 29 seconds 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0
1955163b6e3d hyperledger/fabric-orderer:x86_64-1.0.0-alpha "orderer" 34 seconds ago Up 31 seconds 0.0.0.0:7050->7050/tcp orderer0
65f4ad3217db hyperledger/fabric-ca:x86_64-1.0.0-alpha "sh -c 'fabric-ca-..." 34 seconds ago Up 31 seconds 0.0.0.0:7054->7054/tcp ca_peerOrg1
After the four peer node booted, I used docker command to stop and start the peer.
docker stop peer1
docker start peer1
Then I executed the composer command to deploy business archive as follows .
composer network deploy --archiveFile marbles-network#0.0.8.bna -p
hlfv1 --enrollId admin --enrollSecret adminpw
It says ...
Error: Error: Invalid results returned ::NOT_FOUND
And also I can see the errors in the log of each peer.
2017-05-21 12:36:25.239 UTC [eventhub_producer] Chat -> ERRO 03a Error
during Chat, stopping handler: stream error: code = 1 desc = "context
canceled"
Without restarting the peer , the network is still OK and I can deploy business archive correctly.
How can I reconnect the restarted peer to the peers' network correctly with Hyperledger v1.0 alpha?

Resources