{"record":{"id":"bcf790c1bd44dbf5","repo":"hyperledger/fabric","slug":"collection-config-contains-unexpected-payload-type","errorCode":null,"errorMessage":"collection config contains unexpected payload type: %T","messagePattern":"collection config contains unexpected payload type: %T","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/lifecycle/scc.go","lineNumber":791,"sourceCode":"}\n\nfunc extractStaticCollectionConfigs(collConfigPkg *pb.CollectionConfigPackage) ([]*pb.StaticCollectionConfig, error) {\n\tif collConfigPkg == nil || len(collConfigPkg.Config) == 0 {\n\t\treturn nil, nil\n\t}\n\tcollConfigs := make([]*pb.StaticCollectionConfig, len(collConfigPkg.Config))\n\tfor i, c := range collConfigPkg.Config {\n\t\tswitch t := c.Payload.(type) {\n\t\tcase *pb.CollectionConfig_StaticCollectionConfig:\n\t\t\tcollConfig := t.StaticCollectionConfig\n\t\t\tif collConfig == nil {\n\t\t\t\treturn nil, errors.Errorf(\"collection configuration is empty\")\n\t\t\t}\n\t\t\tcollConfigs[i] = collConfig\n\t\tdefault:\n\t\t\t// this should only occur if a developer has added a new\n\t\t\t// collection config type\n\t\t\treturn nil, errors.Errorf(\"collection config contains unexpected payload type: %T\", t)\n\t\t}\n\t}\n\treturn collConfigs, nil\n}\n\nfunc validateCollectionConfigs(collConfigs []*pb.StaticCollectionConfig, mspMgr msp.MSPManager) error {\n\tif len(collConfigs) == 0 {\n\t\treturn nil\n\t}\n\tcollNamesMap := map[string]struct{}{}\n\t// Process each collection config from a set of collection configs\n\tfor _, c := range collConfigs {\n\t\tif !collectionNameRegExp.MatchString(c.Name) {\n\t\t\treturn errors.Errorf(\"invalid collection name '%s'. Names can only consist of alphanumerics, '_', and '-' and cannot begin with '_'\",\n\t\t\t\tc.Name)\n\t\t}\n\t\t// Ensure that there are no duplicate collection names\n\t\tif _, ok := collNamesMap[c.Name]; ok {","sourceCodeStart":773,"sourceCodeEnd":809,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/lifecycle/scc.go#L773-L809","documentation":"extractStaticCollectionConfigs default case: a CollectionConfig entry in the package carries a payload type other than StaticCollectionConfig — only possible if a new collection config type was added to the protos and this peer doesn't understand it.","triggerScenarios":"Thrown at core/chaincode/lifecycle/scc.go:791 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove non-static (e.g. transient-dynamic) collection configs from the package submitted to this peer","Upgrade the peer to a Fabric version that supports the new collection config type"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}