{"record":{"id":"1ca263b79620a32c","repo":"hyperledger/fabric","slug":"getproposalresponsepayload-error-s-1ca263","errorCode":null,"errorMessage":"GetProposalResponsePayload error %s","messagePattern":"GetProposalResponsePayload error (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v20/validation_logic.go","lineNumber":155,"sourceCode":"\t\treturn nil, err\n\t}\n\n\t// ...and the transaction...\n\ttx, err := protoutil.UnmarshalTransaction(payl.Data)\n\tif err != nil {\n\t\tlogger.Errorf(\"VSCC error: GetTransaction failed, err %s\", err)\n\t\treturn nil, err\n\t}\n\n\tcap, err := protoutil.UnmarshalChaincodeActionPayload(tx.Actions[actionPosition].Payload)\n\tif err != nil {\n\t\tlogger.Errorf(\"VSCC error: GetChaincodeActionPayload failed, err %s\", err)\n\t\treturn nil, err\n\t}\n\n\tpRespPayload, err := protoutil.UnmarshalProposalResponsePayload(cap.Action.ProposalResponsePayload)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"GetProposalResponsePayload error %s\", err)\n\t\treturn nil, err\n\t}\n\tif pRespPayload.Extension == nil {\n\t\terr = fmt.Errorf(\"nil pRespPayload.Extension\")\n\t\treturn nil, err\n\t}\n\trespPayload, err := protoutil.UnmarshalChaincodeAction(pRespPayload.Extension)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"GetChaincodeAction error %s\", err)\n\t\treturn nil, err\n\t}\n\n\treturn &validationArtifacts{\n\t\trwset:        respPayload.Results,\n\t\tprp:          cap.Action.ProposalResponsePayload,\n\t\tendorsements: cap.Action.Endorsements,\n\t\tchdr:         chdr,\n\t\tenv:          env,","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v20/validation_logic.go#L137-L173","documentation":"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.","triggerScenarios":"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.","commonSituations":"Malicious or malformed transactions submitted to the network; custom SDKs building endorsement bytes incorrectly; fabric version/proto schema mismatch between clients and peers.","solutions":["Rebuild the transaction with a supported Fabric SDK so the ProposalResponsePayload is marshaled correctly","Check the client fabric-protos version matches the peer's version (schema drift breaks unmarshal)","Inspect the failing tx payload with protoutil helpers to find where serialization diverged","If the tx is untrusted, this is expected rejection behavior — record tx validation code TX_MALFORMED and move on"],"exampleFix":"// before\nprpBytes := append(otherBytes, capBytes...) // corrupted assembly\n// after\nprpBytes := protoutil.MarshalOrPanic(&peer.ProposalResponsePayload{\n    ProposalHash: hash,\n    Extension:    protoutil.MarshalOrPanic(chaincodeAction),\n})","handlingStrategy":"try-catch","validationCode":"cap := &peer.ChaincodeActionPayload{}\nif err := proto.Unmarshal(capBytes, cap); err == nil && cap.Action != nil {\n    prp := &peer.ProposalResponsePayload{}\n    if err := proto.Unmarshal(cap.Action.ProposalResponsePayload, prp); err != nil {\n        // reject before calling the validator\n    }\n}","typeGuard":"func hasValidPRP(cap *peer.ChaincodeActionPayload) bool {\n    prp := &peer.ProposalResponsePayload{}\n    return cap.Action != nil &&\n        proto.Unmarshal(cap.Action.ProposalResponsePayload, prp) == nil\n}","tryCatchPattern":"artifacts, err := extractValidationArtifacts(bytes, policy)\nif err != nil {\n    if strings.Contains(err.Error(), \"GetProposalResponsePayload error\") {\n        return nil, validationerrors.TXMalformed\n    }\n    return nil, err\n}","preventionTips":["Build endorsements only with official Fabric SDKs","Keep fabric-protos versions aligned between client and peer","Never splice/truncate serialized payload bytes","Validate tx bytes at ingestion to reject malformed txs early"],"tags":["fabric","protobuf","unmarshal","transaction"],"backgroundTag":"protobuf-unmarshal-failed","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"}