hyperledger/fabric · error
cannot find recent collection config update below block sequ
Error message
cannot find recent collection config update below block sequence = %d for chaincode %s
What it means
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.
Source
Thrown at gossip/privdata/reconcile.go:241
Namespace: pvtDataInfo.Namespace,
BlockSeq: blockNum,
}
dig2collectionCfg[digKey] = collectionConfigCache[collConfigKey]
}
}
}
return dig2collectionCfg, minBlock, maxBlock
}
func (r *Reconciler) getMostRecentCollectionConfig(chaincodeName string, collectionName string, blockNum uint64) (*peer.StaticCollectionConfig, error) {
configHistoryRetriever, err := r.GetConfigHistoryRetriever()
if err != nil {
return nil, errors.Wrap(err, "configHistoryRetriever is not available")
}
configInfo, err := configHistoryRetriever.MostRecentCollectionConfigBelow(blockNum, chaincodeName)
if err != nil {
return nil, errors.New(fmt.Sprintf("cannot find recent collection config update below block sequence = %d for chaincode %s", blockNum, chaincodeName))
}
if configInfo == nil {
return nil, errors.New(fmt.Sprintf("no collection config update below block sequence = %d for chaincode %s is available", blockNum, chaincodeName))
}
collectionConfig := extractCollectionConfig(configInfo.CollectionConfig, collectionName)
if collectionConfig == nil {
return nil, errors.New(fmt.Sprintf("no collection config was found for collection %s for chaincode %s", collectionName, chaincodeName))
}
staticCollectionConfig, wasCastingSuccessful := collectionConfig.Payload.(*peer.CollectionConfig_StaticCollectionConfig)
if !wasCastingSuccessful {
return 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))
}
return staticCollectionConfig.StaticCollectionConfig, nil
}
func (r *Reconciler) preparePvtDataToCommit(elements []*protosgossip.PvtDataElement) []*ledger.ReconciledPvtdata {View on GitHub (pinned to 2736b63f8f)
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.
Defensive patterns
Strategy: validation
Validate before calling
// verify chaincode/collection exist in channel definition before reconciling
collectionJSON, _ := exec.Command("peer", "chaincode", "list", "collections",
"-C", channelID, "--chaincode", chaincodeName).Output()
if len(collectionJSON) == 0 {
log.Warningf("no collections defined for chaincode %s; skip reconcile", chaincodeName)
} Try / catch
cfg, err := r.getMostRecentCollectionConfig(cc, coll, blockNum)
if err != nil {
if strings.Contains(err.Error(), "cannot find recent collection config update") {
log.Warningf("no config history for %s below block %d; skipping", cc, blockNum)
return
}
return err
} Prevention
- 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.
When it happens
Trigger: getMostRecentCollectionConfig called (via getDig2CollectionConfig) for a chaincode/block combination where the config history index has no collection-config-update record below blockNum.
Common situations: 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.
Related errors
- no collection config update below block sequence = %d for ch
- no collection config was found for collection %s for chainco
- expected collection config of type CollectionConfig_StaticCo
- block from orderer could not be re-marshaled: proto: Marshal
- collection-name: %s -- maximum peer count (%d) cannot be les
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/32c07779d42160eb.
Report an issue: GitHub.