{"record":{"id":"16139a9b5f42b724","repo":"hyperledger/fabric","slug":"proposal-failed-with-status-d-s-16139a","errorCode":null,"errorMessage":"proposal failed with status: %d - %s","messagePattern":"proposal failed with status: (.+?) - (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/getinstalledpackage.go","lineNumber":143,"sourceCode":"\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to create signed proposal\")\n\t}\n\n\tproposalResponse, err := i.EndorserClient.ProcessProposal(context.Background(), signedProposal)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to endorse proposal\")\n\t}\n\n\tif proposalResponse == nil {\n\t\treturn errors.New(\"received nil proposal response\")\n\t}\n\n\tif proposalResponse.Response == nil {\n\t\treturn errors.New(\"received proposal response with nil response\")\n\t}\n\n\tif proposalResponse.Response.Status != int32(cb.Status_SUCCESS) {\n\t\treturn errors.Errorf(\"proposal failed with status: %d - %s\", proposalResponse.Response.Status, proposalResponse.Response.Message)\n\t}\n\n\treturn i.writePackage(proposalResponse)\n}\n\nfunc (i *InstalledPackageGetter) writePackage(proposalResponse *pb.ProposalResponse) error {\n\tresult := &lb.GetInstalledChaincodePackageResult{}\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\n\toutputFile := filepath.Join(i.Input.OutputDirectory, i.Input.PackageID+\".tar.gz\")\n\n\tdir, name := filepath.Split(outputFile)\n\t// translate dir into absolute path\n\tif dir, err = filepath.Abs(dir); err != nil {\n\t\treturn err","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/getinstalledpackage.go#L125-L161","documentation":"GetInstalledChaincodePackage's Get() received an endorsed proposal response whose embedded Response status was not cb.Status_SUCCESS. The peer rejected or failed the _lifecycle query, and it surfaces the peer's status code and message. This is the CLI reporting a server-side failure, not a client bug.","triggerScenarios":"Running `peer lifecycle chaincode getinstalledpackage` where the peer's endorsement of the GetInstalledChaincodePackage query returns a non-200 Response.Status (e.g. the PackageID does not exist on the peer, or the caller lacks permission).","commonSituations":"Querying a package ID that was never installed on the targeted peer; typos in the --package-id flag; targeting a peer in another org that has not installed the chaincode; peer returning 500 due to _lifecycle internal errors.","solutions":["Read the peer's status/message in the error to identify the server-side cause (e.g. NOT_FOUND means the package ID isn't installed on that peer).","Run `peer lifecycle chaincode queryinstalled` on the same peer to get the correct PackageID.","Verify --peerAddresses points to a peer in your org where the package was actually installed.","Check the peer container logs for the underlying _lifecycle error."],"exampleFix":"// before: guessing package ID\npeer lifecycle chaincode getinstalledpackage --package-id cc_1:abc123\n// after: query first, then fetch\npeer lifecycle chaincode queryinstalled\npeer lifecycle chaincode getinstalledpackage --package-id cc_1:<valid-package-id-from-query>","handlingStrategy":"validation","validationCode":"pid, err := queryInstalledPackageID(peerConn, packageLabel)\nif err != nil { return err }\n// only call getinstalledpackage with a PackageID known to exist on that peer\nreturn getInstalledPackage(peerConn, pid)","typeGuard":"func hasResponse(r *pb.ProposalResponse) bool { return r != nil && r.Response != nil }","tryCatchPattern":"res, err := getter.Get()\nif err != nil {\n    if strings.Contains(err.Error(), \"proposal failed with status\") {\n        // parse status/message, e.g. fall back to queryinstalled\n    }\n    return err\n}","preventionTips":["Always run queryinstalled against the same peer first","Verify --package-id with a lint/script before invoking","Target a peer in your own org","Keep peer CLI and peer versions aligned"],"tags":["fabric","peer","endorsement","proposal-failed"],"backgroundTag":"proposal-response-non-success","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"}