{"record":{"id":"d8a80ec9b334dd0f","repo":"hyperledger/fabric","slug":"could-not-get-channel-config-for-channel-s-d8a80e","errorCode":null,"errorMessage":"could not get channel config for channel '%s'","messagePattern":"could not get channel config for channel '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/lifecycle/endorsement_info.go","lineNumber":120,"sourceCode":"\treturn chaincodeInfo, true, nil\n}\n\n// ChaincodeEndorsementInfo returns the information necessary to handle a chaincode invocation request, as well as a function to\n// enforce security checks on the chaincode (in case the definition is from the legacy lscc).\nfunc (cei *ChaincodeEndorsementInfoSource) ChaincodeEndorsementInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ChaincodeEndorsementInfo, error) {\n\tif cei.BuiltinSCCs.IsSysCC(chaincodeName) {\n\t\treturn &ChaincodeEndorsementInfo{\n\t\t\tVersion:           scc.SysCCVersion,\n\t\t\tEndorsementPlugin: \"escc\",\n\t\t\tEnforceInit:       false,\n\t\t\tChaincodeID:       scc.ChaincodeID(chaincodeName),\n\t\t}, nil\n\t}\n\n\t// return legacy cc endorsement info if V20 is not enabled\n\tchannelConfig := cei.Resources.ChannelConfigSource.GetStableChannelConfig(channelID)\n\tif channelConfig == nil {\n\t\treturn nil, errors.Errorf(\"could not get channel config for channel '%s'\", channelID)\n\t}\n\tac, ok := channelConfig.ApplicationConfig()\n\tif !ok {\n\t\treturn nil, errors.Errorf(\"could not get application config for channel '%s'\", channelID)\n\t}\n\tif !ac.Capabilities().LifecycleV20() {\n\t\treturn cei.LegacyImpl.ChaincodeEndorsementInfo(channelID, chaincodeName, qe)\n\t}\n\n\tchaincodeInfo, ok, err := cei.CachedChaincodeInfo(channelID, chaincodeName, qe)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !ok {\n\t\treturn cei.LegacyImpl.ChaincodeEndorsementInfo(channelID, chaincodeName, qe)\n\t}\n\n\tif chaincodeInfo.InstallInfo == nil {","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/lifecycle/endorsement_info.go#L102-L138","documentation":"ChaincodeEndorsementInfo calls cei.Resources.ChannelConfigSource.GetStableChannelConfig(channelID) to decide whether V2.0 lifecycle is enabled; when it returns nil this error is raised. It indicates the channel configuration snapshot could not be retrieved for the given channel, so legacy vs. new lifecycle routing cannot be determined.","triggerScenarios":"Endorsement path resolves ChaincodeEndorsementInfo for a chaincode whose cached info isn't available, and the channelID given has no entry in the channel config source (channel not joined/loaded, wrong channel name, or channel resources being destroyed).","commonSituations":"Invoking on a misspelled or nonexistent channel; peer asked to endorse for a channel it is not joined to; race during channel removal or peer shutdown.","solutions":["Confirm the channelID is correct and the peer has joined it (`peer channel list`).","Ensure the channel's config is available to the peer (channel created and ledger opened).","If triggered by a race during channel teardown/update, retry after the channel state stabilizes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Go: pre-flight channel existence before endorsement-sensitive calls\nif vc.Resources.ChannelConfigSource.GetStableChannelConfig(channelID) == nil {\n  return fmt.Errorf(\"channel %s unknown to peer\", channelID)\n}","typeGuard":"func channelKnown(src ChannelConfigSource, ch string) bool { return src.GetStableChannelConfig(ch) != nil }","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"could not get channel config\") {\n  // verify channelID and peer channel membership, retry if racing teardown\n}","preventionTips":["Match the channelID in the signed proposal to a joined channel.","Reject proposals for unknown channels at gateway/service layer.","Add health checks that each expected channel config resolves.","Avoid invoking during peer shutdown or channel deletion."],"tags":["hyperledger-fabric","endorsement","channel-config","chaincode-lifecycle"],"backgroundTag":"channel-config-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"}