{"record":{"id":"69941bba47604c5d","repo":"hyperledger/fabric","slug":"failed-to-unmarshal-proposal-response-s-response-p-69941b","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/querycommitted.go","lineNumber":160,"sourceCode":"\t}\n\treturn c.printResponse(proposalResponse)\n}\n\nfunc (c *CommittedQuerier) printResponseAsJSON(proposalResponse *pb.ProposalResponse) error {\n\tif c.Input.Name != \"\" {\n\t\treturn printResponseAsJSON(proposalResponse, &lb.QueryChaincodeDefinitionResult{}, c.Writer)\n\t}\n\treturn printResponseAsJSON(proposalResponse, &lb.QueryChaincodeDefinitionsResult{}, c.Writer)\n}\n\n// printResponse prints the information included in the response\n// from the server as human readable plain-text.\nfunc (c *CommittedQuerier) printResponse(proposalResponse *pb.ProposalResponse) error {\n\tif c.Input.Name != \"\" {\n\t\tresult := &lb.QueryChaincodeDefinitionResult{}\n\t\terr := proto.Unmarshal(proposalResponse.Response.Payload, result)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to unmarshal proposal response's response payload\")\n\t\t}\n\t\tfmt.Fprintf(c.Writer, \"Committed chaincode definition for chaincode '%s' on channel '%s':\\n\", c.Input.Name, c.Input.ChannelID)\n\t\tc.printSingleChaincodeDefinition(result)\n\t\tc.printApprovals(result)\n\n\t\treturn nil\n\t}\n\n\tresult := &lb.QueryChaincodeDefinitionsResult{}\n\terr := proto.Unmarshal(proposalResponse.Response.Payload, result)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to unmarshal proposal response's response payload\")\n\t}\n\tfmt.Fprintf(c.Writer, \"Committed chaincode definitions on channel '%s':\\n\", c.Input.ChannelID)\n\tfor _, cd := range result.ChaincodeDefinitions {\n\t\tfmt.Fprintf(c.Writer, \"Name: %s, \", cd.Name)\n\t\tc.printSingleChaincodeDefinition(cd)\n\t\tfmt.Fprintf(c.Writer, \"\\n\")","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/querycommitted.go#L142-L178","documentation":"printResponse unmarshals the response payload into lb.QueryChaincodeDefinitionResult when a specific --name was given. This error (wrapped proto.Unmarshal failure) means the payload bytes are not a valid QueryChaincodeDefinitionResult protobuf.","triggerScenarios":"Query with --name where the endorser returned SUCCESS but the payload is corrupt, empty, or of an unexpected message type (e.g. peer returns a different lifecycle result due to version mismatch).","commonSituations":"Fabric peer and CLI binaries from incompatible major versions (v2 CLI vs v1.x peer), a proxy rewriting payloads, or a custom/patched peer returning unexpected payload bytes.","solutions":["Ensure peer and CLI are the same Fabric major.minor version (lifecycle requires v2.x)","Retry the query to rule out transport corruption","Query without --name to see if the definitions-list path works","Inspect raw payload via --outputFormat json to see what the peer actually returned"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check peer/CLI version compatibility before running lifecycle commands\n// peer version  &&  match major.minor to the CLI binary","typeGuard":null,"tryCatchPattern":"if err := q.Query(); err != nil {\n    if strings.Contains(err.Error(), \"failed to unmarshal\") {\n        return fmt.Errorf(\"peer returned unexpected payload; check fabric version match\")\n    }\n    return err\n}","preventionTips":["Pin CLI and peer to the same Fabric release","Do not run lifecycle queries against v1.x peers","Avoid intermediaries that alter response payloads"],"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"}