hyperledger/fabric · error · VSCCEndorsementPolicyError

the BlockToLive in the following existing collections must n

Error message

the BlockToLive in the following existing collections must not be modified: %v

What it means

checkForModifiedCollectionsBTL found one or more existing collections whose BlockToLive differs between the old and new config during upgrade. BTL is immutable for existing collections to prevent retroactive purge-window changes (FAB-7810).

Source

Thrown at core/handlers/validation/builtin/v12/validation_logic.go:318

	// modified for the existing collections.
	for _, oldCollectionConfig := range oldCollectionConfigs {

		oldCollection := oldCollectionConfig.GetStaticCollectionConfig()
		// It cannot be nil
		if oldCollection == nil {
			return policyErr(fmt.Errorf("unknown collection configuration type"))
		}

		oldCollectionName := oldCollection.GetName()
		newCollection := newCollectionsMap[oldCollectionName]
		// BlockToLive cannot be changed
		if newCollection.GetBlockToLive() != oldCollection.GetBlockToLive() {
			modifiedCollectionsBTL = append(modifiedCollectionsBTL, oldCollectionName)
		}
	}

	if len(modifiedCollectionsBTL) > 0 {
		return policyErr(fmt.Errorf("the BlockToLive in the following existing collections must not be modified: %v",
			modifiedCollectionsBTL))
	}

	return nil
}

func validateNewCollectionConfigsAgainstOld(newCollectionConfigs []*pb.CollectionConfig, oldCollectionConfigs []*pb.CollectionConfig,
) error {
	newCollectionsMap := make(map[string]*pb.StaticCollectionConfig, len(newCollectionConfigs))

	for _, newCollectionConfig := range newCollectionConfigs {
		newCollection := newCollectionConfig.GetStaticCollectionConfig()
		// Collection object itself is stored as value so that we can
		// check whether the block to live is changed -- FAB-7810
		newCollectionsMap[newCollection.GetName()] = newCollection
	}

	if err := checkForMissingCollections(newCollectionsMap, oldCollectionConfigs); err != nil {

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Keep BlockToLive unchanged for existing collections in the upgrade config
  2. Define desired BTL only on newly added collections
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/handlers/validation/builtin/v12/validation_logic.go:318 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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