hyperledger/fabric · error

cannot obtain configuration history retriever, for collectio

Error message

cannot obtain configuration history retriever, for collection <%s> txID <%s> block sequence number <%d> due to <%s>

What it means

To resolve collection configs as of a past block, the retriever asks the committer for a config-history retriever. If that internal dependency cannot be obtained (config history DB unavailable), the error reports the collection, txID, and block sequence with the wrapped cause. It signals a ledger subsystem failure, not a data-mismatch problem.

Source

Thrown at gossip/privdata/dataretriever.go:141

		for _, data := range pvtData {
			if data.WriteSet == nil {
				dr.logger.Warning("Received nil write set for collection tx in block", data.SeqInBlock, "block number", blockNum)
				continue
			}

			// private data doesn't hold rwsets for namespace and collection or
			// belongs to different transaction
			if !data.Has(dig.Namespace, dig.Collection) || data.SeqInBlock != dig.SeqInBlock {
				continue
			}

			pvtRWSet := dr.extractPvtRWsets(data.WriteSet.NsPvtRwset, dig.Namespace, dig.Collection)
			pvtRWSetWithConfig.RWSet = append(pvtRWSetWithConfig.RWSet, pvtRWSet...)
		}

		confHistoryRetriever, err := dr.committer.GetConfigHistoryRetriever()
		if err != nil {
			return nil, errors.Errorf("cannot obtain configuration history retriever, for collection <%s>"+
				" txID <%s> block sequence number <%d> due to <%s>", dig.Collection, dig.TxId, dig.BlockSeq, err)
		}

		configInfo, err := confHistoryRetriever.MostRecentCollectionConfigBelow(dig.BlockSeq, dig.Namespace)
		if err != nil {
			return nil, errors.Errorf("cannot find recent collection config update below block sequence = %d,"+
				" collection name = <%s> for chaincode <%s>", dig.BlockSeq, dig.Collection, dig.Namespace)
		}

		if configInfo == nil {
			return nil, errors.Errorf("no collection config update below block sequence = <%d>"+
				" collection name = <%s> for chaincode <%s> is available ", dig.BlockSeq, dig.Collection, dig.Namespace)
		}
		configs := extractCollectionConfig(configInfo.CollectionConfig, dig.Collection)
		if configs == nil {
			return nil, errors.Errorf("no collection config was found for collection <%s>"+
				" namespace <%s> txID <%s>", dig.Collection, dig.Namespace, dig.TxId)
		}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Check the wrapped error and peer logs for config-history DB open failures.
  2. Restart the peer to re-initialize ledger providers.
  3. Run `peer node rebuild-dbs` if the config history DB is corrupted.
  4. Ensure Fabric version compatibility — the config history DB format changed across releases; upgrade consistently.

Example fix

// before
confHistoryRetriever, err := dr.committer.GetConfigHistoryRetriever()

// after: degrade gracefully when retriever is unavailable
confHistoryRetriever, err := dr.committer.GetConfigHistoryRetriever()
if err != nil {
    logger.Warningf("config history unavailable, retrying pull later: %v", err)
    return nil, nil // let gossip retry
}
Defensive patterns

Strategy: retry

Validate before calling

retriever, err := committer.GetConfigHistoryRetriever()
if err != nil {
    return errors.Wrap(err, "config history not ready")
}

Type guard

func configHistoryReady(c privdata.Committer) bool {
    _, err := c.GetConfigHistoryRetriever()
    return err == nil
}

Try / catch

retriever, err := committer.GetConfigHistoryRetriever()
if err != nil {
    logger.Warningf("config history retriever unavailable (%v), retrying", err)
    scheduleRetry()
    return
}

Prevention

When it happens

Trigger: committer.GetConfigHistoryRetriever() returns an error — config history DB not open, corrupted, or ledger provider failure while serving a reconciliation pull for pvt data.

Common situations: Peer starting while pvt-data reconciliation fires; leveldb corruption in the configHistory sub-DB; disk I/O failures; migrations between Fabric versions leaving the DB inconsistent.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/5eec543a0a6c2d08. Report an issue: GitHub.