hyperledger/fabric · error

got nil as MissingPvtDataTracker, exiting...

Error message

got nil as MissingPvtDataTracker, exiting...

What it means

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.

Source

Thrown at gossip/privdata/reconcile.go:135

		case <-time.After(r.ReconcileSleepInterval):
			r.logger.Debug("Start reconcile missing private info")
			if err := r.reconcile(); err != nil {
				r.logger.Error("Failed to reconcile missing private info, error: ", err.Error())
			}
		}
	}
}

// returns the number of items that were reconciled , minBlock, maxBlock (blocks range) and an error
func (r *Reconciler) reconcile() error {
	missingPvtDataTracker, err := r.GetMissingPvtDataTracker()
	if err != nil {
		r.logger.Error("reconciliation error when trying to get missingPvtDataTracker:", err)
		return err
	}
	if missingPvtDataTracker == nil {
		r.logger.Error("got nil as MissingPvtDataTracker, exiting...")
		return errors.New("got nil as MissingPvtDataTracker, exiting...")
	}
	totalReconciled, minBlock, maxBlock := 0, uint64(math.MaxUint64), uint64(0)

	defer r.reportReconciliationDuration(time.Now())

	for {
		missingPvtDataInfo, err := missingPvtDataTracker.GetMissingPvtDataInfoForMostRecentBlocks(r.ReconcileBatchSize)
		if err != nil {
			r.logger.Error("reconciliation error when trying to get missing pvt data info recent blocks:", err)
			return err
		}
		// if missingPvtDataInfo is nil, len will return 0
		if len(missingPvtDataInfo) == 0 {
			if totalReconciled > 0 {
				r.logger.Infof("Reconciliation cycle finished successfully. reconciled %d private data keys from blocks range [%d - %d]", totalReconciled, minBlock, maxBlock)
			} else {
				r.logger.Debug("Reconciliation cycle finished successfully. no items to reconcile")
			}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Fix the store implementation to return a valid MissingPvtDataTracker
  2. Ensure the peer's state store is initialized before the reconciler starts
  3. Check the cs (collectionStore/store adapter) wiring — a nil tracker indicates a construction bug
Defensive patterns

Strategy: type-guard

Validate before calling

tracker, err := store.GetMissingPvtDataTracker()
if err != nil || tracker == nil { reconcileDisabled = true }

Type guard

func trackerReady(t privdata MissingPvtDataTracker, err error) bool { return err == nil && t != nil }

Try / catch

if err := reconcile(); err != nil && strings.Contains(err.Error(), "MissingPvtDataTracker") {
  // fix store initialization before enabling reconciliation
}

Prevention

When it happens

Trigger: r.cs.GetStore().GetMissingPvtDataTracker() returns (nil, nil-or-err) when reconcile runs — the store implementation does not support missing data tracking or is misinitialized.

Common situations: Store backend lacking MissingPvtDataTracker support; store not fully initialized at peer startup; miswired dependency in tests/production (cs adapter returning nil).

Related errors


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