{"record":{"id":"7633637d86f61f20","repo":"hyperledger/fabric","slug":"getproposalresponsepayload-error-s","errorCode":null,"errorMessage":"GetProposalResponsePayload error %s","messagePattern":"GetProposalResponsePayload error (.+?)","errorType":"validation","errorClass":"VSCCEndorsementPolicyError","httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v12/validation_logic.go","lineNumber":564,"sourceCode":"\t\tif !lscc.ChaincodeNameRegExp.MatchString(ccName) {\n\t\t\treturn policyErr(errors.Errorf(\"invalid chaincode name '%s'\", ccName))\n\t\t}\n\t\t// it can't match the name of one of the system chaincodes\n\t\tif _, in := systemChaincodeNames[ccName]; in {\n\t\t\treturn policyErr(errors.Errorf(\"chaincode name '%s' is reserved for system chaincodes\", ccName))\n\t\t}\n\n\t\t// validate chaincode version\n\t\tccVersion := cdsArgs.ChaincodeSpec.ChaincodeId.Version\n\t\t// it must comply with the lscc.ChaincodeVersionRegExp\n\t\tif !lscc.ChaincodeVersionRegExp.MatchString(ccVersion) {\n\t\t\treturn policyErr(errors.Errorf(\"invalid chaincode version '%s'\", ccVersion))\n\t\t}\n\n\t\t// get the rwset\n\t\tpRespPayload, err := protoutil.UnmarshalProposalResponsePayload(cap.Action.ProposalResponsePayload)\n\t\tif err != nil {\n\t\t\treturn policyErr(fmt.Errorf(\"GetProposalResponsePayload error %s\", err))\n\t\t}\n\t\tif pRespPayload.Extension == nil {\n\t\t\treturn policyErr(fmt.Errorf(\"nil pRespPayload.Extension\"))\n\t\t}\n\t\trespPayload, err := protoutil.UnmarshalChaincodeAction(pRespPayload.Extension)\n\t\tif err != nil {\n\t\t\treturn policyErr(fmt.Errorf(\"GetChaincodeAction error %s\", err))\n\t\t}\n\t\ttxRWSet := &rwsetutil.TxRwSet{}\n\t\tif err = txRWSet.FromProtoBytes(respPayload.Results); err != nil {\n\t\t\treturn policyErr(fmt.Errorf(\"txRWSet.FromProtoBytes error %s\", err))\n\t\t}\n\n\t\t// extract the rwset for lscc\n\t\tvar lsccrwset *kvrwset.KVRWSet\n\t\tfor _, ns := range txRWSet.NsRwSets {\n\t\t\tlogger.Debugf(\"Namespace %s\", ns.NameSpace)\n\t\t\tif ns.NameSpace == \"lscc\" {","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v12/validation_logic.go#L546-L582","documentation":"VSCC attempts to unmarshal cap.Action.ProposalResponsePayload into a ProposalResponsePayload proto. If the bytes are not a valid ProposalResponsePayload, validation fails with this wrapped policy error and the transaction is marked invalid.","triggerScenarios":"An endorsed lscc transaction whose ChaincodeEndorsedAction.ProposalResponsePayload bytes are corrupted, truncated, or not a protobuf-encoded ProposalResponsePayload.","commonSituations":"Custom endorsement-collection code writing the wrong proto message into the payload, SDK/proto incompatibilities, or bytes tampered/reassembled incorrectly by a gateway or intermediary.","solutions":["Rebuild the transaction using the SDK's standard transaction assembly (proposal response payload copied verbatim from the endorser reply).","Check that no intermediate component re-serializes or mutates ProposalResponsePayload bytes.","Align protobuf/Fabric SDK versions between client and peer and resubmit the transaction."],"exampleFix":"// before: re-encoding the payload as JSON\nprp, _ := json.Marshal(proposalResponse.Payload)\n// after: pass endorser bytes through unchanged\nprp := proposalResponse.Payload // raw protobuf bytes from endorser","handlingStrategy":"validation","validationCode":"var prp pb.ProposalResponsePayload\nif len(cap.Action.ProposalResponsePayload) == 0 || proto.Unmarshal(cap.Action.ProposalResponsePayload, &prp) != nil {\n    return errors.New(\"proposal response payload is not a valid protobuf message\")\n}","typeGuard":"func isProposalResponsePayload(b []byte) bool {\n    var prp pb.ProposalResponsePayload\n    return len(b) > 0 && proto.Unmarshal(b, &prp) == nil\n}","tryCatchPattern":"prp, err := protoutil.UnmarshalProposalResponsePayload(cap.Action.ProposalResponsePayload)\nif err != nil {\n    logger.Warnf(\"corrupt proposal response payload: %v\", err)\n    return policyErr(err)\n}","preventionTips":["Copy endorser reply payload bytes verbatim; never re-encode.","Match protobuf runtimes between client and peer.","Dry-run unmarshal of the payload locally before signing."],"tags":["fabric","vscc","lscc","protobuf","endorsement"],"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"}