{"record":{"id":"721ebad64e54461d","repo":"hyperledger/fabric","slug":"failed-to-get-policy-manager-for-channel-s","errorCode":null,"errorMessage":"Failed to get policy manager for channel [%s]","messagePattern":"Failed to get policy manager for channel \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/policy/policy.go","lineNumber":77,"sourceCode":"// CheckPolicy checks that the passed signed proposal is valid with the respect to\n// passed policy on the passed channel.\nfunc (p *policyChecker) CheckPolicy(channelID, policyName string, signedProp *pb.SignedProposal) error {\n\tif channelID == \"\" {\n\t\treturn p.CheckPolicyNoChannel(policyName, signedProp)\n\t}\n\n\tif policyName == \"\" {\n\t\treturn fmt.Errorf(\"Invalid policy name during check policy on channel [%s]. Name must be different from nil.\", channelID)\n\t}\n\n\tif signedProp == nil {\n\t\treturn fmt.Errorf(\"Invalid signed proposal during check policy on channel [%s] with policy [%s]\", channelID, policyName)\n\t}\n\n\t// Get Policy\n\tpolicyManager := p.channelPolicyManagerGetter.Manager(channelID)\n\tif policyManager == nil {\n\t\treturn fmt.Errorf(\"Failed to get policy manager for channel [%s]\", channelID)\n\t}\n\n\t// Prepare SignedData\n\tproposal, err := protoutil.UnmarshalProposal(signedProp.ProposalBytes)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failing extracting proposal during check policy on channel [%s] with policy [%s]: [%s]\", channelID, policyName, err)\n\t}\n\n\theader, err := protoutil.UnmarshalHeader(proposal.Header)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failing extracting header during check policy on channel [%s] with policy [%s]: [%s]\", channelID, policyName, err)\n\t}\n\n\tshdr, err := protoutil.UnmarshalSignatureHeader(header.SignatureHeader)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Invalid Proposal's SignatureHeader during check policy on channel [%s] with policy [%s]: [%s]\", channelID, policyName, err)\n\t}\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/policy/policy.go#L59-L95","documentation":"After validating inputs, CheckPolicy fetches the channel's policy manager via channelPolicyManagerGetter.Manager(channelID); if it returns nil, the channel has no policy manager registered and the check cannot proceed. This means the channel is unknown or its config bundle was never loaded.","triggerScenarios":"Calling CheckPolicy with a channelID that the peer has not joined / initialized, or invoking before the chain is loaded into the peer, or a policyManagerGetter that lacks the channel's bundle.","commonSituations":"Proposals arriving for a channel the peer was not joined to, race between peer start and channel load, typo in channel ID by a client, or channel deleted/config not committed on this peer.","solutions":["Verify the peer has joined the channel (`peer channel list`) and the channel ID spelling matches exactly","Ensure the peer finished Initialize/startup so all chains are loaded before serving proposals","Check ordering service config update was committed so the peer received the channel genesis","If embedding programmatically, use a channelPolicyManagerGetter wired to the peer's channel registry rather than a partial implementation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if channelPolicyManagerGetter.Manager(channelID) == nil {\n    return fmt.Errorf(\"peer has no policy manager for channel %s — is it joined and initialized?\", channelID)\n}","typeGuard":"func channelKnown(g policies.ChannelPolicyManagerGetter, ch string) bool {\n    return g.Manager(ch) != nil\n}","tryCatchPattern":"if err := checker.CheckPolicy(channelID, policyName, signedProp); err != nil {\n    if strings.HasPrefix(err.Error(), \"Failed to get policy manager for channel\") {\n        // verify channel join/init state, then retry or reject proposal\n    }\n    return err\n}","preventionTips":["Confirm `peer channel list` includes the channel before sending it proposals","Verify client-side channel ID spelling matches the joined channel exactly","Allow the peer to finish startup/chain loading before routing traffic to it","Monitor channel join/config-update events so gateways know which channels a peer serves"],"tags":["hyperledger-fabric","policy","channel","policy-manager"],"backgroundTag":"policy-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"}