hyperledger/fabric · error
collection-name: %s -- requiredPeerCount (%d) cannot be less
Error message
collection-name: %s -- requiredPeerCount (%d) cannot be less than zero
What it means
validateNewCollectionConfigs found a collection with a negative RequiredPeerCount. RequiredPeerCount is a dissemination floor and must be zero or positive; -1 is only valid for MaximumPeerCount (meaning unlimited).
Source
Thrown at core/handlers/validation/builtin/v12/validation_logic.go:233
if err := validateCollectionName(collectionName); err != nil {
return err
}
if _, ok := newCollectionsMap[collectionName]; !ok {
newCollectionsMap[collectionName] = true
} else {
return fmt.Errorf("collection-name: %s -- found duplicate collection configuration", collectionName)
}
// Validate gossip related parameters present in the collection config
maximumPeerCount := newCollection.GetMaximumPeerCount()
requiredPeerCount := newCollection.GetRequiredPeerCount()
if maximumPeerCount < requiredPeerCount {
return fmt.Errorf("collection-name: %s -- maximum peer count (%d) cannot be less than the required peer count (%d)",
collectionName, maximumPeerCount, requiredPeerCount)
}
if requiredPeerCount < 0 {
return fmt.Errorf("collection-name: %s -- requiredPeerCount (%d) cannot be less than zero",
collectionName, requiredPeerCount)
}
// make sure that the signature policy is meaningful (only consists of ORs)
err := validateSpOrConcat(newCollection.MemberOrgsPolicy.GetSignaturePolicy().Rule)
if err != nil {
return errors.WithMessagef(err, "collection-name: %s -- error in member org policy", collectionName)
}
}
return nil
}
// validateSpOrConcat checks if the supplied signature policy is just an OR-concatenation of identities.
func validateSpOrConcat(sp *common.SignaturePolicy) error {
if sp.GetNOutOf() == nil {
return nil
}
// check if N == 1 (OR concatenation)View on GitHub (pinned to 2736b63f8f)
Solutions
- Set requiredPeerCount to 0 or a positive integer
- Use maximumPeerCount=-1 for unlimited dissemination instead
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at core/handlers/validation/builtin/v12/validation_logic.go:233 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/1ed222e876e128a3.
Report an issue: GitHub.