Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not peer chaincode list in fabric

I started up a fabric sample network in my mac and install a chaincode in peer0.org1.example.com.

after tap:

docker exec -it cli bash

and now I use

peer chaincode -C myChannel list --instantiated

But got the error message:

Error: Error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [myChannel] creator org [Org1MSP]

I have no idea about this error. It seems that it has some permission error. thank you if you can help me out from this problem.

like image 304
shaotine Avatar asked May 24 '18 12:05

shaotine


1 Answers

According to the error message, from file msgvalidation.go , the method ValidateProposalMessage fragment is as follow,

// validate the signature
err = checkSignatureFromCreator(shdr.Creator, signedProp.Signature, signedProp.ProposalBytes, chdr.ChannelId)
if err != nil {
    // log the exact message on the peer but return a generic error message to
    // avoid malicious users scanning for channels
    putilsLogger.Warningf("channel [%s]: %s", chdr.ChannelId, err)
    sId := &msp.SerializedIdentity{}
    err := proto.Unmarshal(shdr.Creator, sId)
    if err != nil {
        // log the error here as well but still only return the generic error
        err = errors.Wrap(err, "could not deserialize a SerializedIdentity")
        putilsLogger.Warningf("channel [%s]: %s", chdr.ChannelId, err)
    }
    return nil, nil, nil, errors.Errorf("access denied: channel [%s] creator org [%s]", chdr.ChannelId, sId.Mspid)
}

It seems that you are failed at the step :

err = checkSignatureFromCreator(shdr.Creator, signedProp.Signature, signedProp.ProposalBytes, chdr.ChannelId)

your signedproposal is not validate,

  1. Do you specify the enviroment variant correctly?
 export CORE_PEER_ADDRESS=peer.org1.example.com:17051

 export CORE_PEER_LOCALMSPID=Org1MSP

 export CORE_PEER_MSPCONFIGPATH=xxx/msp

2.Do you use the admin cert to send this transaction?

3.Please provide the more useful information like warning information(from the source code, warning information could be more helpful) ,not only the error information.

like image 77
Jim Green Avatar answered Oct 13 '22 01:10

Jim Green