hyperledger/fabric · error

collection config contains unexpected payload type: %T

Error message

collection config contains unexpected payload type: %T

What it means

extractStaticCollectionConfigs default case: a CollectionConfig entry in the package carries a payload type other than StaticCollectionConfig — only possible if a new collection config type was added to the protos and this peer doesn't understand it.

Source

Thrown at core/chaincode/lifecycle/scc.go:791

}

func extractStaticCollectionConfigs(collConfigPkg *pb.CollectionConfigPackage) ([]*pb.StaticCollectionConfig, error) {
	if collConfigPkg == nil || len(collConfigPkg.Config) == 0 {
		return nil, nil
	}
	collConfigs := make([]*pb.StaticCollectionConfig, len(collConfigPkg.Config))
	for i, c := range collConfigPkg.Config {
		switch t := c.Payload.(type) {
		case *pb.CollectionConfig_StaticCollectionConfig:
			collConfig := t.StaticCollectionConfig
			if collConfig == nil {
				return nil, errors.Errorf("collection configuration is empty")
			}
			collConfigs[i] = collConfig
		default:
			// this should only occur if a developer has added a new
			// collection config type
			return nil, errors.Errorf("collection config contains unexpected payload type: %T", t)
		}
	}
	return collConfigs, nil
}

func validateCollectionConfigs(collConfigs []*pb.StaticCollectionConfig, mspMgr msp.MSPManager) error {
	if len(collConfigs) == 0 {
		return nil
	}
	collNamesMap := map[string]struct{}{}
	// Process each collection config from a set of collection configs
	for _, c := range collConfigs {
		if !collectionNameRegExp.MatchString(c.Name) {
			return errors.Errorf("invalid collection name '%s'. Names can only consist of alphanumerics, '_', and '-' and cannot begin with '_'",
				c.Name)
		}
		// Ensure that there are no duplicate collection names
		if _, ok := collNamesMap[c.Name]; ok {

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Remove non-static (e.g. transient-dynamic) collection configs from the package submitted to this peer
  2. Upgrade the peer to a Fabric version that supports the new collection config type
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/chaincode/lifecycle/scc.go:791 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/bcf790c1bd44dbf5. Report an issue: GitHub.