{"record":{"id":"eb69058efc062eab","repo":"hyperledger/fabric","slug":"purge-private-data-is-not-enabled-channel-applica","errorCode":null,"errorMessage":"purge private data is not enabled, channel application capability of V2_5 or later is required","messagePattern":"purge private data is not enabled, channel application capability of V2_5 or later is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/handler.go","lineNumber":627,"sourceCode":"\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)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !rwPermission.read {\n\t\treturn errors.Errorf(\"tx creator does not have read access permission on privatedata in chaincodeName:%s collectionName: %s\",\n\t\t\tchaincodeName, collection)\n\t}\n\treturn nil\n}\n\nfunc errorIfCreatorHasNoWritePermission(chaincodeName, collection string, txContext *TransactionContext) error {\n\trwPermission, err := getReadWritePermission(chaincodeName, collection, txContext)","sourceCodeStart":609,"sourceCodeEnd":645,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/handler.go#L609-L645","documentation":"purgePrivateData requires the channel application capability to enable PurgePvtData (V2_5 or later application capability). This error is returned when the app config exists but the channel is at an older application capability, so private data purge operations are rejected.","triggerScenarios":"Chaincode invokes a private-data purge (purgePrivateData path) on a channel whose Application capabilities are below V2_5 (e.g., V2_0 or V1_4); Fabric peer upgraded but channel capabilities not yet updated.","commonSituations":"Networks migrated from Fabric 2.0–2.4 to 2.5 that haven't bumped application capabilities; developers testing the new PurgePrivateData feature on older channels; capability update completed only for orderer/channel groups.","solutions":["Update channel Application capabilities to V2_5 or later via a channel config update","Verify the update with configtxlator after the update transaction commits","Ensure all peers and orderers support V2_5 capabilities before enabling them","Retry the purge only after the capability is active channel-wide"],"exampleFix":"// before: configtx.yaml\n#   V2_0: true\n// after\nCapabilities:\n  Application: &ApplicationCapabilities\n    V2_5: true","handlingStrategy":"validation","validationCode":"// require V2_5+ app capability before purge paths run:\nif appCapability(mychannel) < \"V2_5\" {\n    return fmt.Errorf(\"purge requires app capability >= V2_5\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Upgrade channel application capabilities to V2_5 as part of the Fabric 2.5 migration checklist","Gate purge code paths behind runtime capability checks","Test purge on a non-production channel after the capability update"],"tags":["hyperledger-fabric","capabilities","private-data","purge"],"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"}