{"record":{"id":"f04ba8ed444526a5","repo":"hyperledger/fabric","slug":"unknown-collection-configuration-type-f04ba8","errorCode":null,"errorMessage":"unknown collection configuration type","messagePattern":"unknown collection configuration type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v13/lscc_validation_logic.go","lineNumber":66,"sourceCode":"\t\tData:      env.Payload,\n\t\tIdentity:  shdr.Creator,\n\t\tSignature: env.Signature,\n\t}}\n\terr = vscc.policyEvaluator.Evaluate(instantiationPolicy, sd)\n\tif err != nil {\n\t\treturn policyErr(fmt.Errorf(\"chaincode instantiation policy violated, error %s\", err))\n\t}\n\treturn nil\n}\n\nfunc validateNewCollectionConfigs(newCollectionConfigs []*pb.CollectionConfig) error {\n\tnewCollectionsMap := make(map[string]bool, len(newCollectionConfigs))\n\t// Process each collection config from a set of collection configs\n\tfor _, newCollectionConfig := range newCollectionConfigs {\n\n\t\tnewCollection := newCollectionConfig.GetStaticCollectionConfig()\n\t\tif newCollection == nil {\n\t\t\treturn errors.New(\"unknown collection configuration type\")\n\t\t}\n\n\t\t// Ensure that there are no duplicate collection names\n\t\tcollectionName := newCollection.GetName()\n\n\t\tif err := validateCollectionName(collectionName); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif _, ok := newCollectionsMap[collectionName]; !ok {\n\t\t\tnewCollectionsMap[collectionName] = true\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"collection-name: %s -- found duplicate collection configuration\", collectionName)\n\t\t}\n\n\t\t// Validate gossip related parameters present in the collection config\n\t\tmaximumPeerCount := newCollection.GetMaximumPeerCount()\n\t\trequiredPeerCount := newCollection.GetRequiredPeerCount()","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v13/lscc_validation_logic.go#L48-L84","documentation":"When validating collection updates in an upgrade rwset, each CollectionConfig must contain a StaticCollectionConfig payload. If the oneof payload resolves to nil (unknown/unset config type), the transaction is rejected because only static collections are supported.","triggerScenarios":"An lscc UPGRADE whose rwset collection updates include a CollectionConfig whose inner message is not a StaticCollectionConfig (e.g. unset or a future/unknown type).","commonSituations":"SDKs or tools writing collection config protobufs without setting the static payload; protobuf version mismatches dropping the payload; hand-edited collections.json assembled into the wrong wrapper type.","solutions":["Regenerate the collection configuration so each entry is a proper StaticCollectionConfig inside CollectionConfig","Use the peer's collection config format (collections-config JSON) with the standard CLI/SDK","Ensure the SDK/proto versions match the peer's Fabric release"],"exampleFix":"// before\ncollection config entry missing \"type\" payload / malformed oneof\n// after\n{\"name\":\"col1\",\"policy\":\"OR('Org1MSP.member')\",\"requiredPeerCount\":1,\"maxPeerCount\":2,\"blockToLive\":0}\npeer chaincode upgrade ... --collections-config collections.json","handlingStrategy":"validation","validationCode":"for (const c of collectionUpdates) {\n  if (!c.staticCollectionConfig || !c.staticCollectionConfig.name) {\n    throw new Error('CollectionConfig must contain a StaticCollectionConfig payload');\n  }\n}","typeGuard":"function isStaticCollection(c) {\n  return c != null && typeof c === 'object' && 'staticCollectionConfig' in c && c.staticCollectionConfig !== null;\n}","tryCatchPattern":"try {\n  await upgradeContract.submitTransaction(..., collectionJson);\n} catch (e) {\n  if (String(e).includes('unknown collection configuration type')) {\n    // fix collections-config JSON and resubmit\n  }\n}","preventionTips":["Author collections config in the documented JSON format","Validate collections.json against the Fabric proto schema in CI","Keep SDK proto definitions in sync with the Fabric release"],"tags":["hyperledger-fabric","private-data","collections","vscc"],"backgroundTag":"invalid-collection-config","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"}