{"record":{"id":"0048aeb6c81236a6","repo":"hyperledger/fabric","slug":"channel-s-doesn-t-exist-0048ae","errorCode":null,"errorMessage":"channel %s doesn't exist","messagePattern":"channel (.+?) doesn't exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"discovery/support/acl/support.go","lineNumber":91,"sourceCode":"\t// No sequence if the channel is empty\n\tif channel == \"\" {\n\t\treturn 0\n\t}\n\tconf := s.GetChannelConfig(channel)\n\tif conf == nil {\n\t\tlogger.Panic(\"Failed obtaining channel config for channel\", channel)\n\t}\n\tv := conf.ConfigtxValidator()\n\tif v == nil {\n\t\tlogger.Panic(\"ConfigtxValidator for channel\", channel, \"is nil\")\n\t}\n\treturn v.Sequence()\n}\n\nfunc (s *DiscoverySupport) SatisfiesPrincipal(channel string, rawIdentity []byte, principal *msp.MSPPrincipal) error {\n\tconf := s.GetChannelConfig(channel)\n\tif conf == nil {\n\t\treturn errors.Errorf(\"channel %s doesn't exist\", channel)\n\t}\n\tmspMgr := conf.MSPManager()\n\tif mspMgr == nil {\n\t\treturn errors.Errorf(\"could not find MSP manager for channel %s\", channel)\n\t}\n\tidentity, err := mspMgr.DeserializeIdentity(rawIdentity)\n\tif err != nil {\n\t\tlogger.Warnw(\"failed deserializing identity\", \"error\", err, \"identity\", protoutil.LogMessageForSerializedIdentity(rawIdentity))\n\t\treturn errors.Wrap(err, \"failed deserializing identity\")\n\t}\n\treturn identity.SatisfiesPrincipal(principal)\n}\n\n// ChannelPolicyManagerGetter is a support interface\n// to get access to the policy manager of a given channel\ntype ChannelPolicyManagerGetter interface {\n\t// Returns the policy manager associated to the passed channel\n\t// and true if it was the manager requested, or false if it is the default manager","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/discovery/support/acl/support.go#L73-L109","documentation":"The discovery service's ACL check (SatisfiesPrincipal) resolves the channel's config via GetChannelConfig before evaluating a principal. If no channel config exists for the requested channel name, the channel does not exist on this peer and the authorization cannot proceed. This is the peer telling the client it asked about a channel that isn't joined.","triggerScenarios":"Sending a discovery request (endorsement, config, membership, or peers query) whose AuthInfo.Channel targets a channel the peer has not joined, or a misspelled/nonexistent channel name.","commonSituations":"Typos in the channel name in the SDK/client config; client assuming the peer joined all channels; channel was deleted or the peer was removed from it; stale connection profile after channel reconfiguration.","solutions":["Verify the channel name matches exactly the channel the peer joined (peer channel list)","Join the peer to the channel or route the discovery request to a peer that is joined","Fix typos/case in the channel name in your connection profile or client code"],"exampleFix":"// before\nreq.AddLocalPeersQuery() // AuthInfo.Channel: \"mychanel\" (typo)\n// after\nreq.AddLocalPeersQuery() // AuthInfo.Channel: \"mychannel\" — verify with `peer channel list`","handlingStrategy":"validation","validationCode":"// before issuing discovery:\nout, err := exec.Command(\"peer\", \"channel\", \"list\").Output()\nif !strings.Contains(string(out), channelID) {\n    return fmt.Errorf(\"peer not joined to channel %s\", channelID)\n}","typeGuard":"func peerKnowsChannel(joinedChannels []string, ch string) bool {\n    for _, c := range joinedChannels {\n        if c == ch { return true }\n    }\n    return false\n}","tryCatchPattern":"res, err := client.Send(ctx, req)\nif err != nil {\n    if strings.Contains(err.Error(), \"doesn't exist\") {\n        // fall back to another peer or fix channel name\n    }\n    return err\n}","preventionTips":["Copy channel names from `peer channel list` output, not memory","Keep the connection profile in sync with actual peer channel membership","Verify case-sensitive exact channel IDs"],"tags":["fabric","discovery","channel","authorization"],"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"}