hyperledger/fabric · error
application config does not exist for %s
Error message
application config does not exist for %s
What it means
checkMetadataCap validates that the given channel has an application config and that key-level endorsement is enabled before serving GetStateMetadata or PutStateMetadata. This error is returned when the peer cannot find an application configuration for channelId — typically the channel doesn't exist on this peer, the channel id is wrong, or the channel is not yet fully configured/joined.
Source
Thrown at core/chaincode/handler.go:611
return txContext, nil
}
// register Txid to prevent overlapping handle messages from chaincode
func (h *Handler) registerTxid(msg *pb.ChaincodeMessage) bool {
// Check if this is the unique state request from this chaincode txid
if h.ActiveTransactions.Add(msg.ChannelId, msg.Txid) {
return true
}
// Log the issue and drop the request
chaincodeLogger.Errorf("[%s] Another request pending for this CC: %s, Txid: %s, ChannelID: %s. Cannot process.", shorttxid(msg.Txid), h.chaincodeID, msg.Txid, msg.ChannelId)
return false
}
func (h *Handler) checkMetadataCap(channelId string) error {
ac, exists := h.AppConfig.GetApplicationConfig(channelId)
if !exists {
return errors.Errorf("application config does not exist for %s", channelId)
}
if !ac.Capabilities().KeyLevelEndorsement() {
return errors.New("key level endorsement is not enabled, channel application capability of V1_3 or later is required")
}
return nil
}
func (h *Handler) checkPurgePrivateDataCap(channelId string) error {
ac, exists := h.AppConfig.GetApplicationConfig(channelId)
if !exists {
return errors.Errorf("application config does not exist for %s", channelId)
}
if !ac.Capabilities().PurgePvtData() {
return errors.New("purge private data is not enabled, channel application capability of V2_5 or later is required")
}
return nilView on GitHub (pinned to 2736b63f8f)
Solutions
- Verify the channel id passed to the metadata API exactly matches a channel the peer has joined (peer channel list)
- Join the peer to the channel and wait for the channel config/gossip to initialize before calling metadata APIs
- Check that the chaincode is instantiated on the intended channel, not another one
- Inspect peer logs for channel config load errors
Defensive patterns
Strategy: validation
Validate before calling
// before calling GetStateMetadata/SetStateMetadata:
// ensure channel exists & joined
// $ peer channel list -> confirm channelId present
if !joinedChannels.Contains(channelId) {
return fmt.Errorf("channel %s not joined on this peer", channelId)
} Prevention
- Keep a single source of truth for channel names (config/constant) to avoid typos
- Join peers to the channel before deploying/invoking chaincode that uses metadata APIs
- After channel creation, wait for config propagation before metadata calls
When it happens
Trigger: Chaincode sends GET_STATE_METADATA or PUT_STATE_METADATA for a channelId where h.AppConfig.GetApplicationConfig returns exists=false: chaincode joined to the wrong channel, typo'd channel name, channel not yet joined/initialized on the peer, or metadata API called before the channel config is loaded.
Common situations: Developers calling SetStateMetadata/GetStateMetadata against a channel the peer hasn't joined; deploying the same chaincode instance expecting multiple channels; channel creation still propagating; misspelled channel name in tooling.
Related errors
- key level endorsement is not enabled, channel application ca
- Failed capabilities check: [%s]
- %s capability %s is required but not supported
- failed to deserialize values
- illegal orderer config update detected: endpoints of org %s
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/dcc6baace9a13aa7.
Report an issue: GitHub.