byfn.sh fails with binaries and docker images out of sync - hyperledger-fabric

Following the build your first network tutorial on hyperledger docs when I type
$ ./byfn.sh up
I get following warning
LOCAL_VERSION=1.2.0
DOCKER_IMAGE_VERSION=1.2.1
=================== WARNING ===================
Local fabric binaries and docker images are
out of sync. This may cause problems.
===============================================
and finally the script fails with this error
Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!

Restart the bootstrap process by cding into the folder fabric-samples/scripts and run bootstrap.sh again like this
$ ./bootstrap.sh
This made my images to get synced like this in the output
LOCAL_VERSION=1.3.0
DOCKER_IMAGE_VERSION=1.3.0

You need to first delete the existing and then download the higher version of Hyperledger Fabric. You can run the following commands to do this:
cd fabric-samples
rm -Rf bin
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.3.0
./scripts/bootstrap.sh

Related

Some problems about channel in Fabric python SDK

I try to follow the tutorial of the Hyperledger Fabric python SDK, but get a problem when creating channel. The error I got is shown in the following:
Exception: [status: BAD_REQUEST
info: "error applying config update to existing channel 'businesschannel': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application be at version 0, but it is currently at version 1"
]
How can I fix it?
The issue is that you didn't remove your previous config before creating a new channel i.e businesschannel. See this line in your error error applying config update to existing channel 'businesschannel. If you are using docker then try below commands:-
docker rm -f $(docker ps -aq)
docker network prune -f
docker volume prune -f

"Error getting endorser client for query" when trying cli interaction with hyperledger fabric example, despite successful installation

I'm currently trying to get the example for hyperledger fabric working. I get as far as starting the chaincode successfully using the deployCC script, and get the expected printout of all the cars after running the script. However, when I get to the next step of manually querying the network, I run into issue. I've run the exports for org1 as specified, and verified that the paths match and the tls cert and mspconfig exist in those locations. However, when I try to run the query command:
peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}'
I get the following error printout:
Error: error getting endorser client for query: endorser client failed to connect to 0.0.0.0:7051: failed to create new connection: context deadline exceeded
I would expect to get the same printout as at the end of the deployCC script, and I can't figure out why that isn't happening. Any help in diagnosing this is appreciated!
If it matters, I'm running this in a VM with Ubuntu 20.04. All the prerequisites are fresh installations of the latest versions from the last couple of days.
Liam, if you are able to see all the cars at the end of deployCC, then it might be an environment variables issue. Remember that you have to execute the peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}' command in the same terminal where you ran deployCC because the environment variables are all set in that window.
We can do a couple of things to confirm:
Paste the output from DeployCC at the end, right after (and including)
Querying chaincode on peer0.org1...
Using organization
Print the following environment variables from the terminal window where you are executing deployCC and from the terminal window where you are executing the peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}' command
CORE_PEER_LOCALMSPID,
CORE_PEER_TLS_ROOTCERT_FILE,
CORE_PEER_MSPCONFIGPATH,
CORE_PEER_ADDRESS.
See if they match?

Hyperledger on IBM Cloud, chaincode launched and waiting for registration

Code
Currently I followed this article to develop my BNA to IBM blockchain cloud platform (started plan). Unluckily, I got the error when I try to run this line of code:
composer network start -c admin#mynetwork-fabric -A admin -C ./creds/admin-pub.pem -f delete.card -n my_network -V 0.0.4
Error
I am very sure that all parameters are good, the full errors are:
Error: Error trying to start business network. Error: No valid responses
from any peers.
Response from attempted peer comms was an error: Error: 2 UNKNOWN:
premature execution - chaincode (my_network:0.0.4) launched and
waiting for registration
Or sometimes the error is:
Error: Error trying to start business network. Error: No valid responses
from any peers.
Response from attempted peer comms was an error: Error:
REQUEST_TIMEOUT
I understand sometimes maybe there is a timeout, but I do not really got the launched and waiting for registration error.
P.S.
My hyperledger composer version is 0.19.
I also view this deploying tutorial, there might be some different commands, because of the different versions of Hyperledger Composer. I checked the composer hep to transfer the commands to running on composer 0.19.
Solution:
down grade composer-cli to 0.18.1
change your package.json, composer-cli to 0.18.1
npm install to create new bna
reinstall
restart
If you are using IBM Cloud Starter Plan, then you need to be using v0.18.1 of Composer not v0.19.
Also, this is the doc you should be following:
https://console.bluemix.net/docs/services/blockchain/develop_starter.html#deploying-a-business-networks-on-starter-plan

Query result on peer1.org2 is INVALID

All of a sudden latest version 1.1.0-alpha, started throwing errors in bring the Hyperledger Fabric Samples - first-network, while running ./byfc.sh -m up
2018-02-20 10:40:29.991 UTC [main] main -> INFO 008 Exiting.....
!!!!!!!!!!!!!!! Query result on peer1.org2 is INVALID !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================
ERROR !!!! Test failed
Need help.. How to debug?
Updates
I had everything running using Fabric 1.1.0-alpha, when I tried sometime after Jan 26. Recently I wanted to try adding a new org to the network. So thought of re-doing from scratch, but now it's failing. Not able to proceed, which I had done it earlier, couple of times. Not sure what is wrong since yesterday, with latest fabric samples...
Cloned the source from master branch.
Docker version 17.12.0-ce, build c97c6d6
Node version v8.9.4
NPM version 5.6.0
cryptogen version 1.1.0-alpha
configtxlator version 1.1.0-alpha
Removed old binaries (/bin folder) and docker containers and images, to start from scratch, but no luck:
./byfn.sh -m down
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images -q)
docker network prune
I tried running ./byfn.sh, using -m, also without, Same result.
./byfn.sh generate
./byfn.sh up
And,
./byfn.sh -m generate
./byfn.sh -m up
Did you checkout the right fabric-samples repo tag that matches the binaries version? The documentation for this was just updated serveral hours ago, so if you were referring to an earlier version of the documentation you might want to refresh:
https://hyperledger-fabric.readthedocs.io/en/latest/samples.html#download-platform-specific-binaries
Make sure you Checkout to the right tag. eg: after you clone, then cd to that folder, finally you git git checkout v1.1.0-alpha
then when running the byfn.sh script, you might need to use the -m option, e.g. `./byfn.sh -m generate
With v1.1.0-rc1, I am able to execute the first-network successfully.
===================== Query on peer1.org2 on channel 'mychannel' is successful =====================
========= All GOOD, BYFN execution completed ===========
_____ _ _ ____
| ____| | \ | | | _ \
| _| | \| | | | | |
| |___ | |\ | | |_| |
|_____| |_| \_| |____/
I suspect, the error which I faced previously with v1.1.0-alpha, was just due to missing instruction in the tutorial, i.e., git checkout {TAG}. Now this has been updated correctly in the tutorial.
I was facing similar error with Release 1.4.1
100
!!!!!!!!!!!!!!! Query result on peer1.org2 is INVALID !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================
ERROR !!!! Test failed
I resolved it by following steps:
Removed fabric-samples directory
Run command in hyperledger directory
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s -- 1.4.1 1.4.1 0.4.15
./byfn.sh up -l node
It is working fine.
90
===================== Query successful on peer1.org2 on channel 'mychannel' =====================
========= All GOOD, BYFN execution completed ===========

Error response from daemon: No such container: cli (Hyperledger .byfn.sh -m up Error)

I am trying to configure hyperledger composer with multi peer. But when I have started the hyperledger fabric, getting following response.
amandai#ubuntultop:~/block chain/fabric-samples V1/ess-multipeer-sample /network$ ./byfn.sh -m up
Starting with channel 'essplchannel' and CLI timeout of '10000' seconand CLI delay of '3' seconds
Continue (y/n)? y
proceeding ...
WARNING: The COMPOSE_PROJECT_NAME variable is not set. Defaulting to a blank string.
Creating network "network_amsnetwork" with the default driver
Creating orderer.esspl.com ...
Creating peer0.ezone.esspl.com ...
Creating peer0.essbbsr.esspl.com ...
Creating ca_peerEssbbsr ...
Creating ca_peerezone ...
Creating peer0.ezone.esspl.com
Creating orderer.esspl.com
Creating ca_peerezone
Creating peer0.ezone.esspl.com ... done
Creating ca_peerEssbbsr ... done
Error response from daemon: No such container: cli
amandai#ubuntultop:~/block chain/fabric-samples V1/ess-multipeer-sample/network$
I have used COMPOSE_FILE=docker-compose.yaml instead of COMPOSE_FILE=docker-compose-cli.yaml due to this error came. After modifying it working as expected.
Is it possible your error may be captured by the answers posted here -> Error when try to instantiate chain-code on Hyperledger Fabric - perhaps making sure there's no 'space' in your directory name (as shown above) may help / setting the variable explicitly?
I had a similar error recently and it related to having some conflicting containers already active. In a section of the following it explains how to remove potentially conflicting containers which I followed to remove my occurrence of this issue. https://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html
upgrade the docker-compose or reinstall it
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
It solves the problem for me.
In my case, docker-composer was missing. Installing it solved the issue.

Resources