{"record":{"id":"27b863380b675ebc","repo":"hyperledger/fabric","slug":"got-nil-as-missingpvtdatatracker-exiting","errorCode":null,"errorMessage":"got nil as MissingPvtDataTracker, exiting...","messagePattern":"got nil as MissingPvtDataTracker, exiting\\.\\.\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gossip/privdata/reconcile.go","lineNumber":135,"sourceCode":"\t\tcase <-time.After(r.ReconcileSleepInterval):\n\t\t\tr.logger.Debug(\"Start reconcile missing private info\")\n\t\t\tif err := r.reconcile(); err != nil {\n\t\t\t\tr.logger.Error(\"Failed to reconcile missing private info, error: \", err.Error())\n\t\t\t}\n\t\t}\n\t}\n}\n\n// returns the number of items that were reconciled , minBlock, maxBlock (blocks range) and an error\nfunc (r *Reconciler) reconcile() error {\n\tmissingPvtDataTracker, err := r.GetMissingPvtDataTracker()\n\tif err != nil {\n\t\tr.logger.Error(\"reconciliation error when trying to get missingPvtDataTracker:\", err)\n\t\treturn err\n\t}\n\tif missingPvtDataTracker == nil {\n\t\tr.logger.Error(\"got nil as MissingPvtDataTracker, exiting...\")\n\t\treturn errors.New(\"got nil as MissingPvtDataTracker, exiting...\")\n\t}\n\ttotalReconciled, minBlock, maxBlock := 0, uint64(math.MaxUint64), uint64(0)\n\n\tdefer r.reportReconciliationDuration(time.Now())\n\n\tfor {\n\t\tmissingPvtDataInfo, err := missingPvtDataTracker.GetMissingPvtDataInfoForMostRecentBlocks(r.ReconcileBatchSize)\n\t\tif err != nil {\n\t\t\tr.logger.Error(\"reconciliation error when trying to get missing pvt data info recent blocks:\", err)\n\t\t\treturn err\n\t\t}\n\t\t// if missingPvtDataInfo is nil, len will return 0\n\t\tif len(missingPvtDataInfo) == 0 {\n\t\t\tif totalReconciled > 0 {\n\t\t\t\tr.logger.Infof(\"Reconciliation cycle finished successfully. reconciled %d private data keys from blocks range [%d - %d]\", totalReconciled, minBlock, maxBlock)\n\t\t\t} else {\n\t\t\t\tr.logger.Debug(\"Reconciliation cycle finished successfully. no items to reconcile\")\n\t\t\t}","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/gossip/privdata/reconcile.go#L117-L153","documentation":"The reconciler obtains a MissingPvtDataTracker from the backing store each run. A nil tracker means the store cannot provide missing-private-data tracking, so reconciliation cannot work and reconcile exits with this error.","triggerScenarios":"r.cs.GetStore().GetMissingPvtDataTracker() returns (nil, nil-or-err) when reconcile runs — the store implementation does not support missing data tracking or is misinitialized.","commonSituations":"Store backend lacking MissingPvtDataTracker support; store not fully initialized at peer startup; miswired dependency in tests/production (cs adapter returning nil).","solutions":["Fix the store implementation to return a valid MissingPvtDataTracker","Ensure the peer's state store is initialized before the reconciler starts","Check the cs (collectionStore/store adapter) wiring — a nil tracker indicates a construction bug"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"tracker, err := store.GetMissingPvtDataTracker()\nif err != nil || tracker == nil { reconcileDisabled = true }","typeGuard":"func trackerReady(t privdata MissingPvtDataTracker, err error) bool { return err == nil && t != nil }","tryCatchPattern":"if err := reconcile(); err != nil && strings.Contains(err.Error(), \"MissingPvtDataTracker\") {\n  // fix store initialization before enabling reconciliation\n}","preventionTips":["Verify the state store supports missing pvtdata tracking before enabling reconciliation","Initialize the store before starting the reconciler goroutine"],"tags":["hyperledger-fabric","reconciliation","private-data","nil-tracker"],"backgroundTag":"nil-missing-pvtdata-tracker","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"}