{"record":{"id":"972271d395cf1aa4","repo":"hyperledger/fabric","slug":"proposal-failed-with-status-d-s-972271","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/commit.go","lineNumber":200,"sourceCode":"\tif len(responses) == 0 {\n\t\t// this should only be empty due to a programming bug\n\t\treturn errors.New(\"no proposal responses received\")\n\t}\n\n\t// all responses will be checked when the signed transaction is created.\n\t// for now, just set this so we check the first response's status\n\tproposalResponse := responses[0]\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\t// assemble a signed transaction (it's an Envelope message)\n\tenv, err := protoutil.CreateSignedTx(proposal, c.Signer, responses...)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to create signed transaction\")\n\t}\n\n\tvar dg *chaincode.DeliverGroup\n\tvar ctx context.Context\n\tif c.Input.WaitForEvent {\n\t\tvar cancelFunc context.CancelFunc\n\t\tctx, cancelFunc = context.WithTimeout(context.Background(), c.Input.WaitForEventTimeout)\n\t\tdefer cancelFunc()\n\n\t\tdg = chaincode.NewDeliverGroup(\n\t\t\tc.DeliverClients,\n\t\t\tc.Input.PeerAddresses,\n\t\t\tc.Signer,","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/commit.go#L182-L218","documentation":"Commit requires the endorser proposal to have succeeded (Status == Status_SUCCESS, 200). If any (first) response reports a non-success status, the transaction is not assembled and the status plus message are surfaced to the user.","triggerScenarios":"An endorser rejected the commit proposal — e.g. endorsement policy failures, chaincode definition mismatch (sequence/version mismatch vs approved definition), MVCC/txid conflicts, or a chaincode-level error message in proposalResponse.Response.Message.","commonSituations":"Committing a definition whose sequence/version differs from the approved one; not enough orgs endorsing to satisfy the policy; chaincode not installed on the endorsing peer; transient txid collision (`the txid ... already exists`).","solutions":["Read the message in the error for the concrete rejection cause (e.g. 'attempted to define committed sequence X with lower number' or endorsement policy failure).","Ensure all required orgs ran approveformyorg and that each endorser's committed/approved definitions match (--sequence, -v).","Confirm chaincode is installed (peer lifecycle chaincode queryinstalled) on all endorsing peers.","Check peer logs on the failing endorser for the exact chaincode error and re-run after fixing."],"exampleFix":"// before\npeer lifecycle chaincode commit ... --sequence 2   // when approved sequence is 1\n// after\npeer lifecycle chaincode queryapproved -C mychannel -n mycc   # check sequence\npeer lifecycle chaincode commit ... --sequence 1","handlingStrategy":"try-catch","validationCode":"if resp.Response.Status != int32(cb.Status_SUCCESS) {\n    // inspect resp.Response.Message before assembling the tx\n    log.Printf(\"endorsement rejected: %d %s\", resp.Response.Status, resp.Response.Message)\n}","typeGuard":null,"tryCatchPattern":"if err := commit(...); err != nil {\n    var statusErr interface{ Status() int32 }\n    if strings.Contains(err.Error(), \"proposal failed with status\") {\n        // parse message: check sequence/version mismatch, endorsement policy, txid conflicts\n    }\n}","preventionTips":["Run queryapproved/querycommitted to confirm sequence and version match before committing.","Ensure every org required by the endorsement policy approved the definition and is included in commit.","Confirm the chaincode package is installed on all endorsing peers.","Use unique txids; retry only after resolving the underlying rejection cause."],"tags":["hyperledger-fabric","endorsement-failed","proposal-response","chaincode-definition"],"backgroundTag":"endorsement-policy-failure","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"}