{"record":{"id":"b107ca7802819abf","repo":"hyperledger/fabric","slug":"could-not-get-application-config-for-channel-s-b107ca","errorCode":null,"errorMessage":"could not get application config for channel '%s'","messagePattern":"could not get application config for channel '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/lifecycle/endorsement_info.go","lineNumber":124,"sourceCode":"// 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 {\n\t\tchaincodeInfo.InstallInfo = &ChaincodeInstallInfo{}\n\t}\n\n\treturn &ChaincodeEndorsementInfo{","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/lifecycle/endorsement_info.go#L106-L142","documentation":"ChaincodeEndorsementInfo obtains the channel config successfully but channelConfig.ApplicationConfig() reports !ok, so the application capabilities cannot be checked (specifically LifecycleV20()) before routing to LegacyImpl or the new lifecycle. A well-formed application channel always has an Application config group, so this signals a malformed or non-application channel config.","triggerScenarios":"ChaincodeEndorsementInfo executes GetStableChannelConfig then ApplicationConfig() during endorsement, and the channel config snapshot lacks the /Channel/Application group.","commonSituations":"Channel config block corrupted or hand-crafted without Application section; unusual/system-style channel used for chaincode invocation; config update stripped the Application group.","solutions":["Inspect the latest config block and verify the Application group and capabilities exist.","Regenerate and apply a correct channel config from configtx.yaml (with Application capabilities set, e.g. V2_0).","Perform a config update to restore the Application section if it was removed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Go: ensure capabilities are checkable before lifecycle routing\ncc := channelConfigSource.GetStableChannelConfig(channelID)\nac, ok := cc.ApplicationConfig()\nif !ok || !ac.Capabilities().LifecycleV20() {\n  // expect legacy routing; anything else indicates a config problem\n}","typeGuard":"func hasLifecycleV20(cc ChannelConfig) bool {\n  ac, ok := cc.ApplicationConfig()\n  return ok && ac.Capabilities().LifecycleV20()\n}","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"could not get application config\") {\n  // regenerate channel config with Application group + capabilities\n}","preventionTips":["Set Application.Capabilities (e.g. V2_0) in configtx.yaml before channel creation.","Validate generated config blocks contain the Application group before genesis.","After any channel update, re-inspect ApplicationConfig availability."],"tags":["hyperledger-fabric","endorsement","application-config","capabilities"],"backgroundTag":"channel-config-missing-application-group","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"}