hyperledger/fabric · error
could not get application config for channel '%s'
Error message
could not get application config for channel '%s'
What it means
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.
Source
Thrown at core/chaincode/lifecycle/deployedcc_infoprovider.go:273
MemberOrgsPolicy: &pb.CollectionPolicyConfig{
Payload: &pb.CollectionPolicyConfig_SignaturePolicy{
SignaturePolicy: policydsl.SignedByMspMember(mspid),
},
},
RequiredPeerCount: int32(requiredPeerCount),
MaximumPeerCount: int32(maxPeerCount),
}
}
func (vc *ValidatorCommitter) ImplicitCollectionEndorsementPolicyAsBytes(channelID, orgMSPID string) (policy []byte, unexpectedErr, validationErr error) {
channelConfig := vc.Resources.ChannelConfigSource.GetStableChannelConfig(channelID)
if channelConfig == nil {
return nil, errors.Errorf("could not get channel config for channel '%s'", channelID), nil
}
ac, ok := channelConfig.ApplicationConfig()
if !ok {
return nil, errors.Errorf("could not get application config for channel '%s'", channelID), nil
}
matchedOrgName := ""
for orgName, org := range ac.Organizations() {
if org.MSPID() == orgMSPID {
matchedOrgName = orgName
break
}
}
if matchedOrgName == "" {
return nil, nil, errors.Errorf("no org found in channel with MSPID '%s'", orgMSPID)
}
policyName := fmt.Sprintf("/Channel/Application/%s/Endorsement", matchedOrgName)
if _, ok := channelConfig.PolicyManager().GetPolicy(policyName); ok {
return protoutil.MarshalOrPanic(&cb.ApplicationPolicy{
Type: &cb.ApplicationPolicy_ChannelConfigPolicyReference{View on GitHub (pinned to 2736b63f8f)
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.
Defensive patterns
Strategy: validation
Validate before calling
// Go: check the config block contains an Application group before operations
config, _ := fetchChannelConfig(channelID)
if config.GetChannelGroup().GetGroups()["Application"] == nil {
return errors.New("channel config missing Application group")
} Type guard
func hasApplicationConfig(cc ChannelConfig) bool {
_, ok := cc.ApplicationConfig(); return ok
} Try / catch
if unexpectedErr != nil {
if strings.Contains(unexpectedErr.Error(), "could not get application config") {
// regenerate channel config from configtx.yaml
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- could not get channel config for channel '%s'
- could not get channel config for channel '%s'
- could not get application config for channel '%s'
- no application config for channel '%s'
- failed to deserialize values
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/bd2cd3832dd94a40.
Report an issue: GitHub.