{"record":{"id":"32c07779d42160eb","repo":"hyperledger/fabric","slug":"cannot-find-recent-collection-config-update-below-32c077","errorCode":null,"errorMessage":"cannot find recent collection config update below block sequence = %d for chaincode %s","messagePattern":"cannot find recent collection config update below block sequence = (.+?) for chaincode (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/privdata/reconcile.go","lineNumber":241,"sourceCode":"\t\t\t\t\tNamespace:  pvtDataInfo.Namespace,\n\t\t\t\t\tBlockSeq:   blockNum,\n\t\t\t\t}\n\t\t\t\tdig2collectionCfg[digKey] = collectionConfigCache[collConfigKey]\n\t\t\t}\n\t\t}\n\t}\n\treturn dig2collectionCfg, minBlock, maxBlock\n}\n\nfunc (r *Reconciler) getMostRecentCollectionConfig(chaincodeName string, collectionName string, blockNum uint64) (*peer.StaticCollectionConfig, error) {\n\tconfigHistoryRetriever, err := r.GetConfigHistoryRetriever()\n\tif err != nil {\n\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 {","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/privdata/reconcile.go#L223-L259","documentation":"After obtaining the configHistoryRetriever, MostRecentCollectionConfigBelow(blockNum, chaincodeName) failed, meaning no recorded collection config update event exists below the given block sequence for that chaincode in the config history index. The reconciler cannot determine the collection config for the missing private data it wants to pull.","triggerScenarios":"getMostRecentCollectionConfig called (via getDig2CollectionConfig) for a chaincode/block combination where the config history index has no collection-config-update record below blockNum.","commonSituations":"Chaincode data exists in the ledger but its collection was never defined via a lifecycle config update; the peer joined the channel at a block after the config update so earlier config history is absent; corrupted config history index.","solutions":["Verify the chaincode defines the collection and that a collection config update was committed on the channel.","Ensure the peer's ledger includes blocks at/below the config update (peer joined from genesis or a snapshot covering the update).","Check the configHistory ledger index for corruption; rebuild the peer ledger if needed.","Confirm you query with the correct chaincode name and block number."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify chaincode/collection exist in channel definition before reconciling\ncollectionJSON, _ := exec.Command(\"peer\", \"chaincode\", \"list\", \"collections\",\n    \"-C\", channelID, \"--chaincode\", chaincodeName).Output()\nif len(collectionJSON) == 0 {\n    log.Warningf(\"no collections defined for chaincode %s; skip reconcile\", chaincodeName)\n}","typeGuard":null,"tryCatchPattern":"cfg, err := r.getMostRecentCollectionConfig(cc, coll, blockNum)\nif err != nil {\n    if strings.Contains(err.Error(), \"cannot find recent collection config update\") {\n        log.Warningf(\"no config history for %s below block %d; skipping\", cc, blockNum)\n        return\n    }\n    return err\n}","preventionTips":["Ensure collection config updates are committed on the channel before chaincode private data is expected.","Join peers from genesis or snapshots that include config-update blocks.","Verify chaincode name spelling matches the deployed definition.","If the index looks corrupt, rebuild the peer ledger from a snapshot."],"tags":["hyperledger-fabric","gossip","collection-config"],"backgroundTag":"collection-config-not-found","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"}