Query result on peer1.org2 is INVALID - hyperledger-fabric

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 ===========

Related

Error Upgrading Fabric component [orderer.common.server] Main -> ERRO 001

I'm practicing upgrading network components (orderer and peers) following the official hyperledger fabric docs. In particular I'm following this link to upgrade the orderer. I'm able to follow all steps, but I get an error at the last step when bringing up the orderer:
/test-network docker logs b0d56da4a9f082bc7c5c0dea1e81ba3bf30c55be8f306b0a27986c706a056da4
2022-10-24 14:53:07.899 UTC [orderer.common.server] Main -> ERRO 001 failed to parse config: Error unmarshaling config into struct: 2 error(s) decoding:
* cannot parse 'General.ListenPort' as uint: strconv.ParseUint: parsing "'7050'": invalid syntax
* cannot parse 'General.TLS.Enabled' as bool: strconv.ParseBool: parsing "'true'": invalid syntax
These are the commands I'm executing in order:
#1. Stop the ordering node.
docker stop $ORDERER_CONTAINER
#2. Back up the ordering node’s ledger and MSP.
docker cp $ORDERER_CONTAINER:/var/hyperledger/production/orderer/ ./backup/orderer/$ORDERER_CONTAINER
docker cp $ORDERER_CONTAINER:/etc/hyperledger/fabric/msp/ ./backup/msp/$ORDERER_CONTAINER
#3. Remove the ordering node container.
docker rm -f $ORDERER_CONTAINER
#4. Launch a new ordering node container using the relevant image tag.
docker run -d -v ${PWD}/backup/orderer/$ORDERER_CONTAINER/:/var/hyperledger/production/orderer/ \
-v ${PWD}/backup/msp/$ORDERER_CONTAINER/:/etc/hyperledger/fabric/msp/ \
--env-file ./envord.list \
--name $ORDERER_CONTAINER \
hyperledger/fabric-orderer:$IMAGE_TAG orderer
After I execute the last command I get:
b0d56da4a9f082bc7c5c0dea1e81ba3bf30c55be8f306b0a27986c706a056da4
The container is created but fails to start with the error presented above. Any clues?
I found the problem. When I exported the variables from the orderer container before bring it down for the update, for some reason they where saved as follow:
ORDERER_GENERAL_EXAMPLE='example value'
The values for all variables were enclosed between single quotes. I removed those single quotes and the problem was solved.

Not able to start a chaincode in the test-network

I got stuck with the first tutorial for the test-network. I can set up a network and a channel with the network.sh-script, checked it with ‘docker ps -a’.
But trying to start the chaincode with
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
fails. The console-output complains about inconsistent vendoring and suggests ignoring the vendoring directory:
console output with GOFLAGS='-mod=readonly
If I export ‘-mod=readonly’ before deploying the chaincode the error stays the same, exporting ‘-mod=mod’ produces an error about a failed normalization of the chaincode path:
console output with GOFLAGS='mod=mod'
I’m using linux-mint 20.2 (Uma), the prerequisites are of the following versions:
git 2.25.1
curl 7.68.0
docker 20.10.14
docker-compose 1.25.0 (build unknown)
go 1.13.8
jq 1.6
Setting up the network I once had the monitordocker-skript from the second tutorial running and noticed that it shows a different go-version (1.17.5 but still above the needed 1.13.x). And printing the version of docker-compose in the terminal there are the words “build unknown” behind the version-number, don’t know if that is useful.
Does anyone know why I’m not able to start a chaincode with the test-network?
Tried it with go 1.18, but there's no change.

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

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

"channel [{channel-name}]: MSP error: channel doesn't exist" warning fails the instantiation of chaincode on Hyperledger Fabric

I'm trying to run the Hyperledger Fabric network, which consists of a single orderer, a single peer, and a cli. To learn the procedure of launching Hyperledger Fabric network, from creating crypto-related artifacts to running cli as a docker container, I execute them one by one.
Everything is okay, but when I try to instantiate the installed chaincode, the peer produces channel [reputationch]: MSP error: channel doesn't exist (reputationch is my channel name) and the instantiation has been failed.
(Check the below screenshot)
I'm not sure that this warning on the peer node causes the failure of the instantiation of chaincode, but I guess it is the reason.
My crypto-config.yaml and configtx.yaml are like below. They are nothing special because I just modified some names based on the official example.
crytp-config.yaml and configtx.yaml
And the script to create crypto-related artifacts based on the above yaml files is:
script to create crypto-related artifacts
My running scripts to launch an orderer, a peer, and a cli are like below. It calls docker commands.
running scripts to launch an orderer, a peer, and a cli
After I launch a cli, I connect the cli using docker exec -it cli bash. Then, I run three commands, which work well without an error or a warning:
peer channel create -o orderer.operator.com:7050 -c reputationch -f ./channel-artifacts/reputation-channel.tx
peer channel update -o orderer.operator.com:7050 -c reputationch -f ./channel-artifacts/Company1anchors.tx
peer chaincode install -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/
Then, the following command is failed.
peer chaincode instantiate -o orderer.operator.com:7050 -C reputationch -n mycc -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "OR ('Company1MSP.peer')"
My version information is:
macOS: macOS High Sierra 10.13.3
Go: 1.10
Docker: Version 18.03.0-ce-mac59 (23608)
Hyperledger Fabric: 1.1
cryptogen: 1.1.0
configtxgen: 1.1.0
Any kind of comment or help will be very great for me. Thanks.
Basically you also need your peers to join your channels. Which it seems like you are not doing here. If your peers do not join any channel, you will be getting this error. Make sure that your peers join channel before installing chaincode.
peer channel join -b $CHANNEL_NAME.block

Yet Another "ERROR: manifest for hyperledger/fabric-orderer:latest not found" error

Part of the answer (!) to this question is that I must know (in advance) that this is a problem, identify the images that I must pull (here's Orderer) and then retag them all with "latest". This seems sub-optimal. I know this problem because I've experienced it before, but... I'm being a noob and following along here:
Excited Noob wanting to write first app
Dutifully follows along with Prereqs
Then
/startFabric.sh
# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1
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
Pulling orderer.example.com (hyperledger/fabric-orderer:latest)...
ERROR: manifest for hyperledger/fabric-orderer:latest not found
Noob departs frustrated?
Please revise the tutorial page to reference this additional pre-req
Or parameterize scripts to take DOCKER_TAG={{VALUE}}
Or am I missing something?
These instructions could be:
Identify the latest version for your architecture using "fabric-orderer" as a template:
https://hub.docker.com/r/hyperledger/fabric-orderer/tags/
In my case the latest tag is x86_64-1.0.3 and I'm using bash, so:
TAG={{THE CORRECT VALUE}} // In my case x86_64-1.0.3
for IMAGE in orderer couchdb peer ca tools
do
docker pull hyperledger/fabric-${IMAGE}:${TAG} && \
docker tag \
hyperledger/fabric-${IMAGE}:${TAG} \
hyperledger/fabric-${IMAGE}:latest
done
References:
ERROR: manifest for hyperledger/fabric-orderer:latest not found
hyperledger fabric tutoral - write first application error
Error building images: Tag latest not found in repository docker.io/hyperledger/fabric-baseimage
BlockChain : Issue setting up dev environment for hyperledger fabric
What you missing is the step where you have to download binaries, see "Download Platform-specific Binaries".
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.3.sh | bash
PS. you can find more explanation on one of your references, e.g.:
"hyperledger fabric tutoral - write first application error"

Resources