hyperledger/fabric · error

private data matching public hash version is not available.

Error message

private data matching public hash version is not available. Public hash version = %s, Private data version = %s

What it means

GetPrivateData compared the version of the private value with the version of the corresponding public key hash and they differ — the private data and its hash commitment are out of sync, typically because the pvt data write for that block was missing and only a purge/hash update advanced.

Source

Thrown at core/ledger/kvledger/txmgmt/txmgr/query_executor.go:218

	}

	var err error
	var hashVersion *version.Height
	var versionedValue *statedb.VersionedValue

	if versionedValue, err = q.txmgr.db.GetPrivateData(ns, coll, key); err != nil {
		return nil, err
	}

	// metadata is always nil for private data - because, the metadata is part of the hashed key (instead of raw key)
	val, _, ver := decomposeVersionedValue(versionedValue)

	keyHash := util.ComputeStringHash(key)
	if hashVersion, err = q.txmgr.db.GetKeyHashVersion(ns, coll, keyHash); err != nil {
		return nil, err
	}
	if !version.AreSame(hashVersion, ver) {
		return nil, errors.Errorf(
			"private data matching public hash version is not available. Public hash version = %s, Private data version = %s",
			hashVersion, ver,
		)
	}
	if q.collectReadset {
		q.rwsetBuilder.AddToHashedReadSet(ns, coll, key, ver)
		q.privateReads.Add(ns, coll)
	}
	return val, nil
}

func (q *queryExecutor) GetPrivateDataHash(ns, coll, key string) ([]byte, error) {
	if err := q.validateCollName(ns, coll); err != nil {
		return nil, err
	}
	if err := q.checkDone(); err != nil {
		return nil, err
	}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Ensure the peer received the missing private data (gossip/reconciliation) before reading
  2. Reconcile private data from other eligible peers
  3. Avoid reading keys whose hash version advanced past the private version
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/ledger/kvledger/txmgmt/txmgr/query_executor.go:218 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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