{"record":{"id":"5eec543a0a6c2d08","repo":"hyperledger/fabric","slug":"cannot-obtain-configuration-history-retriever-for","errorCode":null,"errorMessage":"cannot obtain configuration history retriever, for collection <%s> txID <%s> block sequence number <%d> due to <%s>","messagePattern":"cannot obtain configuration history retriever, for collection <(.+?)> txID <(.+?)> block sequence number <(.+?)> due to <(.+?)>","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/privdata/dataretriever.go","lineNumber":141,"sourceCode":"\t\tfor _, data := range pvtData {\n\t\t\tif data.WriteSet == nil {\n\t\t\t\tdr.logger.Warning(\"Received nil write set for collection tx in block\", data.SeqInBlock, \"block number\", blockNum)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// private data doesn't hold rwsets for namespace and collection or\n\t\t\t// belongs to different transaction\n\t\t\tif !data.Has(dig.Namespace, dig.Collection) || data.SeqInBlock != dig.SeqInBlock {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tpvtRWSet := dr.extractPvtRWsets(data.WriteSet.NsPvtRwset, dig.Namespace, dig.Collection)\n\t\t\tpvtRWSetWithConfig.RWSet = append(pvtRWSetWithConfig.RWSet, pvtRWSet...)\n\t\t}\n\n\t\tconfHistoryRetriever, err := dr.committer.GetConfigHistoryRetriever()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"cannot obtain configuration history retriever, for collection <%s>\"+\n\t\t\t\t\" txID <%s> block sequence number <%d> due to <%s>\", dig.Collection, dig.TxId, dig.BlockSeq, err)\n\t\t}\n\n\t\tconfigInfo, err := confHistoryRetriever.MostRecentCollectionConfigBelow(dig.BlockSeq, dig.Namespace)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"cannot find recent collection config update below block sequence = %d,\"+\n\t\t\t\t\" collection name = <%s> for chaincode <%s>\", dig.BlockSeq, dig.Collection, dig.Namespace)\n\t\t}\n\n\t\tif configInfo == nil {\n\t\t\treturn nil, errors.Errorf(\"no collection config update below block sequence = <%d>\"+\n\t\t\t\t\" collection name = <%s> for chaincode <%s> is available \", dig.BlockSeq, dig.Collection, dig.Namespace)\n\t\t}\n\t\tconfigs := extractCollectionConfig(configInfo.CollectionConfig, dig.Collection)\n\t\tif configs == nil {\n\t\t\treturn nil, errors.Errorf(\"no collection config was found for collection <%s>\"+\n\t\t\t\t\" namespace <%s> txID <%s>\", dig.Collection, dig.Namespace, dig.TxId)\n\t\t}","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/privdata/dataretriever.go#L123-L159","documentation":"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.","triggerScenarios":"committer.GetConfigHistoryRetriever() returns an error — config history DB not open, corrupted, or ledger provider failure while serving a reconciliation pull for pvt data.","commonSituations":"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.","solutions":["Check the wrapped error and peer logs for config-history DB open failures.","Restart the peer to re-initialize ledger providers.","Run `peer node rebuild-dbs` if the config history DB is corrupted.","Ensure Fabric version compatibility — the config history DB format changed across releases; upgrade consistently."],"exampleFix":"// before\nconfHistoryRetriever, err := dr.committer.GetConfigHistoryRetriever()\n\n// after: degrade gracefully when retriever is unavailable\nconfHistoryRetriever, err := dr.committer.GetConfigHistoryRetriever()\nif err != nil {\n    logger.Warningf(\"config history unavailable, retrying pull later: %v\", err)\n    return nil, nil // let gossip retry\n}","handlingStrategy":"retry","validationCode":"retriever, err := committer.GetConfigHistoryRetriever()\nif err != nil {\n    return errors.Wrap(err, \"config history not ready\")\n}","typeGuard":"func configHistoryReady(c privdata.Committer) bool {\n    _, err := c.GetConfigHistoryRetriever()\n    return err == nil\n}","tryCatchPattern":"retriever, err := committer.GetConfigHistoryRetriever()\nif err != nil {\n    logger.Warningf(\"config history retriever unavailable (%v), retrying\", err)\n    scheduleRetry()\n    return\n}","preventionTips":["Keep peer DBs healthy; watch config-history leveldb logs.","Use consistent Fabric versions across a network upgrade.","Run rebuild-dbs after restoring from backups.","Ensure disk health on peer data directories."],"tags":["fabric","ledger","config-history","private-data"],"backgroundTag":"config-history-retriever-unavailable","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}