Welcome to the Linux Foundation Forum!

LAB 8 - chaincode invocation fails as it seems not to be installed

lrubiop
lrubiop Posts: 3
edited August 2022 in LFS272 Class Forum

Hi all,

I'm facing this weird problem at LAB8 after, packaging (GO dependencies previously solved), installing, approving and committing chaincode:

Error: endorsement failure during invoke. response: status:500 message:"make sure the chaincode sacc has been successfully defined on channel allarewelcome and try again: chaincode definition for 'sacc' exists, but chaincode is not installed"

But, indeed, chaincode has been successfully installed in the two ORGanizations:

bash-5.0# echo $CORE_PEER_ADDRESS
peer0.org2.example.com:7051
bash-5.0# peer lifecycle chaincode queryinstalled
Installed chaincodes on peer:
Package ID: sacc_1.0:5562f868f6fd43ff8873f403aa52bc6928161fec933065d0b81e2193f6038bd0, Label: sacc_1.0

ash-5.0# echo $CORE_PEER_ADDRESS
peer0.org1.example.com:7051
bash-5.0# peer lifecycle chaincode queryinstalled
Installed chaincodes on peer:
Package ID: sacc_1.0:5562f868f6fd43ff8873f403aa52bc6928161fec933065d0b81e2193f6038bd0, Label: sacc_1.0

Is anyone else facing this issue?

Thanks everyone in advance,
Luis

Comments

  • lrubiop
    lrubiop Posts: 3

    I just checked that after the commit I don't see any additional container in the system... it should raise a container for each committed chaincode, right?

    bash-5.0# peer lifecycle chaincode querycommitted -C allarewelcome -n sacc
    Committed chaincode definition for chaincode 'sacc' on channel 'allarewelcome':
    Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]

  • Bobbijn
    Bobbijn Posts: 193

    @lrubiop,
    Let's see if we can get to the bottom of this. Before the chaincode can be active on a channel, the chaincode definition must be approved by a majority of the member organizations. A suggestion would be to make sure the CLI container for Org2MSPs' environmental variables are updated. Another resource for information is the Hyperledger Discord channel, here is an invitation link: https://discord.gg/hyperledger, Let me know if this helps. Bobbi

  • lrubiop
    lrubiop Posts: 3

    Many thanks for your help @Bobbijn :) The error trace is then a little bit confusing as it's saying that chaincode is not installed. If it was a problem related to the policy set I would expect to see a trace complaining about something related to the approvement of the chaincode.

    In any case I've followed your suggestion and I've repeated all the process ensuring that chaincode is approved by Org1 and Org2 (Org2MSP env correctly set):

    bash-5.0# peer lifecycle chaincode checkcommitreadiness --channelID \

    allarewelcome --name sacc --version 1.0 --sequence 1 --output json

    {
    "approvals": {
    "Org1MSP": true,
    "Org2MSP": true

    }
    }

    Committed chaincode definition for chaincode 'sacc' on channel 'allarewelcome':
    Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]

    The problem persists:
    Error: endorsement failure during invoke. response: status:500 message:"make sure the chaincode sacc has been successfully defined on channel allarewelcome and try again: chaincode definition for 'sacc' exists, but chaincode is not installed"

    Thanks in advance!
    LR

  • gorkao2
    gorkao2 Posts: 6

    Did you set the ENV CC_PACKAGE_ID with sacc_1.0:xxx or just the number?

    I had the same problem and it resolved with pasting all the text next to "Package ID" until ",".

    I hope it is helpful for you.

  • Bobbijn
    Bobbijn Posts: 193

    Thanks!

Categories

Upcoming Training