{"record":{"id":"bd2cd3832dd94a40","repo":"hyperledger/fabric","slug":"could-not-get-application-config-for-channel-s-bd2cd3","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/deployedcc_infoprovider.go","lineNumber":273,"sourceCode":"\t\tMemberOrgsPolicy: &pb.CollectionPolicyConfig{\n\t\t\tPayload: &pb.CollectionPolicyConfig_SignaturePolicy{\n\t\t\t\tSignaturePolicy: policydsl.SignedByMspMember(mspid),\n\t\t\t},\n\t\t},\n\t\tRequiredPeerCount: int32(requiredPeerCount),\n\t\tMaximumPeerCount:  int32(maxPeerCount),\n\t}\n}\n\nfunc (vc *ValidatorCommitter) ImplicitCollectionEndorsementPolicyAsBytes(channelID, orgMSPID string) (policy []byte, unexpectedErr, validationErr error) {\n\tchannelConfig := vc.Resources.ChannelConfigSource.GetStableChannelConfig(channelID)\n\tif channelConfig == nil {\n\t\treturn nil, errors.Errorf(\"could not get channel config for channel '%s'\", channelID), nil\n\t}\n\n\tac, ok := channelConfig.ApplicationConfig()\n\tif !ok {\n\t\treturn nil, errors.Errorf(\"could not get application config for channel '%s'\", channelID), nil\n\t}\n\n\tmatchedOrgName := \"\"\n\tfor orgName, org := range ac.Organizations() {\n\t\tif org.MSPID() == orgMSPID {\n\t\t\tmatchedOrgName = orgName\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif matchedOrgName == \"\" {\n\t\treturn nil, nil, errors.Errorf(\"no org found in channel with MSPID '%s'\", orgMSPID)\n\t}\n\n\tpolicyName := fmt.Sprintf(\"/Channel/Application/%s/Endorsement\", matchedOrgName)\n\tif _, ok := channelConfig.PolicyManager().GetPolicy(policyName); ok {\n\t\treturn protoutil.MarshalOrPanic(&cb.ApplicationPolicy{\n\t\t\tType: &cb.ApplicationPolicy_ChannelConfigPolicyReference{","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/lifecycle/deployedcc_infoprovider.go#L255-L291","documentation":"Returned by ImplicitCollectionEndorsementPolicyAsBytes when the channel config exists but ApplicationConfig() returns ok=false, meaning the channel config lacks an application config group. The function needs the application orgs to match the orgMSPID and build the implicit collection endorsement policy. This is surfaced as unexpectedErr since a properly configured application channel must have an Application group.","triggerScenarios":"ImplicitCollectionEndorsementPolicyAsBytes (via CollectionValidationInfo) runs against a channel whose config has no /Channel/Application section — e.g. validating on a channel whose config was fetched from a system-channel-style or otherwise malformed config.","commonSituations":"Channel created with a corrupt or hand-edited config block; attempting to resolve implicit collections on a non-application channel; config update removed the Application group.","solutions":["Inspect the channel's latest config block and confirm the Application group and its Organizations exist.","Re-create the channel from a correct configtx.yaml-generated profile if the Application group is missing.","Update the channel config to add the missing Application section via config update transaction."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Go: check the config block contains an Application group before operations\nconfig, _ := fetchChannelConfig(channelID)\nif config.GetChannelGroup().GetGroups()[\"Application\"] == nil {\n  return errors.New(\"channel config missing Application group\")\n}","typeGuard":"func hasApplicationConfig(cc ChannelConfig) bool {\n  _, ok := cc.ApplicationConfig(); return ok\n}","tryCatchPattern":"if unexpectedErr != nil {\n  if strings.Contains(unexpectedErr.Error(), \"could not get application config\") {\n    // regenerate channel config from configtx.yaml\n  }\n}","preventionTips":["Generate channel configs only from configtx.yaml profiles, never by hand-editing.","Verify configtx.yaml defines Application: Organizations and Capabilities.","After config updates, diff config blocks to confirm Application group intact."],"tags":["hyperledger-fabric","chaincode-lifecycle","channel-config","application-config","implicit-collection"],"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"}