hyperledger/fabric · error

GetProposalResponsePayload error %s

Error message

GetProposalResponsePayload error %s

What it means

After unmarshaling the ChaincodeActionPayload, the validator tries to unmarshal cap.Action.ProposalResponsePayload as a ProposalResponsePayload. Failure means those bytes are not a valid proto ProposalResponsePayload.

Source

Thrown at core/handlers/validation/builtin/v20/validation_logic.go:155

		return nil, err
	}

	// ...and the transaction...
	tx, err := protoutil.UnmarshalTransaction(payl.Data)
	if err != nil {
		logger.Errorf("VSCC error: GetTransaction failed, err %s", err)
		return nil, err
	}

	cap, err := protoutil.UnmarshalChaincodeActionPayload(tx.Actions[actionPosition].Payload)
	if err != nil {
		logger.Errorf("VSCC error: GetChaincodeActionPayload failed, err %s", err)
		return nil, err
	}

	pRespPayload, err := protoutil.UnmarshalProposalResponsePayload(cap.Action.ProposalResponsePayload)
	if err != nil {
		err = fmt.Errorf("GetProposalResponsePayload error %s", err)
		return nil, err
	}
	if pRespPayload.Extension == nil {
		err = fmt.Errorf("nil pRespPayload.Extension")
		return nil, err
	}
	respPayload, err := protoutil.UnmarshalChaincodeAction(pRespPayload.Extension)
	if err != nil {
		err = fmt.Errorf("GetChaincodeAction error %s", err)
		return nil, err
	}

	return &validationArtifacts{
		rwset:        respPayload.Results,
		prp:          cap.Action.ProposalResponsePayload,
		endorsements: cap.Action.Endorsements,
		chdr:         chdr,
		env:          env,

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Rebuild the transaction with a supported Fabric SDK so the ProposalResponsePayload is marshaled correctly
  2. Check the client fabric-protos version matches the peer's version (schema drift breaks unmarshal)
  3. Inspect the failing tx payload with protoutil helpers to find where serialization diverged
  4. If the tx is untrusted, this is expected rejection behavior — record tx validation code TX_MALFORMED and move on

Example fix

// before
prpBytes := append(otherBytes, capBytes...) // corrupted assembly
// after
prpBytes := protoutil.MarshalOrPanic(&peer.ProposalResponsePayload{
    ProposalHash: hash,
    Extension:    protoutil.MarshalOrPanic(chaincodeAction),
})
Defensive patterns

Strategy: try-catch

Validate before calling

cap := &peer.ChaincodeActionPayload{}
if err := proto.Unmarshal(capBytes, cap); err == nil && cap.Action != nil {
    prp := &peer.ProposalResponsePayload{}
    if err := proto.Unmarshal(cap.Action.ProposalResponsePayload, prp); err != nil {
        // reject before calling the validator
    }
}

Type guard

func hasValidPRP(cap *peer.ChaincodeActionPayload) bool {
    prp := &peer.ProposalResponsePayload{}
    return cap.Action != nil &&
        proto.Unmarshal(cap.Action.ProposalResponsePayload, prp) == nil
}

Try / catch

artifacts, err := extractValidationArtifacts(bytes, policy)
if err != nil {
    if strings.Contains(err.Error(), "GetProposalResponsePayload error") {
        return nil, validationerrors.TXMalformed
    }
    return nil, err
}

Prevention

When it happens

Trigger: A transaction's chaincode action contains corrupted or non-proto bytes in Action.ProposalResponsePayload — typically produced by hand-crafted transactions, truncated data, or schema mismatches between producer and validator.

Common situations: Malicious or malformed transactions submitted to the network; custom SDKs building endorsement bytes incorrectly; fabric version/proto schema mismatch between clients and peers.

Understand the failure class

Background: "cannot parse invalid wire-format data", "cannot unmarshal", "failed unmarshalling": protobuf unmarshal errors explained — this error's family across 10 libraries.

Related errors


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