{"record":{"id":"71b6d6e881ccc6f3","repo":"hyperledger/fabric","slug":"expected-collection-config-of-type-collectionconfi","errorCode":null,"errorMessage":"expected collection config of type CollectionConfig_StaticCollectionConfig for collection %s for chaincode %s, while got different config type...","messagePattern":"expected collection config of type CollectionConfig_StaticCollectionConfig for collection (.+?) for chaincode (.+?), while got different config type\\.\\.\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/privdata/reconcile.go","lineNumber":254,"sourceCode":"\t\treturn nil, errors.Wrap(err, \"configHistoryRetriever is not available\")\n\t}\n\n\tconfigInfo, err := configHistoryRetriever.MostRecentCollectionConfigBelow(blockNum, chaincodeName)\n\tif err != nil {\n\t\treturn nil, errors.New(fmt.Sprintf(\"cannot find recent collection config update below block sequence = %d for chaincode %s\", blockNum, chaincodeName))\n\t}\n\tif configInfo == nil {\n\t\treturn nil, errors.New(fmt.Sprintf(\"no collection config update below block sequence = %d for chaincode %s is available\", blockNum, chaincodeName))\n\t}\n\n\tcollectionConfig := extractCollectionConfig(configInfo.CollectionConfig, collectionName)\n\tif collectionConfig == nil {\n\t\treturn nil, errors.New(fmt.Sprintf(\"no collection config was found for collection %s for chaincode %s\", collectionName, chaincodeName))\n\t}\n\n\tstaticCollectionConfig, wasCastingSuccessful := collectionConfig.Payload.(*peer.CollectionConfig_StaticCollectionConfig)\n\tif !wasCastingSuccessful {\n\t\treturn nil, errors.New(fmt.Sprintf(\"expected collection config of type CollectionConfig_StaticCollectionConfig for collection %s for chaincode %s, while got different config type...\", collectionName, chaincodeName))\n\t}\n\treturn staticCollectionConfig.StaticCollectionConfig, nil\n}\n\nfunc (r *Reconciler) preparePvtDataToCommit(elements []*protosgossip.PvtDataElement) []*ledger.ReconciledPvtdata {\n\trwSetByBlockByKeys := r.groupRwsetByBlock(elements)\n\n\t// populate the private RWSets passed to the ledger\n\tvar pvtDataToCommit []*ledger.ReconciledPvtdata\n\n\tfor blockNum, rwSetKeys := range rwSetByBlockByKeys {\n\t\tblockPvtData := &ledger.ReconciledPvtdata{\n\t\t\tBlockNum:  blockNum,\n\t\t\tWriteSets: make(map[uint64]*ledger.TxPvtData),\n\t\t}\n\t\tfor seqInBlock, nsRWS := range rwSetKeys.bySeqsInBlock() {\n\t\t\trwsets := nsRWS.toRWSet()\n\t\t\tr.logger.Debugf(\"Preparing to commit [%d] private write set, missed from transaction index [%d] of block number [%d]\", len(rwsets.NsPvtRwset), seqInBlock, blockNum)","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/privdata/reconcile.go#L236-L272","documentation":"The collection config entry found in the config history is a CollectionConfig oneof whose Payload is not a CollectionConfig_StaticCollectionConfig. The reconciler only supports static collections, so it rejects any other payload type (e.g. future/dynamic collection types) with this error.","triggerScenarios":"getMostRecentCollectionConfig (via getDig2CollectionConfig) when the type assertion collectionConfig.Payload.(*peer.CollectionConfig_StaticCollectionConfig) fails for the retrieved collection config entry.","commonSituations":"A collection config in the ledger uses a non-static collection type (not supported by this Fabric version's reconciler), or a protobuf produced by a newer Fabric version is stored in config history and read by an older peer.","solutions":["Use only static collections in collection definitions; convert to static collections and upgrade the chaincode.","Ensure all peers run a Fabric version that agrees with the stored config protobufs (avoid mixed-version config writes).","Inspect the stored collection config payload to confirm the actual payload type.","Upgrade the peer binary if a newer release adds support for the payload type."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if cfg, ok := collectionConfig.Payload.(*peer.CollectionConfig_StaticCollectionConfig); !ok {\n    log.Warningf(\"unsupported collection config type %T; skipping\", collectionConfig.Payload)\n    return\n}","typeGuard":"func isStaticCollectionConfig(cc *peer.CollectionConfig) (*peer.StaticCollectionConfig, bool) {\n    s, ok := cc.GetPayload().(*peer.CollectionConfig_StaticCollectionConfig)\n    if !ok {\n        return nil, false\n    }\n    return s.StaticCollectionConfig, true\n}","tryCatchPattern":"staticCfg, ok := isStaticCollectionConfig(collectionConfig)\nif !ok {\n    return nil, fmt.Errorf(\"unsupported collection config type for collection %s\", collectionName)\n}","preventionTips":["Define only static collections in collection configs.","Keep all peers on a Fabric version that understands the stored config protobufs.","Avoid mixed-version writes to config history during rolling upgrades.","Log %T of unexpected payloads to aid diagnosis."],"tags":["hyperledger-fabric","gossip","collection-config","protobuf"],"backgroundTag":"unsupported-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"}