{"record":{"id":"9a4abd9cc985ba13","repo":"hyperledger/fabric","slug":"failed-to-unmarshal-proposal-response-s-response-p-9a4abd","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":"warning","filePath":"internal/peer/lifecycle/chaincode/install.go","lineNumber":173,"sourceCode":"\t}\n\n\tif proposalResponse == nil {\n\t\treturn errors.New(\"chaincode install failed: received nil proposal response\")\n\t}\n\n\tif proposalResponse.Response == nil {\n\t\treturn errors.New(\"chaincode install failed: received proposal response with nil response\")\n\t}\n\n\tif proposalResponse.Response.Status != int32(cb.Status_SUCCESS) {\n\t\treturn errors.Errorf(\"chaincode install failed with status: %d - %s\", proposalResponse.Response.Status, proposalResponse.Response.Message)\n\t}\n\tlogger.Infof(\"Installed remotely: %v\", proposalResponse)\n\n\ticr := &lb.InstallChaincodeResult{}\n\terr = proto.Unmarshal(proposalResponse.Response.Payload, icr)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to unmarshal proposal response's response payload\")\n\t}\n\tlogger.Infof(\"Chaincode code package identifier: %s\", icr.PackageId)\n\n\treturn nil\n}\n\nfunc (i *Installer) createInstallProposal(pkgBytes []byte, creatorBytes []byte) (*pb.Proposal, error) {\n\tinstallChaincodeArgs := &lb.InstallChaincodeArgs{\n\t\tChaincodeInstallPackage: pkgBytes,\n\t}\n\n\tinstallChaincodeArgsBytes, err := proto.Marshal(installChaincodeArgs)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to marshal InstallChaincodeArgs\")\n\t}\n\n\tccInput := &pb.ChaincodeInput{Args: [][]byte{[]byte(\"InstallChaincode\"), installChaincodeArgsBytes}}\n","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/install.go#L155-L191","documentation":"After a successful install endorsement, submitInstallProposal() failed to proto-unmarshal Response.Payload into lb.InstallChaincodeResult, which should contain the PackageId. The success response body does not match the expected protobuf schema.","triggerScenarios":"proto.Unmarshal(proposalResponse.Response.Payload, icr) errors right after a SUCCESS install response, e.g. payload produced by a peer running a different Fabric version's _lifecycle result type.","commonSituations":"Version-skew between peer CLI and peer node binaries; custom/patched peers emitting different payloads; truncated payloads from flaky network layers.","solutions":["Align peer CLI binary version with the peer node's Fabric version.","Retry the command; note the install itself may have succeeded — verify with `peer lifecycle chaincode queryinstalled`.","Inspect peer logs to see what the peer serialized.","Rebuild the CLI from the matching Fabric release tag if using a custom build."],"exampleFix":"// before: mismatched binaries\n./peer-2.2 lifecycle chaincode install --path mycc.tar.gz  # peer runs v2.5\n// after\n./peer-2.5 lifecycle chaincode install --path mycc.tar.gz","handlingStrategy":"try-catch","validationCode":"// check version compatibility before running lifecycle commands\ncliVer, peerVer := getCliVersion(), getPeerVersion()\nif cliVer != peerVer {\n    return fmt.Errorf(\"CLI %s does not match peer %s\", cliVer, peerVer)\n}","typeGuard":"func validInstallResult(b []byte) (*lb.InstallChaincodeResult, bool) {\n    r := &lb.InstallChaincodeResult{}\n    if proto.Unmarshal(b, r) != nil || r.PackageId == \"\" { return nil, false }\n    return r, true\n}","tryCatchPattern":"if err := install(); err != nil {\n    if strings.Contains(err.Error(), \"failed to unmarshal\") {\n        // install likely succeeded; verify with queryinstalled\n        return verifyInstalled(pkgLabel)\n    }\n    return err\n}","preventionTips":["Align peer CLI and peer node versions","Verify success with queryinstalled after unmarshal errors","Avoid custom peer builds altering result payloads","Retry on transient network truncation"],"tags":["fabric","protobuf","unmarshal","version-mismatch"],"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"}