{"record":{"id":"400e3c73e66a2ea2","repo":"hyperledger/fabric","slug":"received-nil-proposal-response-400e3c","errorCode":null,"errorMessage":"received nil proposal response","messagePattern":"received nil proposal response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/checkcommitreadiness.go","lineNumber":178,"sourceCode":"\n\tproposal, err := c.createProposal(c.Input.TxID)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to create proposal\")\n\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","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/checkcommitreadiness.go#L160-L196","documentation":"This error is returned by ReadinessCheck after c.EndorserClient.ProcessProposal returns a nil proposal response without an error. The gRPC endorser client contract normally guarantees either a non-nil response or an error, so a nil response indicates an unexpected client state (e.g. the client was closed or a misbehaving interceptor/dial returned nothing). The library guards against dereferencing a nil pointer here.","triggerScenarios":"ProcessProposal on the endorser gRPC client returns (nil, nil) — typically when the ClientConn/connection was already closed or torn down mid-call, or a custom dialer/interceptor short-circuits and returns nil responses.","commonSituations":"Peer connection dropped or client closed before the readiness query; tests stubbing EndorserClient incorrectly; gRPC transport failure surfaces as nil instead of error via custom plumbing.","solutions":["Verify the peer connection is alive: check tlsRootCertFile, peer address, and that EndorserClient was created from an open ClientConn","Recreate the endorser client / redial the peer and retry the checkcommitreadiness command","If using a mock or custom interceptor for EndorserClient, fix it to return a valid proposal response or a non-nil error"],"exampleFix":"// before\nclient, err := chaincode.NewEndorserClient(endpoint, tlsRootCert) // conn closed later\nresp, _ := client.ProcessProposal(ctx, sp) // nil response\n// after\nif err := client.CheckConnection(); err != nil {\n    client, err = chaincode.NewEndorserClient(endpoint, tlsRootCert) // redial before use\n}\nresp, err := client.ProcessProposal(ctx, sp)\nif err != nil || resp == nil { return err }","handlingStrategy":"retry","validationCode":"// check client connectivity before issuing proposal\nif c.EndorserClient == nil {\n    return errors.New(\"endorser client not initialized; recreate the client\")\n}","typeGuard":null,"tryCatchPattern":"resp, err := c.EndorserClient.ProcessProposal(ctx, signedProposal)\nif err != nil {\n    return errors.WithMessage(err, \"failed to endorse proposal\")\n}\nif resp == nil {\n    return errors.New(\"received nil proposal response\")\n}","preventionTips":["Ensure the endorser ClientConn stays open; close it only after all calls finish","Verify peer address/TLS root cert configuration before dialing","Avoid stubs that return (nil, nil); always return an error or a valid response"],"tags":["hyperledger-fabric","grpc","endorser","network"],"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-08T15:18:49.778Z"}