hyperledger/fabric · error

txid [%s]: unsuppored transaction. Queries on pvt data is su

Error message

txid [%s]: unsuppored transaction. Queries on pvt data is supported only in a read-only transaction

What it means

checkBeforePvtdataQueries detected a write was already performed on this simulator, then a private-data query was attempted. Fabric forbids mixing writes with pvtdata reads in one transaction to keep private reads consistent, so the transaction is rejected.

Source

Thrown at core/ledger/kvledger/txmgmt/txmgr/tx_simulator.go:237

}

func (s *txSimulator) checkWritePrecondition(key string, value []byte) error {
	if err := s.checkDone(); err != nil {
		return err
	}
	if err := s.checkPvtdataQueryPerformed(); err != nil {
		return err
	}
	if err := s.checkPaginatedQueryPerformed(); err != nil {
		return err
	}
	s.writePerformed = true
	return s.queryExecutor.txmgr.db.ValidateKeyValue(key, value)
}

func (s *txSimulator) checkBeforePvtdataQueries() error {
	if s.writePerformed {
		return errors.Errorf("txid [%s]: unsuppored transaction. Queries on pvt data is supported only in a read-only transaction", s.txid)
	}
	s.pvtdataQueriesPerformed = true
	return nil
}

func (s *txSimulator) checkPvtdataQueryPerformed() error {
	if s.pvtdataQueriesPerformed {
		return errors.Errorf("txid [%s]: unsuppored transaction. Transaction has already performed queries on pvt data. Writes are not allowed", s.txid)
	}
	return nil
}

func (s *txSimulator) checkBeforePaginatedQueries() error {
	if s.writePerformed {
		return errors.Errorf("txid [%s]: unsuppored transaction. Paginated queries are supported only in a read-only transaction", s.txid)
	}
	s.paginatedQueriesPerformed = true
	return nil

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Split the transaction: perform pvt data queries in a read-only transaction
  2. Avoid writes before private-data reads in the same simulation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/ledger/kvledger/txmgmt/txmgr/tx_simulator.go:237 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/c2a52993db1f97de. Report an issue: GitHub.