Welcome to the new Linux Foundation Forum!

Unable to complete Lab 7 - multiple issues with Upgrading the Endorsement Policy of Other Peers

I've been through Lab 7 three times already and I keep ending up with the same problem. I make it all the way to the end, last section "Upgrading the Endorsement Policy of Other Peers".

First issue is running
peer chaincode upgrade -n ccForAll -v 1.1 -o orderer.example.com:7050 --policy​ ​“AND(‘Org1.peer’, ‘Org2.peer’ OR (‘Org1.admin’) )” -c '{“Args”:[“Mach”, “50”]}’

This errors for not having Channel. After adding Channel it then errors for "Error: invalid policy"

I found a correction in another thread post for
peer chaincode upgrade -n ccForAll -v 1.1 -C allarewelcome -c '{"Args":["Mach","50"]}' --policy "AND('Org1.peer','Org2.peer', OR('Org1.member','org2.peer'))"

This has the channel and the correct policy with the comma before OR

When I run this I get an error
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg version already exists for chaincode with name 'ccForAll'

I did think it was strange we were using 1.1 again, so I did the following

peer chaincode install -n ccForAll -v 1.2 -p github.com/sacc
peer chaincode upgrade -n ccForAll -v 1.2 -C allarewelcome -c '{"Args":["Mach","50"]}' --policy "AND('Org1.peer','Org2.peer', OR('Org1.member','org2.peer'))"

This throws an error
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg instantiation policy violation: signature set did not satisfy policy

Not sure where to go from here. Any suggestions?

Comments

  • garycrisgarycris Posts: 9

    I was able to make some progress and instantiate/upgrade chaincode if I did it from an Org1 peer; that went through successfully. But trying to instantiate from Org2 does not work.

    I also have the issue that while it instantiated to Org1.peer0 and Org1.peer1, as well as Org2.peer0, it will not instantiate to Org2.peer1.

    For Org2.peer1 I get the following error message when I run this command

    -peer chaincode list --installed && peer chaincode list --instantiated -C allarewelcome

    Get installed chaincodes on peer:
    Name: ccForAll, Version: 1.1, Path: github.com/sacc, Id: a3a8fc818cd2061693f70691c7d6a94e8af6104f2415f4cb406f878f448c9852
    Name: ccForAll, Version: 1.2, Path: github.com/sacc, Id: 4526ccbfb4a752dd946a565fff4e87b9981fb17bb96a2fa7b92a49a56f8b9fb8
    Name: networkChaincode, Version: 1.1, Path: github.com/sacc, Id: 61c641861cb554d2a6e8e1c8119335c0e168520fd2b42cb274e0c5052092f620
    2020-05-09 17:01:16.417 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    2020-05-09 17:01:16.429 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    Error: Error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [allarewelcome] creator org [Org2MSP]

    If I run same command on any of the other peers I get

    Get installed chaincodes on peer:
    Name: ccForAll, Version: 1.1, Path: github.com/sacc, Id: a3a8fc818cd2061693f70691c7d6a94e8af6104f2415f4cb406f878f448c9852
    Name: ccForAll, Version: 1.2, Path: github.com/sacc, Id: 4526ccbfb4a752dd946a565fff4e87b9981fb17bb96a2fa7b92a49a56f8b9fb8
    Name: networkChaincode, Version: 1.1, Path: github.com/sacc, Id: 61c641861cb554d2a6e8e1c8119335c0e168520fd2b42cb274e0c5052092f620
    Get instantiated chaincodes on channel allarewelcome:
    Name: ccForAll, Version: 1.1, Path: github.com/sacc, Escc: escc, Vscc: vscc
    Name: networkChaincode, Version: 1.1, Path: github.com/sacc, Escc: escc, Vscc: vscc

    So I have two outstanding issues I need help figuring out

    1) Why couldn't I upgrade the chaincode from Org2?
    2) Why can't I instantiate the chaincode(s) on Org2.peer1, but I am able to on all the other peers?

  • garycrisgarycris Posts: 9

    I solved #2 by having Org2.peer1 rejoin channel allarewelcome.

  • NiklaskkkkNiklaskkkk Posts: 95

    @garycris said:
    I solved #2 by having Org2.peer1 rejoin channel allarewelcome.

    Hi @garycris ,
    Glad you resolved the issue. Seems like you maybe restarted the network in between, so that Org2.peer1 needed to rejoin before installing and instantiate the chaincode again.

    For your first error, it is usually because it was not signed by the admin of the organization: "Error: could not assemble transaction, err proposal response was not successful, error code 500, msg instantiation policy violation: signature set did not satisfy policy"

    So for anyone else having the same issue, just remember to set correct properties in the CLI (CORE_PEER_LOCALMSPID & CORE_PEER_MSPCONFIGPATH).

  • garycrisgarycris Posts: 9

    Thanks for the response, but still an issue from Org2. I checked my pathing and it is correct

    [email protected]:/opt/gopath/src/github.com/hyperledger/fabric/peer# echo $CORE_PEER_ADDRESS
    peer0.org2.example.com:7051
    **[email protected]:/opt/gopath/src/github.com/hyperledger/fabric/peer# echo $CORE_PEER_LOCALMSPID
    **Org2MSP
    **[email protected]:/opt/gopath/src/github.com/hyperledger/fabric/peer# echo $CORE_PEER_MSPCONFIGPATH
    **/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/[email protected]/msp

    [email protected]:/opt/gopath/src/github.com/hyperledger/fabric/peer#

    [email protected]:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode list --installed
    Get installed chaincodes on peer:
    Name: ccForAll, Version: 1.1, Path: github.com/sacc, Id: a3a8fc818cd2061693f70691c7d6a94e8af6104f2415f4cb406f878f448c9852
    Name: ccForAll, Version: 1.11, Path: github.com/sacc, Id: 860b48b99d122b651242cde573c008cdbe6edfbf54c728514114c659fd48fa7d
    [email protected]:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode upgrade -n ccForAll -v 1.11 -C allarewelcome -c '{"Args":["Mach","50"]}' --policy "AND('Org1.peer','Org2.peer', OR('Org1.member','org2.peer'))"
    2020-05-31 16:26:38.178 UTC [chaincodeCmd] InitCmdFactory -> INFO 001 Retrieved channel (allarewelcome) orderer endpoint: orderer.example.com:7050
    2020-05-31 16:26:38.179 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default escc
    2020-05-31 16:26:38.179 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default vscc
    Error: could not assemble transaction, err proposal response was not successful, error code 500, msg instantiation policy violation: signature set did not satisfy policy
    [email protected]:/opt/gopath/src/github.com/hyperledger/fabric/peer#

    Should I be able to do the upgrade from Org2 or is only Org1 permitted at this point?

Sign In or Register to comment.