Error loading MSP configuration for org Org1MSP - hyperledger-fabric

I am facing a problem while creating the channel in HyperLedger Fabric Blockchain
ubuntu#Raghav:/mnt/c/fabric-samples/test-network$ ./network.sh createChannel
Creating channel 'mychannel'.
If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb
Generating channel create transaction 'mychannel.tx'
configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/mychannel.tx -channelID mychannel
The logs are the following ones:
2020-10-17 12:16:23.571 IST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-10-17 12:16:23.651 IST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /mnt/c/fabric-samples/test-network/configtx/configtx.yaml
2020-10-17 12:16:23.651 IST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 003 Generating new channel configtx
2020-10-17 12:16:23.668 IST [common.tools.configtxgen] main -> FATA 004 Error on outputChannelCreateTx: could not generate default config template: error parsing configuration: could not create application group: failed to create application org: 1 - Error loading MSP configuration for org Org1MSP: could not load a valid ca certificate from directory /mnt/c/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/msp/cacerts: stat /mnt/c/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/msp/cacerts: no such file or directory
+ res=1
Failed to generate channel configuration transaction...
Create channel failed

Related

Channel creation fails in Hyperledger Fabric (without Docker)

I'm having some troubles creating a channel in Hyperledger Fabric v1.4.3 without the use of Docker. I could succesfully generate keys, certs, genesis block and the various artifacts by simply executing cryptogen and configtxgen, then start orderer and peer. However, when I try to create a channel with command
peer channel create -c mychannel -o 127.0.0.1:7050
it fails due to "BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not succesfully apply update to template configuration: error authorizing update: error validating Readset: existing config does not contain element for [Group] /Channel/application/SampleOrg but was in the read set.
Below the list of commands (executed from fabric-samples/first-network directory):
# cryptogen generate --config=./crypto-config.yaml
# export FABRIC_CFG_PATH=$PWD
# mkdir channel-artifacts
# configtxgen -profile TwoOrgsOrdererGenesis -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
# export CHANNEL_NAME=mychannel
# configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME
# configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP
# configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org2MSP
# sudo mkdir -p /var/hyperledger/production
# sudo chown -R $(whoami):$(whoami) /var/hyperledger
# orderer start
# export set FABRIC_CFG_PATH=$HOME/fabric-samples/config
# peer node start >> peerlog.log 2>&1 &
# peer channel create -o 127.0.0.1:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx
This is the output of the the peer terminal, after the attempt of the channel creation:
2019-10-01 12:51:11.955 CEST [ChannelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', 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
In the orderer terminal, subsequently:
2019-10-01 12:51:11.958 CEST [orderer.common.broadcast] ProcessMessage -> WARN 015 [channel: mychannel] Rejecting broadcast of config message from 127.0.0.1:48526 because of error: error validating channel creation transaction for new channel 'mychannel', could not successfully 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
2019-10-01 12:51:11.958 CEST [comm.grpc.server] 1 -> INFO016 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=127.0.0.1:48526 grpc.code=OK grpc.call_duration=1.14698ms
2019-10-01 12:51:11.961 CEST [comm.deliver] Handle ->WARN017 Error reading from 127.0.0.1:48524: rpc error: code = Canceled desc = context canceled
2019-10-01 12:51:11.961 CEST [comm.grpc.server] 1 -> INFO 018 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=127.0.0.1:48524 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=5.834477ms
Any help would be appreciated, I've tried all the solutions I've found online. Thank you in advance.
Edit
This is what I modified in orderer.yaml:
LocalMSPDir: /home/rfiorini/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp
This is what I modified in core.yaml:
mspConfigPath: /home/rfiorini/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp

hyperledger : error creating a Channel Configuration Transaction

I have been following this link : http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html#troubleshoot for starting my first network, using byfn.sh file, and have executed all steps till
export CHANNEL_NAME=mychannel && ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME
The error that I am getting is:
himani#himani-HP-Notebook:~/fabric-samples/first-network$ export CHANNEL_NAME=mychannelthis && ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME2018-06-07 11:42:00.552 IST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-06-07 11:42:00.560 IST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2018-06-07 11:42:00.560 IST [msp] getMspConfig -> INFO 003 Loading NodeOUs
2018-06-07 11:42:00.561 IST [msp] getMspConfig -> INFO 004 Loading NodeOUs
2018-06-07 11:42:00.579 IST [common/tools/configtxgen] main -> CRIT 005 Error on outputChannelCreateTx: config update generation failure: could not parse application to application group: setting up the MSP manager failed: the supplied identity is not valid: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")
I have tried variations of the command,
export CHANNEL_NAME=mychannelanother && ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME
export CHANNEL_NAME=mychannelanother && ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $mychannelanother
export CHANNEL_NAME=mychannel && ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $mychannel
I even tried creating a channel without using byfn.sh file, but got a different error
himani#himani-HP-Notebook:~/fabric-samples/first-network$ peer channel create -o orderer.example.com:7050 -c mychannel -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
No command 'peer' found, did you mean:
Command 'pear' from package 'php-pear' (main)
Command 'pee' from package 'moreutils' (universe)
Command 'peet' from package 'pipexec' (universe)
Command 'beer' from package 'gerstensaft' (universe)
peer: command not found
himani#himani-HP-Notebook:~/fabric-samples/first-network$ peer channel create -o orderer.example.com:7050 -c mychannelthis -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
No command 'peer' found, did you mean:
Command 'pear' from package 'php-pear' (main)
Command 'pee' from package 'moreutils' (universe)
Command 'beer' from package 'gerstensaft' (universe)
Command 'peet' from package 'pipexec' (universe)
peer: command not found
I modified the /home/himani/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem doc by referring to this link : https://gerrit.hyperledger.org/r/#/c/18177/ , and executed the command again, but to no avail.
Are my certificates outdated? Where can I find the right ones? Is the issue something else?
UPDATE:
After referring to a solution provided to a similar problem, Hyperledger Fabric v1.1.0 byfn tutorial on Ubuntu 16.04, I brought down my network and tried to clean up artifacts but I couldn't execute those commands. Channel artifacts folder is empty.
I couldn't execute those commands
This command is meant to add files in channel-artifacts folder, but for some reason the folder was not created automatically. On creating one, with adequate permissions, the command executed and genesis block was created.
I don't know if you have solved it or not, but there are some mistakes there.
himani#himani-HP-Notebook:~/fabric-samples/first-network$ export CHANNEL_NAME=mychannelthis && ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME2018-06-07 11:42:00.552 IST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-06-07 11:42:00.560 IST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2018-06-07 11:42:00.560 IST [msp] getMspConfig -> INFO 003 Loading NodeOUs
2018-06-07 11:42:00.561 IST [msp] getMspConfig -> INFO 004 Loading NodeOUs
2018-06-07 11:42:00.579 IST [common/tools/configtxgen] main -> CRIT 005 Error on outputChannelCreateTx: config update generation failure: could not parse application to application group: setting up the MSP manager failed: the supplied identity is not valid: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")
if you are following the tutorial, CHANNEL_NAME should be mychannel.
for the 3rd variations, it should be like this
export CHANNEL_NAME=mychannel && ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME
for creating channel, peer channel create can only be send inside docker container.
If you are sending directly from command line, try this
docker exec -it yourCliContainerName peer channel create -o orderer.example.com:7050 -c mychannelthis -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
but remember to start the container first.
hope this helps

Hyperledger Fabric v1.1.0 byfn tutorial on Ubuntu 16.04

root#sungil:~/fabric-samples/first-network# export CHANNEL_NAME=mychannel
root#sungil:~/fabric-samples/first-network# ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME
2018-03-19 13:11:51.489 KST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-03-19 13:11:51.494 KST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2018-03-19 13:11:51.495 KST [msp] getMspConfig -> INFO 003 Loading NodeOUs
2018-03-19 13:11:51.495 KST [msp] getMspConfig -> INFO 004 Loading NodeOUs
2018-03-19 13:11:51.510 KST [common/tools/configtxgen] main -> CRIT 005 Error on outputChannelCreateTx: config update generation failure: could not parse application to application group: setting up the MSP manager failed: the supplied identity is not valid: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org2.example.com")
I installed hyperledger fabric v1.1.0-rc1 using byfn.sh.
(Reference:
http://hyperledger-fabric.readthedocs.io/en/lastest/build_network.html)
But I got some failure. It's Fabric CA problem?
[executed]
./byfn.sh -m generate
./byfn.sh -m up
../bin/cryptogen generate --config=./crypto-config.yaml
export FABRIC_CFG_PATH=$PWD
../bin/configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
export CHANNEL_NAME=mychannel
./bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME
my configtx.yaml is https://github.com/hyperledger/fabric-samples/blob/release-1.1/first-network/configtx.yaml
I faced a similar issue. What helped me was to start over.
Bring down the network: ./byfn.sh -m down
Clean up the generated artifacts
rm crypto-config
rm channel-artifacts
Then issue again the commands. This helped me, the channel.tx and other were successfully created. No need to change the configtx.yaml from the sample.
You don't have to delete files you just need to make sure that ./byfn.sh -m down was executed prior to steps in Crypto Generator section

error while adding new organization in hyperledger fabric -1.0

I have downloaded and setup the hyperledger fabric network in my CentOs system. I am able to start the first network with default two organization (Org1 and Org2). Also each organization is having two peers(peer0, peer1). Now I am trying add one more Organization with one peer.
I have made changes in below files
first-network/crypto-config.yaml
first-network/configtx.yaml
first-network/docker-compose-cli.yaml
first-network/base/docker-compose-base.yaml
first-network/script/script.sh
now while trying to up the network. Below exception is coming
Having all peers join the channel...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2017-09-06 06:40:53.134 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2017-09-06 06:40:53.134 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-09-06 06:40:53.136 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2017-09-06 06:40:53.136 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A89070A5B08011A0B08F5B0BECD0510...742FDE921B171A080A000A000A000A00
2017-09-06 06:40:53.136 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 152A1C5D481840FB755E98925E0D346271894F15AB69E694C03BEC962E523A50
Error: proposal failed (err: rpc error: code = Unknown desc = Failed to deserialize creator identity, err Expected MSP ID org1MSP, received Org1MSP)
Usage:
peer channel join [flags]
Flags:
-b, --blockpath string Path to file containing genesis block
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--logging-level string Default logging level and overrides, see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--test.coverprofile string Done (default "coverage.cov")
--tls Use TLS when communicating with the orderer endpoint
-v, --version Display current version of fabric peer server
PEER0 failed to join the channel, Retry after 2 seconds

Hyperledger Fabric issue - "Error starting container"

I am running hyper-ledger fabric on an ubuntu VM on a Mac OSX running Parallels, downloaded docker, got everything setup, but when running the first network example (command ./byfn.sh -m up) I am getting this error
===================== Chaincode is installed on remote peer PEER2 =====================
Instantiating chaincode on org2/peer2...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin#org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2017-09-07 20:15:16.984 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2017-09-07 20:15:16.984 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-09-07 20:15:16.987 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2017-09-07 20:15:16.987 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2017-09-07 20:15:16.988 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A91070A6708031A0C08D4D1C6CD0510...324D53500A04657363630A0476736363
2017-09-07 20:15:16.988 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 17D7F0C37473394040F19251CCA253B1ECA95F7AD65AF27EFA92DE1F10D94A9B
Error: Error endorsing chaincode: rpc error: code = Unknown desc = Error starting container: Get https://registry-1.docker.io/v2/hyperledger/fabric-baseos/manifests/x86_64-0.3.2: dial tcp: lookup registry-1.docker.io on 127.0.1.1:53: read udp 127.0.0.1:54547->127.0.1.1:53: i/o timeout
Usage:
peer chaincode instantiate [flags]
Flags:
-C, --channelID string The channel on which this command should be executed (default "testchainid")
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-E, --escc string The name of the endorsement system chaincode to be used for this chaincode
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
-P, --policy string The endorsement policy associated to this chaincode
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
-V, --vscc string The name of the verification system chaincode to be used for this chaincode
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--logging-level string Default logging level and overrides, see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--test.coverprofile string Done (default "coverage.cov")
--tls Use TLS when communicating with the orderer endpoint
!!!!!!!!!!!!!!! Chaincode instantiation on PEER2 on channel 'mychannel' failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
Error: Error endorsing chaincode: rpc error: code = Unknown desc = Error starting container: Get https://registry-1.docker.io/v2/hyperledger/fabric-baseos/manifests/x86_64-0.3.2: dial tcp: lookup registry-1.docker.io on 127.0.1.1:53: read udp 127.0.0.1:54547->127.0.1.1:53: i/o timeout
Like it says in the error you have a connectivity problem from your VM, seems connection to external IPs is lagging.

Resources