{"record":{"id":"34f2ce328c1ee370","repo":"hyperledger/fabric","slug":"error-during-query-received-nil-proposal-response","errorCode":null,"errorMessage":"error during query: received nil proposal response","messagePattern":"error during query: received nil proposal response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/chaincode/common.go","lineNumber":126,"sourceCode":"\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 {\n\t\t\tfmt.Printf(\"%x\\n\", proposalResp.Response.Payload)\n\t\t\treturn nil\n\t\t}\n\t\tfmt.Println(string(proposalResp.Response.Payload))\n\t}","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/chaincode/common.go#L108-L144","documentation":"Error in chaincodeInvokeOrQuery's invoke path: after a successful proposal round-trip, the peer returned a proposal response whose Endorsement is nil, meaning the chaincode action could not be endorsed — the peer's Response status/message (printed in the error) explains why (e.g. chaincode execution failure or MVCC conflict).","triggerScenarios":"peer chaincode query where the endorser processing returned nil proposalResp (no endorser responded successfully to the query proposal).","commonSituations":"All targeted endorsers unreachable or returning transport errors that collapse to a nil response; misconfigured peer addresses; query against a peer that has not joined the channel.","solutions":["Verify the peer is joined to the channel (peer channel list) and reachable","Check TLS settings: --tls, --peerAddresses, --tlsRootCertFiles must be consistent","Retry the query; transient network failures can yield a nil response","Inspect peer container logs for the corresponding proposal RPC error"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Confirm peer connectivity and channel membership before querying\npeer channel list --peerAddresses $PEER_ADDR --tlsRootCertFiles $TLS_CERT\ndig +short $PEER_HOST","typeGuard":null,"tryCatchPattern":"for attempt := 0; attempt < 3; attempt++ {\n  result, err := query(...)\n  if err == nil { return result }\n  if strings.Contains(err.Error(), \"received nil proposal response\") {\n    time.Sleep(backoff(attempt)); continue\n  }\n  return err\n}\nreturn errors.New(\"query failed after retries\")","preventionTips":["Retry transient nil responses with backoff","Verify TLS certs match the peer's CA","Confirm the peer has joined the target channel","Check peer RPC limits/overload before bulk queries"],"tags":["chaincode","query","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"}