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

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.

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?

"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

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.

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