hyperledger/fabric · error
empty collection-name is not allowed
Error message
empty collection-name is not allowed
What it means
Returned by validateCollectionName (v12 validation logic) when the collection name in an LSCC-deployed collection config is the empty string. The empty name precedes the regex check and is rejected outright as an unusable collection identifier.
Source
Thrown at core/handlers/validation/builtin/v12/validation_logic.go:349
// 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 {
return err
}
if err := checkForModifiedCollectionsBTL(newCollectionsMap, oldCollectionConfigs); err != nil {
return err
}
return nil
}
func validateCollectionName(collectionName string) error {
if collectionName == "" {
return fmt.Errorf("empty collection-name is not allowed")
}
match := validCollectionNameRegex.FindString(collectionName)
if len(match) != len(collectionName) {
return fmt.Errorf("collection-name: %s not allowed. A valid collection name follows the pattern: %s",
collectionName, AllowedCharsCollectionName)
}
return nil
}
// validateRWSetAndCollection performs validation of the rwset
// of an LSCC deploy operation and then it validates any collection
// configuration.
func (vscc *Validator) validateRWSetAndCollection(
lsccrwset *kvrwset.KVRWSet,
cdRWSet *ccprovider.ChaincodeData,
lsccArgs [][]byte,
lsccFunc string,
ac vc.Capabilities,View on GitHub (pinned to 2736b63f8f)
Solutions
- Provide a non-empty collection name in the collection config
- Fix generation logic that emits unnamed collections
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at core/handlers/validation/builtin/v12/validation_logic.go:349 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/d89b69d9df7d0334.
Report an issue: GitHub.