{"record":{"id":"bc1b3274423913ab","repo":"hyperledger/fabric","slug":"error-checking-chaincode-instantiation-policy-msp","errorCode":null,"errorMessage":"error checking chaincode instantiation policy: MSP manager for channel %s not found","messagePattern":"error checking chaincode instantiation policy: MSP manager for channel (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/scc/lscc/support.go","lineNumber":78,"sourceCode":"\t\t// to be able to instantiate\n\t\tmspids := s.GetMSPIDs(channel)\n\n\t\tp := policydsl.SignedByAnyAdmin(mspids)\n\t\tip, err = protoutil.Marshal(p)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"error marshalling default instantiation policy\")\n\t\t}\n\t}\n\treturn ip, nil\n}\n\n// CheckInstantiationPolicy checks whether the supplied signed proposal\n// complies with the supplied instantiation policy\nfunc (s *SupportImpl) CheckInstantiationPolicy(signedProp *pb.SignedProposal, chainName string, instantiationPolicy []byte) error {\n\t// create a policy object from the policy bytes\n\tidd := s.GetIdentityDeserializer(chainName)\n\tif idd == nil {\n\t\treturn errors.Errorf(\"error checking chaincode instantiation policy: MSP manager for channel %s not found\", chainName)\n\t}\n\tnpp := cauthdsl.NewPolicyProvider(idd)\n\tinstPol, _, err := npp.NewPolicy(instantiationPolicy)\n\tif err != nil {\n\t\treturn err\n\t}\n\tproposal, err := protoutil.UnmarshalProposal(signedProp.ProposalBytes)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// get the signature header of the proposal\n\theader, err := protoutil.UnmarshalHeader(proposal.Header)\n\tif err != nil {\n\t\treturn err\n\t}\n\tshdr, err := protoutil.UnmarshalSignatureHeader(header.SignatureHeader)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/scc/lscc/support.go#L60-L96","documentation":"CheckInstantiationPolicy validates a signed proposal against a chaincode's instantiation policy. It needs the channel's identity deserializer, which comes from the channel's MSP manager. If the deserializer is nil, the MSP manager for that channel does not exist, so the policy cannot be evaluated and this error is thrown.","triggerScenarios":"Calling CheckInstantiationPolicy (e.g. during LSCC deploy/instantiate validation) with a chainName for which GetIdentityDeserializer returns nil — i.e. the channel is unknown to the peer or its MSP manager has not been initialized.","commonSituations":"Instantiating chaincode on a channel the peer has not joined; channel config/MSP not yet loaded; typo in channel name; peer restarted before channel resources were restored.","solutions":["Ensure the peer has joined the channel (peer channel join) before instantiate","Verify the channel name passed matches an existing joined channel exactly","Check that the channel genesis/config with MSP definitions loaded correctly in peer logs","Restart the peer so channel resources (including MSP manager) are initialized"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify the peer has joined the channel and MSP manager exists first\n// e.g. run: peer channel list | grep <channelName>\n// and confirm channel config with MSPs was loaded","typeGuard":null,"tryCatchPattern":"if err := lscc.CheckInstantiationPolicy(signedProp, chainName, instPolicy); err != nil {\n    if strings.Contains(err.Error(), \"MSP manager for channel\") {\n        // channel not joined / not initialized: join channel or fix channel name\n    }\n    return err\n}","preventionTips":["Join the channel before instantiating chaincode","Double-check channel name spelling","Confirm peer logs show the channel MSP manager initialized","Restart peer after config changes"],"tags":["fabric","lscc","msp","channel"],"backgroundTag":"msp-manager-not-found","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"}