BAD_REQUEST -- error validating channel creation transaction for new channel in the Hyperledger Tutorial - hyperledger-fabric

i get an error for hyperledger fabric.
I followed the documentation and I came across his error when I ran the below 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
the error being
BAD_REQUEST -- error validating channel creation transaction for new channel 'fyp', 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

Related

Why ./network.sh createChannel always give Channel creation failed and Create channel failed error?

I followed the Official Fabric Test Network tutorial "Using the Fabric Test Network ", but reported some errors when I ran ./network.sh createChannel. Log and errors like this
+ peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /home/centos/go/src/github.com/hyperledger/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=1
Error: failed to create deliver client for orderer: orderer client failed to connect to localhost:7050: failed to create new connection: context deadline exceeded
Channel creation failed
Create channel failed
If you are first time user you can try the following to bring up network with given channel name
./network.sh down
./network.sh up createChannel -c mychannel
I used this script.It worked
./network.sh up createChannel -ca -c mychannel -s couchdb -i 2.2.0
This situation is arisen due to TLS certificate.
For example, it may happen due to "client TLS / server no TLS". So please check "--tls $CORE_PEER_TLS_ENABLED" option. "$CORE_PEER_TLS_ENABLED" should be true.
So you can see something like this in console:
+ peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls true --cafile /home/centos/go/src/github.com/hyperledger/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

Hyperledger build network - cannot create peer channel

I'm currently following hyperledger fabric document v1.4.6 to build first network(https://hyperledger-fabric.readthedocs.io/en/release-1.4/build_network.html#manually-generate-the-artifacts)
I first put the network down with ./byfn.sh down then tried creating the network.
However, when i go into docker cli and perform
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
this creates a error saying
InitCmd -> ERRO 001 Cannot run peer because cannot init crypto, folder "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp" does not exist
So I tried again with network up (./byfn.sh up) now with the same procedure it creates different error saying
Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'mychannel': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application/Org1MSP be at version 0, but it is currently at version 1
at the same command
First, I'm not sure whether I should be having the network up or down and second how to fix the problem.
Thank you
If you want to perform the manual steps, you need to start from here (with any previous fabric networks down/removed) and follow all the steps in the order as listed on that page.

Hyperledger Fabric response: status:500 message:"failed to execute transaction timeout expired while executing transaction"

I am facing this issue and wanted to ask if someone knows what it could be. chaincode is installed and invoked
peer chaincode query -o orderer.example.com:7050 --tls --cafile $ORDERER_CA -C mychannel -n bachelortest -c '{"Args":["getTransactionPriv","1"]}'
error: endorsement failure during query. response: status:500 message:"failed to execute transaction 11254006859fbd102ec468c4100b18a1241445a0c066280ca81510485d43a93f: error sending: timeout expired while executing transaction"

Addition of an organization in Hyperledger-fabric blockchain

I am adding new org I am getting 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
while doing this
peer channel fetch 0 mychannel.block -o orderer.example.com:7050 -c
$CHANNEL_NAME --tls --cafile $ORDERER_CA
Error resolved prblem was containers were with different network it works if all the conatiners are in same network

Error trying to instantiate composer runtime. Error: No valid responses from any peers. for Multi organization hyperledger fabric 1.1

I am trying to setup hyperledger fabric + composer setup with multi organizations locally. The steps I followed to setup hyperledger network is below.
Generate crypto materials and channel
cryptogen generate --config=./crypto-config.yaml configtxgen -profile
OrdererGenesis -outputBlock ./channel-artifacts/genesis.block
configtxgen -profile Channel -CreateChannelTx
./channel-artifacts/channel.tx -channelID ehrchannel
configtxgen -profile Channel -outputAnchorPeersUpdate ./channel-artifacts/Hospital1MSPanchors.tx -channelID ehrchannel -asOrg Hospital1MSP
configtxgen -profile Channel -outputAnchorPeersUpdate ./channel-artifacts/Hospital2MSPanchors.tx -channelID ehrchannel -asOrg Hospital2MSP
Start docker containors for two organisations
Execute Below commands on cli containor
peer channel create -o orderer.ehr.com:7050 -c ehrchannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/ehr.com/orderers/orderer.ehr.com/msp/tlscacerts/tlsca.ehr.com-cert.pem
Having all peers join the channel with setting appropriate env veriables
- peer channel join -b ehrchannel.block
Updating anchor peers for two organisations by setting env variables
peer channel update -o orderer.ehr.com:7050 -c ehrchannel -f ./channel-artifacts/Hospital1MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/ehr.com/orderers/orderer.ehr.com/msp/tlscacerts/tlsca.ehr.com-cert.pem
After that I have followed Hyperledger composer document to configure composer.
But on step 17 on the doc, I am getting an error
composer network start -c PeerAdmin#ehr-network-hos1 -a marbles-network.bna -o endorsementPolicyFile=/tmp/composer/endorsement-policy.json -A admin1 -C admin2/admin-pub.pem -A admin2 -C admin2/admin-pub.pem
Starting business network from archive: marbles-network.bna
Business network definition:
Identifier: marbles-network#0.1.14
Description: Marble Trading Network
Processing these Network Admins:
userName: admin1
userName: admin2
✖ 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: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (marbles-network:0.18.2))
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (marbles-network:0.18.2))
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (marbles-network:0.18.2))
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (marbles-network:0.18.2))
Command failed
What are the potential issues? Thank you so much in advance.
What versions of Composer and Fabric are you using ? If you are using Composer v0.18.2 you need to have the GA version of Fabric v1.1.
The releases document for Composer details the compatible versions of Composer and Fabric. https://github.com/hyperledger/composer/releases
Also you might have a typo in your command ... -A admin1 -C admin2/admin-pub.pem -A admin2 -C admin2/admin-pub.pem are you specifying the wrong folder for admin1 ?
Check fabric node logs to find clue:
docker logs [orderer/peer/...]

Resources