Some problems about channel in Fabric python SDK - hyperledger-fabric

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

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.

Getting error as ccenv:latest removal from docker hub caused problem for chaincode instantiation

I am trying to init the chaincode on hyperledger fabric 1.4.5 setup with k8s, however getting error as
"Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Failed to pull hyperledger/fabric-ccenv:latest: API error (404): manifest for hyperledger/fabric-ccenv:latest not found: manifest unknown: manifest unknown
"
Please anybody help me on this issue
latest tag has been deprecated. You can add
CORE_CHAINCODE_BUILDER: hyperledger/fabric-ccenv:your_version
under peer's environment in compose file.
This issue is resolved in Fabric v1.4.8 as it will now look for fabric-ccenv:1.4 by default, instead of fabric-ccenv:latest.
See the v1.4.8 release notes for more details.
The tag was removed. The workaround is to pull the matching version and tag it locally as latest.
docker pull hyperledger/fabric-ccenv:1.4.0
docker tag hyperledger/fabric-ccenv:1.4.0 hyperledger/fabric-ccenv:latest

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

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