{"record":{"id":"2b4a455038ef9050","repo":"hyperledger/fabric","slug":"key-level-endorsement-is-not-enabled-channel-appl","errorCode":null,"errorMessage":"key level endorsement is not enabled, channel application capability of V1_3 or later is required","messagePattern":"key level endorsement is not enabled, channel application capability of V1_3 or later is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/handler.go","lineNumber":615,"sourceCode":"func (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\n}\n\nfunc errorIfCreatorHasNoReadPermission(chaincodeName, collection string, txContext *TransactionContext) error {\n\trwPermission, err := getReadWritePermission(chaincodeName, collection, txContext)","sourceCodeStart":597,"sourceCodeEnd":633,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/handler.go#L597-L633","documentation":"checkMetadataCap requires the channel's application capabilities to include KeyLevelEndorsement (V1_3 or later application capability). This error is thrown when the app config exists but the channel is configured at an older application capability level, so GetStateMetadata/PutStateMetadata (key-level endorsement state APIs) are disallowed.","triggerScenarios":"Chaincode calls SetStateMetadata/GetStateMetadata on a channel whose Application capabilities section in configtx.yaml is set to V1_2 or lower; after upgrading Fabric binaries without updating the channel capability.","commonSituations":"Fabric network upgraded from v1.2/v1.3 to v2.x but channel application capabilities left at V1_2; developers testing key-level endorsement on legacy test channels; capability update ordering mistakes (capabilities must be enabled before using the APIs).","solutions":["Update the channel's Application capabilities to V1_3 or later (e.g. V2_0) via a channel config update transaction","Ensure ordering of capability updates: orderer, then channel, then application capabilities","Use configtxlator/configtxgen to edit and re-sign the updated channel config","After update, restart/re-verify the peer sees the new capability before retrying the metadata call"],"exampleFix":"// before: configtx.yaml\n# Capabilities:\n#   Application: &ApplicationCapabilities\n#     V1_2: true\n// after\nCapabilities:\n  Application: &ApplicationCapabilities\n    V2_0: true","handlingStrategy":"validation","validationCode":"// check the channel's application capability before using metadata APIs:\n// $ peer channel getinfo -c mychannel\n// or fetch config and inspect: config.channel_group.groups.Application.values.Capabilities\nif appCapability(mychannel) < \"V1_3\" {\n    return fmt.Errorf(\"enable KeyLevelEndorsement: upgrade app capability to >= V1_3\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin minimum channel capabilities in network docs/CI checks before deploying chaincode using key-level endorsement","Include capability update steps in network upgrade runbooks (orderer → channel → application)","Validate configtx.yaml capabilities with configtxgen before committing updates"],"tags":["hyperledger-fabric","capabilities","key-level-endorsement","channel-config"],"backgroundTag":"capability-not-enabled","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"}