{"record":{"id":"64fd2bdb1dc23acc","repo":"hyperledger/fabric","slug":"unknown-collection-configuration-type","errorCode":null,"errorMessage":"unknown collection configuration type","messagePattern":"unknown collection configuration type","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/lifecycle/scc.go","lineNumber":943,"sourceCode":"\t\treturn nil\n\t}\n\n\tif len(proposedCollConfs) == 0 {\n\t\treturn errors.Errorf(\"the proposed collection config does not contain previously defined collections\")\n\t}\n\n\tproposedCollsMap := map[string]*pb.StaticCollectionConfig{}\n\tfor _, c := range proposedCollConfs {\n\t\tproposedCollsMap[c.Name] = c\n\t}\n\n\t// In the new collection config package, ensure that there is one entry per old collection. Any\n\t// number of new collections are allowed.\n\tfor _, committedCollConfig := range committedCollConfPkg.Config {\n\t\tcommittedColl := committedCollConfig.GetStaticCollectionConfig()\n\t\t// It cannot be nil\n\t\tif committedColl == nil {\n\t\t\treturn errors.Errorf(\"unknown collection configuration type\")\n\t\t}\n\n\t\tnewCollection, ok := proposedCollsMap[committedColl.Name]\n\t\tif !ok {\n\t\t\treturn errors.Errorf(\"existing collection [%s] missing in the proposed collection configuration\", committedColl.Name)\n\t\t}\n\n\t\tif newCollection.BlockToLive != committedColl.BlockToLive {\n\t\t\treturn errors.Errorf(\"the BlockToLive in an existing collection [%s] modified. Existing value [%d]\", committedColl.Name, committedColl.BlockToLive)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (i *Invocation) createOpaqueStates() ([]OpaqueState, error) {\n\tif i.ApplicationConfig == nil {\n\t\treturn nil, errors.Errorf(\"no application config for channel '%s'\", i.Stub.GetChannelID())\n\t}","sourceCodeStart":925,"sourceCodeEnd":961,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/lifecycle/scc.go#L925-L961","documentation":"Each entry in a committed collection config package is expected to be a CollectionConfig containing a StaticCollectionConfig. This error is thrown when GetStaticCollectionConfig() returns nil, meaning the committed package holds an unknown collection configuration type that cannot be interpreted.","triggerScenarios":"Validating a proposed collection config against committed data where a committed CollectionConfig entry has no StaticCollectionConfig oneof value set (nil/empty or unknown type in the oneof).","commonSituations":"Corrupted or hand-crafted collection config package persisted to state; protobuf oneof field left unset when building the committed package; data written by incompatible fabric versions or custom tooling.","solutions":["Regenerate and re-commit the chaincode definition with a valid collection config package where each entry has a StaticCollectionConfig.","Inspect the committed package bytes on state to find the malformed entry.","Avoid hand-building CollectionConfig wrappers; ensure CollectionType/static_collection_config is set.","Upgrade tooling/fabric so collection packages are serialized in a compatible format."],"exampleFix":"// before: empty wrapper\nconf := &pb.CollectionConfig{}\n// after\nconf := &pb.CollectionConfig{Payload: &pb.CollectionConfig_StaticCollectionConfig{StaticCollectionConfig: &pb.StaticCollectionConfig{Name: \"coll1\"}}}","handlingStrategy":"type-guard","validationCode":"for _, cc := range committedPkg.Config {\n  if cc.GetStaticCollectionConfig() == nil {\n    return fmt.Errorf(\"committed package contains non-static collection config\")\n  }\n}","typeGuard":"func validCommittedEntry(cc *pb.CollectionConfig) (*pb.StaticCollectionConfig, bool) {\n  sc := cc.GetStaticCollectionConfig()\n  return sc, sc != nil && sc.Name != \"\"\n}","tryCatchPattern":"if err := commit(...); err != nil {\n  if strings.Contains(err.Error(), \"unknown collection configuration type\") {\n    // inspect committed state; rebuild the collection config package with StaticCollectionConfig set\n  }\n  return err\n}","preventionTips":["Always set the StaticCollectionConfig oneof when building CollectionConfig entries.","Round-trip collection packages through marshal/unmarshal before persisting.","Avoid custom tooling writing collection packages directly to state."],"tags":["fabric","private-data","collection-config","corrupt-state"],"backgroundTag":"unknown-collection-config-type","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"}