{"record":{"id":"dcc6baace9a13aa7","repo":"hyperledger/fabric","slug":"application-config-does-not-exist-for-s","errorCode":null,"errorMessage":"application config does not exist for %s","messagePattern":"application config does not exist for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/handler.go","lineNumber":611,"sourceCode":"\treturn txContext, nil\n}\n\n// register Txid to prevent overlapping handle messages from chaincode\nfunc (h *Handler) registerTxid(msg *pb.ChaincodeMessage) bool {\n\t// Check if this is the unique state request from this chaincode txid\n\tif h.ActiveTransactions.Add(msg.ChannelId, msg.Txid) {\n\t\treturn true\n\t}\n\n\t// Log the issue and drop the request\n\tchaincodeLogger.Errorf(\"[%s] Another request pending for this CC: %s, Txid: %s, ChannelID: %s. Cannot process.\", shorttxid(msg.Txid), h.chaincodeID, msg.Txid, msg.ChannelId)\n\treturn false\n}\n\nfunc (h *Handler) checkMetadataCap(channelId string) error {\n\tac, exists := h.AppConfig.GetApplicationConfig(channelId)\n\tif !exists {\n\t\treturn errors.Errorf(\"application config does not exist for %s\", channelId)\n\t}\n\n\tif !ac.Capabilities().KeyLevelEndorsement() {\n\t\treturn errors.New(\"key level endorsement is not enabled, channel application capability of V1_3 or later is required\")\n\t}\n\treturn nil\n}\n\nfunc (h *Handler) checkPurgePrivateDataCap(channelId string) error {\n\tac, exists := h.AppConfig.GetApplicationConfig(channelId)\n\tif !exists {\n\t\treturn errors.Errorf(\"application config does not exist for %s\", channelId)\n\t}\n\n\tif !ac.Capabilities().PurgePvtData() {\n\t\treturn errors.New(\"purge private data is not enabled, channel application capability of V2_5 or later is required\")\n\t}\n\treturn nil","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/handler.go#L593-L629","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before calling GetStateMetadata/SetStateMetadata:\n// ensure channel exists & joined\n// $ peer channel list  -> confirm channelId present\nif !joinedChannels.Contains(channelId) {\n    return fmt.Errorf(\"channel %s not joined on this peer\", channelId)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["hyperledger-fabric","channel-config","metadata","capabilities"],"backgroundTag":"missing-application-config","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"}