hyperledger/fabric · error

collection-name: %s -- maximum peer count (%d) cannot be les

Error message

collection-name: %s -- maximum peer count (%d) cannot be less than the required peer count (%d)

What it means

Returned by validateCollectionConfigs when a collection's MaximumPeerCount is smaller than its RequiredPeerCount — an unsatisfiable gossip dissemination guarantee. Required peers must always be a subset of the maximum.

Source

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

	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 {
			return errors.Errorf("collection-name: %s -- found duplicate in collection configuration",
				c.Name)
		}
		collNamesMap[c.Name] = struct{}{}
		// Validate gossip related parameters present in the collection config
		if c.MaximumPeerCount < c.RequiredPeerCount {
			return errors.Errorf("collection-name: %s -- maximum peer count (%d) cannot be less than the required peer count (%d)",
				c.Name, c.MaximumPeerCount, c.RequiredPeerCount)
		}
		if c.RequiredPeerCount < 0 {
			return errors.Errorf("collection-name: %s -- requiredPeerCount (%d) cannot be less than zero",
				c.Name, c.RequiredPeerCount)
		}
		if err := validateCollectionConfigMemberOrgsPolicy(c, mspMgr); err != nil {
			return err
		}
	}
	return nil
}

// validateCollectionConfigMemberOrgsPolicy checks whether the supplied collection configuration
// complies to the given msp configuration
func validateCollectionConfigMemberOrgsPolicy(coll *pb.StaticCollectionConfig, mspMgr msp.MSPManager) error {
	if coll.MemberOrgsPolicy == nil {
		return errors.Errorf("collection member policy is not set for collection '%s'", coll.Name)

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Set maximumPeerCount >= requiredPeerCount in the collection definition
  2. Review the gossip dissemination parameters in the collections config
Defensive patterns

Strategy: validation

When it happens

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