Welcome to the Linux Foundation Forum!

Lab 6 - Invalid policy

Options

I got error running this script to upgrade my chaincode.

peer chaincode upgrade -n ccForaLL -v 1.1 -C allarewelcome -c '{"Args":["Mach","50"]}' -P "AND('Org1.peer', 'Org2.peer' OR ('Org1.peer, Org2.peer))"

Response:

Error: invalid policy AND('Org1.peer', 'Org2.peer' OR ('Org1.peer, Org2.peer))
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg cannot get package for chaincode (ccForaLL:1.1)

Comments

  • hanesoliveira
    Options

    Hi @PaulAmehUgw1!

    The PDF has some typos and you need to fix it when issuing commands. In this case try to complete the missing single quotes for Org1.peer and Org2.peer.

  • PaulAmehUgw1
    Options

    @hanesoliveira I did tried that earlier and the result was the same:

    peer chaincode upgrade -n ccForAll -v 1.1 -C allarewelcome -c '{"Args":["Mach","50"]}' -P "AND('Org1.peer', 'Org2.peer' OR ('Org1.peer, Org2.peer'))"

    Response:

    2019-06-20 02:56:23.367 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default escc
    2019-06-20 02:56:23.367 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 005 Using default vscc
    Error: invalid policy AND('Org1.peer', 'Org2.peer' OR ('Org1.peer, Org2.peer'))
    Usage:
    peer chaincode upgrade [flags]

    Flags:
    -C, --channelID string The channel on which this command should be executed
    --collections-config string The fully qualified path to the collection JSON file including the

    And then, I modified the command with this:

    peer chaincode upgrade -n ccForAll -v 1.1 -C allarewelcome -c '{"Args":["Mach","50"]}' -P "AND('Org1.peer', OR ('Org1.member'))"

    peer chaincode list --instantiated -C allarewelcome

    Response:
    Get instantiated chaincodes on channel allarewelcome:
    Name: ccForAll, Version: 1.1, Path: github.com/sacc, Escc: escc, Vscc: vscc

    Could it be that the initial upgrade policy is inaccurate?

  • kmyatt
    kmyatt Posts: 39
    Options

    The pdf was a missing comma in the policy which has been updated and will be in the next pdf version that will be release . For those experiencing an issue. Rerun with the below command:

    peer chaincode upgrade -n ccForAll -v 1.1 -C allarewelcome-c '{"Args": ["Mach","50"]}' -P "AND('Org1.peer', 'Org2.peer', OR('Org1.peer','Org2.peer'))"

  • kmyatt
    kmyatt Posts: 39
    edited June 2019
    Options

    @PaulAmehUgw1 Not inaccurate, just missing a comma in the policy. Simple(small) typo in the pdf, as @hanesoliveira mentioned prior .

    Keep up the great work guys!

Categories

Upcoming Training