{"record":{"id":"cedf46d65ca73f58","repo":"hyperledger/fabric","slug":"failed-to-get-config-for-channel-s-w","errorCode":null,"errorMessage":"failed to get config for channel [%s]: %w","messagePattern":"failed to get config for channel \\[(.+?)\\]: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pkg/gateway/registry.go","lineNumber":390,"sourceCode":"// Connect to peers in channel, and add to the registry.  If a reconnection is required, then it must be removed\n// from the registry first, using removeEndorser().\nfunc (reg *registry) connectChannelPeers(channel string, force bool) error {\n\treg.configLock.Lock() // take a write lock to populate the registry maps\n\tdefer reg.configLock.Unlock()\n\n\tif !force && reg.channelInitialized[channel] {\n\t\treturn nil\n\t}\n\n\t// get the remoteEndorsers for the channel\n\tpeers := map[string]string{}\n\tfor _, member := range reg.channelMembers(channel) {\n\t\tid := member.PKIid.String()\n\t\tpeers[id] = member.PreferredEndpoint()\n\t}\n\tconfig, err := reg.discovery.Config(channel)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get config for channel [%s]: %w\", channel, err)\n\t}\n\tfor mspid, infoset := range reg.discovery.IdentityInfo().ByOrg() {\n\t\tvar tlsRootCerts [][]byte\n\t\tif mspInfo, ok := config.GetMsps()[mspid]; ok {\n\t\t\ttlsRootCerts = append(tlsRootCerts, mspInfo.GetTlsRootCerts()...)\n\t\t\ttlsRootCerts = append(tlsRootCerts, mspInfo.GetTlsIntermediateCerts()...)\n\t\t}\n\t\tfor _, info := range infoset {\n\t\t\tpkiID := info.PKIId\n\t\t\tif address, ok := peers[pkiID.String()]; ok {\n\t\t\t\t// add the peer to the peer map - except the local peer, which seems to have an empty address\n\t\t\t\tif _, ok := reg.remoteEndorsers[address]; !ok && len(address) > 0 {\n\t\t\t\t\t// this peer is new - connect to it and add to the remoteEndorsers registry\n\t\t\t\t\tendorser, err := reg.endpointFactory.newEndorser(pkiID, address, mspid, tlsRootCerts)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\treg.remoteEndorsers[address] = endorser","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/pkg/gateway/registry.go#L372-L408","documentation":"connectChannelPeers: retrieving the channel's configuration (via the config query used to map members to endpoints) failed; the %w cause is wrapped, so the registry cannot (re)connect the channel's peers. Callers (Evaluate, lookupEndorser) fail the request.","triggerScenarios":"Thrown at internal/pkg/gateway/registry.go:390 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check peer connectivity to ordering service/other peers for config data","Retry once transient network issues resolve","Verify the channel exists and the peer has joined it"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}