hyperledger/fabric · error
failed to unmarshal proposal response's response payload
Error message
failed to unmarshal proposal response's response payload
What it means
InstalledQuerier.printResponse unmarshals the SUCCESS payload into lb.QueryInstalledChaincodesResult. This error means the payload is not the expected protobuf — the peer said success but the bytes cannot be decoded into installed-chaincode results.
Source
Thrown at internal/peer/lifecycle/chaincode/queryinstalled.go:142
}
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 {
return errors.Wrap(err, "failed to unmarshal proposal response's response payload")
}
fmt.Fprintln(i.Writer, "Installed chaincodes on peer:")
for _, chaincode := range qicr.InstalledChaincodes {
fmt.Fprintf(i.Writer, "Package ID: %s, Label: %s\n", chaincode.PackageId, chaincode.Label)
}
return nil
}
func (i *InstalledQuerier) createProposal() (*pb.Proposal, error) {
args := &lb.QueryInstalledChaincodesArgs{}
argsBytes, err := proto.Marshal(args)
if err != nil {
return nil, errors.Wrap(err, "failed to marshal args")
}
ccInput := &pb.ChaincodeInput{
Args: [][]byte{[]byte("QueryInstalledChaincodes"), argsBytes},View on GitHub (pinned to 2736b63f8f)
Solutions
- Match CLI and peer Fabric versions (both v2.x)
- Retry the query
- Try --outputFormat json to see whether the JSON path decodes the payload
- Capture peer logs and compare the response schema with the CLI's expected lb.QueryInstalledChaincodesResult
Defensive patterns
Strategy: try-catch
Validate before calling
// verify version parity before decoding // peer version must equal CLI fabric version (major.minor)
Try / catch
if err := q.Query(); err != nil {
if strings.Contains(err.Error(), "failed to unmarshal") {
return fmt.Errorf("unexpected installed-chaincode payload; verify fabric version match")
}
return err
} Prevention
- Run identical Fabric versions on CLI and peer
- Use stock _lifecycle implementations
- Prefer --outputFormat json for machine parsing and earlier schema validation
When it happens
Trigger: queryinstalled where the endorser returns status 200 but a corrupt/empty/incompatible payload (e.g. peer exposing a different QueryInstalledChaincodesResult schema).
Common situations: Fabric version mismatch between CLI and peer, custom or patched _lifecycle, proxy rewriting response bodies.
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
- failed to unmarshal proposal response's response payload
- error unmarshalling
- error unmarshalling original config
- error unmarshalling updated config
- failed to unmarshal ApplicationPolicy bytes
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/29157f2a0d86cb5e.
Report an issue: GitHub.