{"record":{"id":"9d4be0bcd352cca1","repo":"hyperledger/fabric","slug":"endorsement-failure-during-invoke-response-v","errorCode":null,"errorMessage":"endorsement failure during invoke. response: %v","messagePattern":"endorsement failure during invoke\\. response: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/chaincode/common.go","lineNumber":121,"sourceCode":"\t\tcf.DeliverClients,\n\t\tcf.BroadcastClient,\n\t)\n\tif err != nil {\n\t\treturn errors.Errorf(\"%s - proposal response: %v\", err, proposalResp)\n\t}\n\n\tif invoke {\n\t\tlogger.Debugf(\"ESCC invoke result: %v\", proposalResp)\n\t\tpRespPayload, err := protoutil.UnmarshalProposalResponsePayload(proposalResp.Payload)\n\t\tif err != nil {\n\t\t\treturn errors.WithMessage(err, \"error while unmarshalling proposal response payload\")\n\t\t}\n\t\tca, err := protoutil.UnmarshalChaincodeAction(pRespPayload.Extension)\n\t\tif err != nil {\n\t\t\treturn errors.WithMessage(err, \"error while unmarshalling chaincode action\")\n\t\t}\n\t\tif proposalResp.Endorsement == nil {\n\t\t\treturn errors.Errorf(\"endorsement failure during invoke. response: %v\", proposalResp.Response)\n\t\t}\n\t\tlogger.Infof(\"Chaincode invoke successful. result: %v\", ca.Response)\n\t} else {\n\t\tif proposalResp == nil {\n\t\t\treturn errors.New(\"error during query: received nil proposal response\")\n\t\t}\n\t\tif proposalResp.Endorsement == nil {\n\t\t\treturn errors.Errorf(\"endorsement failure during query. response: %v\", proposalResp.Response)\n\t\t}\n\n\t\tif chaincodeQueryRaw && chaincodeQueryHex {\n\t\t\treturn fmt.Errorf(\"options --raw (-r) and --hex (-x) are not compatible\")\n\t\t}\n\t\tif chaincodeQueryRaw {\n\t\t\tfmt.Println(proposalResp.Response.Payload)\n\t\t\treturn nil\n\t\t}\n\t\tif chaincodeQueryHex {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/chaincode/common.go#L103-L139","documentation":"During an invoke, after unmarshalling the proposal response payload and chaincode action, the code requires an Endorsement. A nil Endorsement means the endorser returned a response without a valid endorsement signature, so the invoke failed.","triggerScenarios":"peer chaincode invoke where proposalResp.Endorsement == nil — the endorser processed the proposal but did not (or could not) endorse, e.g. chaincode returned an error status or the ESCC endorsement step failed.","commonSituations":"Chaincode execution errors (simulate failure), chaincode container not running/starting, endorsement policy unmet on the queried peer, mvcc/read-conflict-like simulate errors.","solutions":["Inspect proposalResp.Response message printed in the error — it contains the chaincode error","Check the chaincode container logs on the target peer (docker logs / kubectl logs)","Ensure required endorsing peers are specified with --peerAddresses and reachable","Fix the chaincode logic causing the bad status (e.g. wrong key, invalid state)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure chaincode is committed and running on the peer\npeer lifecycle chaincode querycommitted -C mychannel\npeer lifecycle chaincode queryinstalled","typeGuard":null,"tryCatchPattern":"resp, err := invoke(...)\nif err != nil && strings.Contains(err.Error(), \"endorsement failure during invoke\") {\n  log.Errorf(\"chaincode rejected invoke: inspect response message and chaincode logs: %v\", err)\n}","preventionTips":["Inspect the chaincode Response.Message printed with the error","Validate chaincode inputs in the chaincode itself and return descriptive errors","Keep chaincode containers healthy (docker ps / resource limits)","Include all policy-required endorsing peers in the invoke"],"tags":["chaincode","endorsement","fabric"],"backgroundTag":"endorsement-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"}