{"record":{"id":"900519eb78ed61ae","repo":"hyperledger/fabric","slug":"peer-s-is-defined-in-the-channel-config-but-doe","errorCode":null,"errorMessage":"peer '%s' is defined in the channel config but doesn't have associated peer config","messagePattern":"peer '(.+?)' is defined in the channel config but doesn't have associated peer config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/chaincode/common.go","lineNumber":325,"sourceCode":"\t}\n\n\treturn nil\n}\n\nfunc validatePeerConnectionParameters(cmdName string) error {\n\tif connectionProfile != common.UndefinedParamValue {\n\t\tnetworkConfig, err := common.GetConfig(connectionProfile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(networkConfig.Channels[channelID].Peers) != 0 {\n\t\t\tpeerAddresses = []string{}\n\t\t\ttlsRootCertFiles = []string{}\n\t\t\tfor peer, peerChannelConfig := range networkConfig.Channels[channelID].Peers {\n\t\t\t\tif peerChannelConfig.EndorsingPeer {\n\t\t\t\t\tpeerConfig, ok := networkConfig.Peers[peer]\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\treturn errors.Errorf(\"peer '%s' is defined in the channel config but doesn't have associated peer config\", peer)\n\t\t\t\t\t}\n\t\t\t\t\tpeerAddresses = append(peerAddresses, peerConfig.URL)\n\t\t\t\t\ttlsRootCertFiles = append(tlsRootCertFiles, peerConfig.TLSCACerts.Path)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// currently only support multiple peer addresses for invoke\n\tmultiplePeersAllowed := map[string]bool{\n\t\t\"invoke\": true,\n\t}\n\t_, ok := multiplePeersAllowed[cmdName]\n\tif !ok && len(peerAddresses) > 1 {\n\t\treturn errors.Errorf(\"'%s' command can only be executed against one peer. received %d\", cmdName, len(peerAddresses))\n\t}\n\n\tif len(tlsRootCertFiles) > len(peerAddresses) {","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/chaincode/common.go#L307-L343","documentation":"This error comes from validatePeerConnectionParameters when a peer is listed in the channel's configuration (networkConfig.Channels[channelID].Peers) with endorsing rights, but there is no corresponding entry in the local peer config (networkConfig.Peers). The CLI cannot build a peer address/TLS cert list because the peer's URL and TLS CA certs are unknown.","triggerScenarios":"Running an invoke/endorsement command where channel config references a peer that lacks a matching section in the local core.yaml / connection profile peers map, and --peerAddresses was not supplied explicitly.","commonSituations":"Stale or incomplete connection profile missing the peer under the top-level 'peers' section, channel config updated on the orderer to add a peer before local config was updated, typo between the peer name in channels.<channel>.peers and peers.<name>.","solutions":["Add a matching entry for the peer under the 'peers' section of your connection profile / local config","Pass --peerAddresses (and --tlsRootCertFiles) explicitly so the CLI doesn't derive peers from channel config","Compare the peer keys in channels.<channelID>.peers vs peers and fix the name mismatch","Refresh the connection profile after any channel config reconfiguration"],"exampleFix":"# before (channels.mychannel.peers lists peer0.org2 but peers section lacks it)\n# after\nchannels:\n  mychannel:\n    peers:\n      peer0.org2.example.com:\n        endorsingPeer: true\npeers:\n  peer0.org2.example.com:\n    url: grpcs://peer0.org2.example.com:7051\n    tlsCACerts:\n      path: /path/to/org2-ca.crt","handlingStrategy":"validation","validationCode":"# connection profile check: every endorsing peer under channels.<c>.peers must exist under peers\nfor p in $(yq e '.channels.mychannel.peers | keys | .[]' cp.yaml); do\n  yq e \".peers.$p\" cp.yaml >/dev/null || { echo \"peer $p missing from peers section\"; exit 1; }\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the peers section of your connection profile in sync with channel config","Pass --peerAddresses explicitly when scripting against known peers","Re-fetch the connection profile after channel reconfiguration","Verify peer names match exactly (case-sensitive) between sections"],"tags":["hyperledger-fabric","network-config","channel-config","endorsement"],"backgroundTag":"inconsistent-network-config","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"}