hyperledger/fabric · error

purge private data is not enabled, channel application capab

Error message

purge private data is not enabled, channel application capability of V2_5 or later is required

What it means

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.

Source

Thrown at core/chaincode/handler.go:627

	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 nil
}

func errorIfCreatorHasNoReadPermission(chaincodeName, collection string, txContext *TransactionContext) error {
	rwPermission, err := getReadWritePermission(chaincodeName, collection, txContext)
	if err != nil {
		return err
	}
	if !rwPermission.read {
		return errors.Errorf("tx creator does not have read access permission on privatedata in chaincodeName:%s collectionName: %s",
			chaincodeName, collection)
	}
	return nil
}

func errorIfCreatorHasNoWritePermission(chaincodeName, collection string, txContext *TransactionContext) error {
	rwPermission, err := getReadWritePermission(chaincodeName, collection, txContext)

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Update channel Application capabilities to V2_5 or later via a channel config update
  2. Verify the update with configtxlator after the update transaction commits
  3. Ensure all peers and orderers support V2_5 capabilities before enabling them
  4. Retry the purge only after the capability is active channel-wide

Example fix

// before: configtx.yaml
#   V2_0: true
// after
Capabilities:
  Application: &ApplicationCapabilities
    V2_5: true
Defensive patterns

Strategy: validation

Validate before calling

// require V2_5+ app capability before purge paths run:
if appCapability(mychannel) < "V2_5" {
    return fmt.Errorf("purge requires app capability >= V2_5")
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/eb69058efc062eab. Report an issue: GitHub.