hyperledger/fabric · error

collection-name: %s -- collection member '%s' is not part of

Error message

collection-name: %s -- collection member '%s' is not part of the channel

What it means

When a ROLE-class principal in a collection's member orgs policy is successfully unmarshaled, its MspIdentifier (org MSP ID) is looked up in the channel's MSP map. This error is thrown when the MSP ID is not present in the channel, meaning the collection names a member org that is not a member of the channel.

Source

Thrown at core/chaincode/lifecycle/scc.go:873

	// make sure that the orgs listed are actually part of the channel
	// check all principals in the signature policy
	for _, principal := range coll.MemberOrgsPolicy.GetSignaturePolicy().Identities {
		var orgID string
		// the member org policy only supports certain principal types
		switch principal.PrincipalClassification {

		case mspprotos.MSPPrincipal_ROLE:
			msprole := &mspprotos.MSPRole{}
			err := proto.Unmarshal(principal.Principal, msprole)
			if err != nil {
				return errors.Wrapf(err, "collection-name: %s -- cannot unmarshal identity bytes into MSPRole", coll.GetName())
			}
			orgID = msprole.MspIdentifier
			// the msp map is indexed using msp IDs - this behavior is implementation specific, making the following check a bit of a hack
			_, ok := msps[orgID]
			if !ok {
				return errors.Errorf("collection-name: %s -- collection member '%s' is not part of the channel", coll.GetName(), orgID)
			}

		case mspprotos.MSPPrincipal_ORGANIZATION_UNIT:
			mspou := &mspprotos.OrganizationUnit{}
			err := proto.Unmarshal(principal.Principal, mspou)
			if err != nil {
				return errors.Wrapf(err, "collection-name: %s -- cannot unmarshal identity bytes into OrganizationUnit", coll.GetName())
			}
			orgID = mspou.MspIdentifier
			// the msp map is indexed using msp IDs - this behavior is implementation specific, making the following check a bit of a hack
			_, ok := msps[orgID]
			if !ok {
				return errors.Errorf("collection-name: %s -- collection member '%s' is not part of the channel", coll.GetName(), orgID)
			}

		case mspprotos.MSPPrincipal_IDENTITY:
			if _, err := mspMgr.DeserializeIdentity(principal.Principal); err != nil {
				return errors.Errorf("collection-name: %s -- contains an identity that is not part of the channel", coll.GetName())

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Correct the mspid in the collection config to exactly match an org MSP ID defined on the channel (peer channel listcerts / config inspect).
  2. Add the referenced organization to the channel configuration if it should be a member.
  3. Reuse the collection config only on channels that contain all listed orgs.

Example fix

// before
{"name":"coll1","member_orgs_policy":{"identity_policy":{"principal":"Org3MSP","role":"MEMBER"}}}
// after (Org3 not on channel; use Org1)
{"name":"coll1","member_orgs_policy":{"identity_policy":{"principal":"Org1MSP","role":"MEMBER"}}}
Defensive patterns

Strategy: validation

Validate before calling

channelMSPs := map[string]bool{"Org1MSP": true, "Org2MSP": true}
for _, c := range collections {
  for _, p := range c.MemberOrgsPolicy.Identities {
    r, ok := isRolePrincipal(p)
    if ok && !channelMSPs[r.MspIdentifier] {
      return fmt.Errorf("collection %s references unknown MSP %s", c.Name, r.MspIdentifier)
    }
  }
}

Type guard

func orgOnChannel(mspID string, msps map[string]msp.MSPManager) bool {
  _, ok := msps[mspID]
  return ok
}

Try / catch

if err := approveChaincode(...); err != nil {
  if strings.Contains(err.Error(), "is not part of the channel") {
    // fix mspid in collection config and resubmit
  }
  return err
}

Prevention

When it happens

Trigger: Approving or committing a chaincode definition whose collection config member_orgs_policy references an MSP ID (mspid field) that does not exist on the channel.

Common situations: Typo in the mspid field of the collection JSON (e.g. Org1MSP vs org1MSP); org removed from or never joined to the channel; reusing a collection config from a different channel.

Related errors


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