hyperledger/fabric · error

collection-name: %s -- found duplicate in collection configu

Error message

collection-name: %s -- found duplicate in collection configuration

What it means

Returned by validateCollectionConfigs when the same collection name appears more than once in the collection config package. Duplicate names would make private-data dissemination ambiguous, so the second occurrence is rejected.

Source

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

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

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Deduplicate the collection definitions in the collections config
  2. Check for copy-paste errors where two collections share a name
Defensive patterns

Strategy: validation

When it happens

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