{"record":{"id":"9b9404b3e38607ad","repo":"hyperledger/fabric","slug":"collection-name-s-collection-member-s-is-n","errorCode":null,"errorMessage":"collection-name: %s -- collection member '%s' is not part of the channel","messagePattern":"collection-name: (.+?) -- collection member '(.+?)' is not part of the channel","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/lifecycle/scc.go","lineNumber":873,"sourceCode":"\n\t// make sure that the orgs listed are actually part of the channel\n\t// check all principals in the signature policy\n\tfor _, principal := range coll.MemberOrgsPolicy.GetSignaturePolicy().Identities {\n\t\tvar orgID string\n\t\t// the member org policy only supports certain principal types\n\t\tswitch principal.PrincipalClassification {\n\n\t\tcase mspprotos.MSPPrincipal_ROLE:\n\t\t\tmsprole := &mspprotos.MSPRole{}\n\t\t\terr := proto.Unmarshal(principal.Principal, msprole)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"collection-name: %s -- cannot unmarshal identity bytes into MSPRole\", coll.GetName())\n\t\t\t}\n\t\t\torgID = msprole.MspIdentifier\n\t\t\t// the msp map is indexed using msp IDs - this behavior is implementation specific, making the following check a bit of a hack\n\t\t\t_, ok := msps[orgID]\n\t\t\tif !ok {\n\t\t\t\treturn errors.Errorf(\"collection-name: %s -- collection member '%s' is not part of the channel\", coll.GetName(), orgID)\n\t\t\t}\n\n\t\tcase mspprotos.MSPPrincipal_ORGANIZATION_UNIT:\n\t\t\tmspou := &mspprotos.OrganizationUnit{}\n\t\t\terr := proto.Unmarshal(principal.Principal, mspou)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"collection-name: %s -- cannot unmarshal identity bytes into OrganizationUnit\", coll.GetName())\n\t\t\t}\n\t\t\torgID = mspou.MspIdentifier\n\t\t\t// the msp map is indexed using msp IDs - this behavior is implementation specific, making the following check a bit of a hack\n\t\t\t_, ok := msps[orgID]\n\t\t\tif !ok {\n\t\t\t\treturn errors.Errorf(\"collection-name: %s -- collection member '%s' is not part of the channel\", coll.GetName(), orgID)\n\t\t\t}\n\n\t\tcase mspprotos.MSPPrincipal_IDENTITY:\n\t\t\tif _, err := mspMgr.DeserializeIdentity(principal.Principal); err != nil {\n\t\t\t\treturn errors.Errorf(\"collection-name: %s -- contains an identity that is not part of the channel\", coll.GetName())","sourceCodeStart":855,"sourceCodeEnd":891,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/lifecycle/scc.go#L855-L891","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Correct the mspid in the collection config to exactly match an org MSP ID defined on the channel (peer channel listcerts / config inspect).","Add the referenced organization to the channel configuration if it should be a member.","Reuse the collection config only on channels that contain all listed orgs."],"exampleFix":"// before\n{\"name\":\"coll1\",\"member_orgs_policy\":{\"identity_policy\":{\"principal\":\"Org3MSP\",\"role\":\"MEMBER\"}}}\n// after (Org3 not on channel; use Org1)\n{\"name\":\"coll1\",\"member_orgs_policy\":{\"identity_policy\":{\"principal\":\"Org1MSP\",\"role\":\"MEMBER\"}}}","handlingStrategy":"validation","validationCode":"channelMSPs := map[string]bool{\"Org1MSP\": true, \"Org2MSP\": true}\nfor _, c := range collections {\n  for _, p := range c.MemberOrgsPolicy.Identities {\n    r, ok := isRolePrincipal(p)\n    if ok && !channelMSPs[r.MspIdentifier] {\n      return fmt.Errorf(\"collection %s references unknown MSP %s\", c.Name, r.MspIdentifier)\n    }\n  }\n}","typeGuard":"func orgOnChannel(mspID string, msps map[string]msp.MSPManager) bool {\n  _, ok := msps[mspID]\n  return ok\n}","tryCatchPattern":"if err := approveChaincode(...); err != nil {\n  if strings.Contains(err.Error(), \"is not part of the channel\") {\n    // fix mspid in collection config and resubmit\n  }\n  return err\n}","preventionTips":["Copy MSP IDs exactly from the channel config, not from memory.","Validate collection MSP IDs against the channel before every approve/commit.","Keep per-channel collection configs separate; never share across channels.","Check for case mismatches in MSP IDs."],"tags":["fabric","private-data","msp","collection-config"],"backgroundTag":"org-not-on-channel","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}