{"record":{"id":"fdbecdc18cda45b5","repo":"hyperledger/fabric","slug":"received-proposal-response-with-nil-response-fdbecd","errorCode":null,"errorMessage":"received proposal response with nil response","messagePattern":"received proposal response with nil response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/checkcommitreadiness.go","lineNumber":182,"sourceCode":"\t}\n\n\tsignedProposal, err := signProposal(proposal, c.Signer)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to create signed proposal\")\n\t}\n\n\t// checkcommitreadiness currently only supports a single peer\n\tproposalResponse, err := c.EndorserClient.ProcessProposal(context.Background(), signedProposal)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to endorse proposal\")\n\t}\n\n\tif proposalResponse == nil {\n\t\treturn errors.New(\"received nil proposal response\")\n\t}\n\n\tif proposalResponse.Response == nil {\n\t\treturn errors.New(\"received proposal response with nil response\")\n\t}\n\n\tif proposalResponse.Response.Status != int32(cb.Status_SUCCESS) {\n\t\treturn errors.Errorf(\"query failed with status: %d - %s\", proposalResponse.Response.Status, proposalResponse.Response.Message)\n\t}\n\n\tif strings.ToLower(c.Input.OutputFormat) == \"json\" {\n\t\t// Unmarshal the proposal response to add descriptions to mismatch items\n\t\treadinessResult := &lb.CheckCommitReadinessResult{}\n\t\terr := proto.Unmarshal(proposalResponse.Response.Payload, readinessResult)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to unmarshal readiness result\")\n\t\t}\n\n\t\tif c.Input.InspectionEnabled {\n\t\t\tfor org, mismatches := range readinessResult.Mismatches {\n\t\t\t\tfor i, item := range mismatches.Items {\n\t\t\t\t\tmismatches.Items[i] = c.mismatchItemWithDescription(item)","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/checkcommitreadiness.go#L164-L200","documentation":"This error is returned by ReadinessCheck when the endorser returned a proposalResponse whose inner Response field is nil. The gateway-level protobuf message arrived, but the payload carrying status/message was not populated, so the library cannot evaluate success and refuses to dereference nil. This usually signals a malformed or truncated response from the peer.","triggerScenarios":"EndorserClient.ProcessProposal returns a non-nil proposalResponse with Response == nil — e.g. a buggy/misbehaving peer or proxy, or a stubbed client in tests returning a bare &peer.ProposalResponse{}.","commonSituations":"Custom service meshes/proxies in front of the peer stripping payload fields; incompatible peer/client protobuf versions producing empty responses; unit-test mocks that forget to populate the Response field.","solutions":["Retry against the peer; if it persists, inspect peer logs for endorsement failures and verify peer/fabric-cli version compatibility","Remove or fix any proxy/middleware between the client and the peer that could alter the response payload","If mocking EndorserClient in tests, populate the Response field: &peer.ProposalResponse{Response: &peer.Response{Status: 200}}"],"exampleFix":"// before (test mock)\nreturn &peer.ProposalResponse{}, nil // nil Response -> error\n// after\nreturn &peer.ProposalResponse{Response: &peer.Response{Status: 200, Payload: approvalBytes}}, nil","handlingStrategy":"type-guard","validationCode":"if resp != nil && resp.Response == nil {\n    return errors.New(\"endorser returned an empty proposal response payload\")\n}","typeGuard":"func hasInnerResponse(r *pb.ProposalResponse) bool {\n    return r != nil && r.Response != nil\n}","tryCatchPattern":"if resp.Response == nil {\n    return errors.New(\"received proposal response with nil response\")\n}\n// check resp.Response.Status == int32(cb.Status_SUCCESS) before reading the payload","preventionTips":["Populate Response in test mocks and intermediaries","Confirm peer and client protobuf versions are compatible","Check peer logs for endorsement errors that leave the response payload empty"],"tags":["hyperledger-fabric","grpc","endorser","malformed-response"],"backgroundTag":"nil-response-from-rpc","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"}