hyperledger/fabric · error
invalid collection configuration supplied for chaincode %s:%
Error message
invalid collection configuration supplied for chaincode %s:%s
What it means
Returned by v13 validateRWSetAndCollection when a chaincode being deployed/upgraded has a collection config that fails validation (bad name, counts, or member policy). It wraps the specific collection failure for the named chaincode and version.
Source
Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:295
return &commonerrors.VSCCExecutionFailureError{
Err: fmt.Errorf("unable to check whether collection existed earlier for chaincode %s:%s",
cdRWSet.Name, cdRWSet.Version),
}
}
}
if ccp != nil {
return policyErr(fmt.Errorf("collection data should not exist for chaincode %s:%s", cdRWSet.Name, cdRWSet.Version))
}
}
// TODO: Once the new chaincode lifecycle is available (FAB-8724), the following validation
// and other validation performed in ValidateLSCCInvocation can be moved to LSCC itself.
newCollectionConfigPackage := &pb.CollectionConfigPackage{}
if collectionsConfigArg != nil {
err := proto.Unmarshal(collectionsConfigArg, newCollectionConfigPackage)
if err != nil {
return policyErr(fmt.Errorf("invalid collection configuration supplied for chaincode %s:%s",
cdRWSet.Name, cdRWSet.Version))
}
} else {
return nil
}
if ac.V1_2Validation() {
newCollectionConfigs := newCollectionConfigPackage.GetConfig()
if err := validateNewCollectionConfigs(newCollectionConfigs); err != nil {
return policyErr(err)
}
if lsccFunc == lscc.UPGRADE {
collectionCriteria := privdata.CollectionCriteria{Channel: channelName, Namespace: cdRWSet.Name}
// oldCollectionConfigPackage denotes the existing collection config package in the ledger
oldCollectionConfigPackage, err := privdata.RetrieveCollectionConfigPackageFromState(collectionCriteria, state)
if err != nil {View on GitHub (pinned to 2736b63f8f)
Solutions
- Serialize a valid CollectionConfigPackage in the deploy transaction
- Check for SDK/protobuf version mismatches producing bad bytes
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:295 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/442f58b207281bc9.
Report an issue: GitHub.