hyperledger/fabric · error

failed to unmarshal proposal response's response payload

Error message

failed to unmarshal proposal response's response payload

What it means

printResponse renders a readiness proposal response as human-readable plain text. This error means the payload of a successful ProposalResponse could not be unmarshaled into CheckCommitReadinessResult — same family as 1591 but on the non-JSON output path.

Source

Thrown at internal/peer/lifecycle/chaincode/checkcommitreadiness.go:242

		"ChaincodeParameters": "ChaincodeParameters (Check the Sequence, ChaincodeName)",
		"EndorsementInfo":     "EndorsementInfo (Check the Version, InitRequired, EndorsementPlugin)",
		"ValidationInfo":      "ValidationInfo (Check the ValidationParameter, ValidationPlugin)",
		"Collections":         "Collections (Check the Collections)",
	}

	if description, ok := descriptions[item]; ok {
		return description
	}
	return item
}

// printResponse prints the information included in the response
// from the server as human readable plain-text.
func (c *CommitReadinessChecker) printResponse(proposalResponse *pb.ProposalResponse) error {
	result := &lb.CheckCommitReadinessResult{}
	err := proto.Unmarshal(proposalResponse.Response.Payload, result)
	if err != nil {
		return errors.Wrap(err, "failed to unmarshal proposal response's response payload")
	}

	orgs := []string{}
	for org := range result.Approvals {
		orgs = append(orgs, org)
	}
	sort.Strings(orgs)

	fmt.Fprintf(c.Writer, "Chaincode definition for chaincode '%s', version '%s', sequence '%d' on channel '%s' approval status by org:\n", c.Input.Name, c.Input.Version, c.Input.Sequence, c.Input.ChannelID)
	for _, org := range orgs {
		fmt.Fprintf(c.Writer, "%s: %t", org, result.Approvals[org])

		if mismatch, ok := result.Mismatches[org]; ok && c.Input.InspectionEnabled && len(mismatch.Items) > 0 {
			fmt.Fprintf(c.Writer, " (mismatch: [%s])", strings.Join(result.Mismatches[org].Items, ", "))
		}
		fmt.Fprintln(c.Writer)
	}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Align peer and CLI Fabric versions (both 2.x)
  2. Test with --output json to see if the JSON path parses the payload correctly (isolate the bug)
  3. Retry against a different peer
  4. Check the wrapped protobuf error for which field failed to parse
Defensive patterns

Strategy: try-catch

Validate before calling

if proposalResponse == nil || proposalResponse.Response == nil || len(proposalResponse.Response.Payload) == 0 { return errors.New("no payload to parse") }

Type guard

func hasPayload(r *pb.ProposalResponse) bool { return r != nil && r.Response != nil && len(r.Response.Payload) > 0 }

Try / catch

if err := c.printResponse(resp); err != nil { if strings.Contains(err.Error(), "failed to unmarshal") { return printResponseAsJSON(resp, &lb.CheckCommitReadinessResult{}, c.Writer) } return err }

Prevention

When it happens

Trigger: c.printResponse(proposalResponse) is called with a payload that fails proto.Unmarshal into CheckCommitReadinessResult (incompatible peer response format).

Common situations: Mixed-version Fabric network; peer returning an unexpected payload despite SUCCESS status; MITM/proxy altering response body.

Understand the failure class

Background: "cannot parse invalid wire-format data", "cannot unmarshal", "failed unmarshalling": protobuf unmarshal errors explained — this error's family across 10 libraries.

Related errors


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