hyperledger/fabric · error

Rule-all instantiation policies should match(%d, %d)

Error message

Rule-all instantiation policies should match(%d, %d)

What it means

ValidateCip byte-compared the InstantiationPolicy fields of the two packages and they differ. Owners must agree on the instantiation policy; mismatched policies cannot be combined into one installable package.

Source

Thrown at core/common/ccpackage/ccpackage.go:74

		return errors.New("endorsements should either be both nil or not nil")
	}

	bN := len(baseCip.OwnerEndorsements)
	oN := len(otherCip.OwnerEndorsements)
	if bN > 1 || oN > 1 {
		return errors.New("expect utmost 1 endorsement from a owner")
	}

	if bN != oN {
		return fmt.Errorf("Rule-all packages should be endorsed or none should be endorsed failed for (%d, %d)", bN, oN)
	}

	if !bytes.Equal(baseCip.ChaincodeDeploymentSpec, otherCip.ChaincodeDeploymentSpec) {
		return fmt.Errorf("Rule-all deployment specs should match(%d, %d)", len(baseCip.ChaincodeDeploymentSpec), len(otherCip.ChaincodeDeploymentSpec))
	}

	if !bytes.Equal(baseCip.InstantiationPolicy, otherCip.InstantiationPolicy) {
		return fmt.Errorf("Rule-all instantiation policies should match(%d, %d)", len(baseCip.InstantiationPolicy), len(otherCip.InstantiationPolicy))
	}

	return nil
}

func createSignedCCDepSpec(cdsbytes []byte, instpolicybytes []byte, endorsements []*peer.Endorsement) (*common.Envelope, error) {
	if cdsbytes == nil {
		return nil, errors.New("nil chaincode deployment spec")
	}

	if instpolicybytes == nil {
		return nil, errors.New("nil instantiation policy")
	}

	// create SignedChaincodeDeploymentSpec...
	cip := &peer.SignedChaincodeDeploymentSpec{ChaincodeDeploymentSpec: cdsbytes, InstantiationPolicy: instpolicybytes, OwnerEndorsements: endorsements}

	// ...and marshal it

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Regenerate packages with the same instantiation policy bytes for all owners
  2. Check for policy-file drift between owners and re-sign
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/common/ccpackage/ccpackage.go:74 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/041ad7a9108f4a85. Report an issue: GitHub.