{"record":{"id":"11933723fc36979b","repo":"hyperledger/fabric","slug":"confighistoryretriever-is-not-available","errorCode":null,"errorMessage":"configHistoryRetriever is not available","messagePattern":"configHistoryRetriever is not available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/privdata/reconcile.go","lineNumber":236,"sourceCode":"\t\t\t\t\tcollectionConfigCache[collConfigKey] = collectionConfig\n\t\t\t\t}\n\t\t\t\tdigKey := privdatacommon.DigKey{\n\t\t\t\t\tSeqInBlock: seqInBlock,\n\t\t\t\t\tCollection: pvtDataInfo.Collection,\n\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))","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/privdata/reconcile.go#L218-L254","documentation":"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.","triggerScenarios":"Reconciler.getDig2CollectionConfig() -> getMostRecentCollectionConfig() when GetConfigHistoryRetriever() returns an error, typically during early peer startup or when the ledger for the channel is not yet open.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"retriever, err := r.GetConfigHistoryRetriever()\nif err != nil {\n    log.Warningf(\"config history retriever not ready yet: %v\", err)\n    return // defer to next reconciliation tick\n}","typeGuard":null,"tryCatchPattern":"cfg, minB, maxB, err := r.getDig2CollectionConfig(digs)\nif err != nil {\n    log.Warningf(\"skipping reconciliation pass, config history unavailable: %v\", err)\n    return // retried on next scheduler tick\n}","preventionTips":["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."],"tags":["hyperledger-fabric","gossip","private-data","ledger-initialization"],"backgroundTag":"service-not-initialized","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"}