{"record":{"id":"29157f2a0d86cb5e","repo":"hyperledger/fabric","slug":"failed-to-unmarshal-proposal-response-s-response-p-29157f","errorCode":null,"errorMessage":"failed to unmarshal proposal response's response payload","messagePattern":"failed to unmarshal proposal response's response payload","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/queryinstalled.go","lineNumber":142,"sourceCode":"\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 {\n\t\treturn errors.Wrap(err, \"failed to unmarshal proposal response's response payload\")\n\t}\n\tfmt.Fprintln(i.Writer, \"Installed chaincodes on peer:\")\n\tfor _, chaincode := range qicr.InstalledChaincodes {\n\t\tfmt.Fprintf(i.Writer, \"Package ID: %s, Label: %s\\n\", chaincode.PackageId, chaincode.Label)\n\t}\n\treturn nil\n}\n\nfunc (i *InstalledQuerier) createProposal() (*pb.Proposal, error) {\n\targs := &lb.QueryInstalledChaincodesArgs{}\n\n\targsBytes, err := proto.Marshal(args)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to marshal args\")\n\t}\n\n\tccInput := &pb.ChaincodeInput{\n\t\tArgs: [][]byte{[]byte(\"QueryInstalledChaincodes\"), argsBytes},","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/queryinstalled.go#L124-L160","documentation":"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.","triggerScenarios":"queryinstalled where the endorser returns status 200 but a corrupt/empty/incompatible payload (e.g. peer exposing a different QueryInstalledChaincodesResult schema).","commonSituations":"Fabric version mismatch between CLI and peer, custom or patched _lifecycle, proxy rewriting response bodies.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify version parity before decoding\n// peer version must equal CLI fabric version (major.minor)","typeGuard":null,"tryCatchPattern":"if err := q.Query(); err != nil {\n    if strings.Contains(err.Error(), \"failed to unmarshal\") {\n        return fmt.Errorf(\"unexpected installed-chaincode payload; verify fabric version match\")\n    }\n    return err\n}","preventionTips":["Run identical Fabric versions on CLI and peer","Use stock _lifecycle implementations","Prefer --outputFormat json for machine parsing and earlier schema validation"],"tags":["fabric","lifecycle","protobuf","unmarshal"],"backgroundTag":"protobuf-unmarshal-failed","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"}