{"record":{"id":"dc66a7ed4e454986","repo":"hyperledger/fabric","slug":"received-proposal-response-with-nil-response-dc66a7","errorCode":null,"errorMessage":"received proposal response with nil response","messagePattern":"received proposal response with nil response","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/queryinstalled.go","lineNumber":123,"sourceCode":"\t\treturn errors.WithMessage(err, \"failed to create proposal\")\n\t}\n\n\tsignedProposal, err := signProposal(proposal, i.Signer)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to create signed proposal\")\n\t}\n\n\tproposalResponse, err := i.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(i.Input.OutputFormat) == \"json\" {\n\t\treturn printResponseAsJSON(proposalResponse, &lb.QueryInstalledChaincodesResult{}, i.Writer)\n\t}\n\treturn i.printResponse(proposalResponse)\n}\n\n// printResponse prints the information included in the response\n// from the server.\nfunc (i *InstalledQuerier) printResponse(proposalResponse *pb.ProposalResponse) error {\n\tqicr := &lb.QueryInstalledChaincodesResult{}\n\terr := proto.Unmarshal(proposalResponse.Response.Payload, qicr)\n\tif err != nil {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/queryinstalled.go#L105-L141","documentation":"After the nil-response check, Query verifies the nested Response field. A non-nil ProposalResponse with nil Response cannot carry a status or payload, so the installed-chaincode query aborts. As with 1650 this defends against malformed endorsement messages.","triggerScenarios":"Peer's endorser returns a structurally incomplete ProposalResponse (Response unset) for the queryinstalled proposal.","commonSituations":"Version-incompatible or patched peer, corrupted gRPC framing through a proxy, or non-standard endorser implementation.","solutions":["Retry the query to rule out transient corruption","Verify peer and CLI Fabric versions match (v2.x lifecycle)","Bypass intermediaries and query the peer directly","Inspect peer logs and gRPC traces for malformed messages"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// pre-check: endorser reachable and peer version is v2.x\n// peer version && peer node status","typeGuard":"func wellFormedResponse(pr *pb.ProposalResponse) bool {\n    return pr != nil && pr.Response != nil\n}","tryCatchPattern":"if err := q.Query(); err != nil {\n    if strings.Contains(err.Error(), \"nil response\") {\n        return fmt.Errorf(\"malformed endorsement from peer; retry or check peer version\")\n    }\n    return err\n}","preventionTips":["Keep peer and CLI versions matched","Avoid message-rewriting middlewares","Retry transient malformed responses"],"tags":["fabric","lifecycle","grpc-response","nil-response"],"backgroundTag":"nil-proposal-response","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"}