{"record":{"id":"ca29f5dd687c7ba4","repo":"hyperledger/fabric","slug":"failed-to-unmarshal-proposal-response-s-response-p-ca29f5","errorCode":null,"errorMessage":"failed to unmarshal proposal response's response payload","messagePattern":"failed to unmarshal proposal response's response payload","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/queryapproved.go","lineNumber":159,"sourceCode":"\t\treturn a.printResponseAsJSON(proposalResponse)\n\t}\n\treturn a.printResponse(proposalResponse)\n}\n\nfunc (a *ApprovedQuerier) printResponseAsJSON(proposalResponse *pb.ProposalResponse) error {\n\tif a.Input.Name != \"\" {\n\t\treturn printResponseAsJSON(proposalResponse, &lb.QueryApprovedChaincodeDefinitionResult{}, a.Writer)\n\t}\n\treturn printResponseAsJSON(proposalResponse, &lb.QueryApprovedChaincodeDefinitionsResult{}, a.Writer)\n}\n\n// printResponse prints the information included in the response\n// from the server as human readable plain-text.\nfunc (a *ApprovedQuerier) printResponse(proposalResponse *pb.ProposalResponse) error {\n\tif a.Input.Name != \"\" {\n\t\tresult := &lb.QueryApprovedChaincodeDefinitionResult{}\n\t\tif err := proto.Unmarshal(proposalResponse.Response.Payload, result); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to unmarshal proposal response's response payload\")\n\t\t}\n\t\tfmt.Fprintf(a.Writer, \"Approved chaincode definition for chaincode '%s' on channel '%s':\\n\", a.Input.Name, a.Input.ChannelID)\n\t\ta.printSingleApprovedChaincodeDefinition(result)\n\t\tfmt.Fprintf(a.Writer, \"\\n\")\n\t\treturn nil\n\t}\n\n\tresult := &lb.QueryApprovedChaincodeDefinitionsResult{}\n\tif err := proto.Unmarshal(proposalResponse.Response.Payload, result); err != nil {\n\t\treturn errors.Wrap(err, \"failed to unmarshal proposal response's response payload\")\n\t}\n\tfmt.Fprintf(a.Writer, \"Approved chaincode definitions on channel '%s':\\n\", a.Input.ChannelID)\n\n\tfor _, acd := range result.ApprovedChaincodeDefinitions {\n\t\tfmt.Fprintf(a.Writer, \"name: %s, \", acd.Name)\n\t\ta.printSingleApprovedChaincodeDefinition(acd)\n\t\tfmt.Fprintf(a.Writer, \"\\n\")\n\t}","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/queryapproved.go#L141-L177","documentation":"Raised while printing the query result: the payload bytes returned in the proposal response could not be unmarshalled into the expected lifecycle proto (QueryApprovedChaincodeDefinitionResult / QueryApprovedChaincodeDefinitionsResult). This is a guard inside the shared printResponseAsJSON helper; the at-fault input is the response payload, typically caused by a client/server proto schema mismatch.","triggerScenarios":"Thrown at internal/peer/lifecycle/chaincode/queryapproved.go:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the peer CLI version matches the peer binary version","Regenerate/verify the lifecycle protos in use","Query the peer directly to inspect the raw payload if the mismatch persists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}