hyperledger/fabric · error

received proposal response with nil response

Error message

received proposal response with nil response

What it means

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.

Source

Thrown at internal/peer/lifecycle/chaincode/queryinstalled.go:123

		return errors.WithMessage(err, "failed to create proposal")
	}

	signedProposal, err := signProposal(proposal, i.Signer)
	if err != nil {
		return errors.WithMessage(err, "failed to create signed proposal")
	}

	proposalResponse, err := i.EndorserClient.ProcessProposal(context.Background(), signedProposal)
	if err != nil {
		return errors.WithMessage(err, "failed to endorse proposal")
	}

	if proposalResponse == nil {
		return errors.New("received nil proposal response")
	}

	if proposalResponse.Response == nil {
		return errors.New("received proposal response with nil response")
	}

	if proposalResponse.Response.Status != int32(cb.Status_SUCCESS) {
		return errors.Errorf("query failed with status: %d - %s", proposalResponse.Response.Status, proposalResponse.Response.Message)
	}

	if strings.ToLower(i.Input.OutputFormat) == "json" {
		return printResponseAsJSON(proposalResponse, &lb.QueryInstalledChaincodesResult{}, i.Writer)
	}
	return i.printResponse(proposalResponse)
}

// printResponse prints the information included in the response
// from the server.
func (i *InstalledQuerier) printResponse(proposalResponse *pb.ProposalResponse) error {
	qicr := &lb.QueryInstalledChaincodesResult{}
	err := proto.Unmarshal(proposalResponse.Response.Payload, qicr)
	if err != nil {

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Retry the query to rule out transient corruption
  2. Verify peer and CLI Fabric versions match (v2.x lifecycle)
  3. Bypass intermediaries and query the peer directly
  4. Inspect peer logs and gRPC traces for malformed messages
Defensive patterns

Strategy: type-guard

Validate before calling

// pre-check: endorser reachable and peer version is v2.x
// peer version && peer node status

Type guard

func wellFormedResponse(pr *pb.ProposalResponse) bool {
    return pr != nil && pr.Response != nil
}

Try / catch

if err := q.Query(); err != nil {
    if strings.Contains(err.Error(), "nil response") {
        return fmt.Errorf("malformed endorsement from peer; retry or check peer version")
    }
    return err
}

Prevention

When it happens

Trigger: Peer's endorser returns a structurally incomplete ProposalResponse (Response unset) for the queryinstalled proposal.

Common situations: Version-incompatible or patched peer, corrupted gRPC framing through a proxy, or non-standard endorser implementation.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/dc66a7ed4e454986. Report an issue: GitHub.