hyperledger/fabric · error
configHistoryRetriever is not available
Error message
configHistoryRetriever is not available
What it means
getMostRecentCollectionConfig needs the ledger's configHistoryRetriever to look up collection configs, fetched via r.GetConfigHistoryRetriever(). If the ledger has not yet initialized its config history service (it becomes available only after the ledger/genesis block is processed), this wrapped error is returned and the dig-to-config mapping cannot be built.
Source
Thrown at gossip/privdata/reconcile.go:236
collectionConfigCache[collConfigKey] = collectionConfig
}
digKey := privdatacommon.DigKey{
SeqInBlock: seqInBlock,
Collection: pvtDataInfo.Collection,
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))View on GitHub (pinned to 2736b63f8f)
Solutions
- Wait for peer startup to complete; the reconciler will retry on its next tick.
- Verify the channel ledger exists and is healthy (peer channel list, ledger logs).
- Check ledger provider logs for errors creating the config history retriever.
- If persistent, rejoin the peer to the channel or restore from a good backup/snapshot.
Defensive patterns
Strategy: retry
Validate before calling
retriever, err := r.GetConfigHistoryRetriever()
if err != nil {
log.Warningf("config history retriever not ready yet: %v", err)
return // defer to next reconciliation tick
} Try / catch
cfg, minB, maxB, err := r.getDig2CollectionConfig(digs)
if err != nil {
log.Warningf("skipping reconciliation pass, config history unavailable: %v", err)
return // retried on next scheduler tick
} Prevention
- Start reconciliation only after the ledger/channel is fully initialized.
- Verify peer completed joining the channel and committing genesis before enabling reconciliation.
- Watch peer startup logs for ledger init failures.
- Use backoff/retry on periodic reconciliation instead of failing hard.
When it happens
Trigger: Reconciler.getDig2CollectionConfig() -> getMostRecentCollectionConfig() when GetConfigHistoryRetriever() returns an error, typically during early peer startup or when the ledger for the channel is not yet open.
Common situations: Peer just started and reconciliation timer fired before ledger initialization; channel/ledger corrupted or missing so ConfigHistoryRetriever cannot be created; reconcile code reached before the first block was committed.
Related errors
- collection config package for %s chaincode is not provided
- Could not obtain collection access policy, collection name %
- No collection access policy filter computed for %v
- required to disseminate to at least %d peers, but know of on
- Failed disseminating %d out of %d private dissemination plan
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/11933723fc36979b.
Report an issue: GitHub.