{"record":{"id":"189901b051131fda","repo":"hyperledger/fabric","slug":"policy-manager-for-channel-s-doesn-t-exist","errorCode":null,"errorMessage":"policy manager for channel %s doesn't exist","messagePattern":"policy manager for channel (.+?) doesn't exist","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"discovery/support/acl/support.go","lineNumber":134,"sourceCode":"\t\tPolicy:                     policy,\n\t\tChannelPolicyManagerGetter: polMgr,\n\t}\n}\n\n// ChannelVerifier verifies a signature and a message on the context of a channel\ntype ChannelVerifier struct {\n\tpolicies.ChannelPolicyManagerGetter\n\tPolicy string\n}\n\n// VerifyByChannel checks that signature is a valid signature of message\n// under a peer's verification key, but also in the context of a specific channel.\n// If the verification succeeded, Verify returns nil meaning no error occurred.\n// If peerIdentity is nil, then the verification fails.\nfunc (cv *ChannelVerifier) VerifyByChannel(channel string, sd *protoutil.SignedData) error {\n\tmgr := cv.Manager(channel)\n\tif mgr == nil {\n\t\treturn errors.Errorf(\"policy manager for channel %s doesn't exist\", channel)\n\t}\n\tpol, _ := mgr.GetPolicy(cv.Policy)\n\tif pol == nil {\n\t\treturn errors.New(\"failed obtaining channel application writers policy\")\n\t}\n\treturn pol.EvaluateSignedData([]*protoutil.SignedData{sd})\n}\n","sourceCodeStart":116,"sourceCodeEnd":142,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/discovery/support/acl/support.go#L116-L142","documentation":"ChannelVerifier.VerifyByChannel verifies a discovery request's signature against the channel's Application writers policy. Before fetching the policy it looks up the channel's policy manager; if none exists for the channel, verification aborts with this error — again meaning the peer doesn't know this channel.","triggerScenarios":"A signed discovery request with AuthInfo.Channel naming a channel whose policy manager lookup (cv.Manager(channel)) returns nil — the peer has no policy manager registered for that channel.","commonSituations":"Discovery request sent to a peer not joined to the channel; channel name typo; ledger/policy manager not yet initialized because the peer hasn't finished starting or the channel genesis block is missing.","solutions":["Confirm the peer is joined to the channel (peer channel list) and that the name matches exactly","Restart the peer and verify the channel's genesis block/ledger initialized cleanly","Send the discovery request to a peer that is a member of the target channel"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if !slices.Contains(joinedChannels, channelID) {\n    return fmt.Errorf(\"peer not joined to channel %s\", channelID)\n}","typeGuard":"func channelKnown(channels []string, ch string) bool {\n    return slices.Contains(channels, ch)\n}","tryCatchPattern":"res, err := client.Send(ctx, req)\nif err != nil {\n    if strings.Contains(err.Error(), \"policy manager\") && strings.Contains(err.Error(), \"doesn't exist\") {\n        // target a different peer or correct the channel\n    }\n    return err\n}","preventionTips":["Send discovery only to peers joined to the target channel","Wait for peer startup/ledger init to complete before discovery","Validate channel IDs against the network inventory"],"tags":["fabric","discovery","policy","channel"],"backgroundTag":"channel-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"}