{"record":{"id":"b8e6146b22d33870","repo":"hyperledger/fabric","slug":"s-failed-transaction-id-s","errorCode":null,"errorMessage":"%s failed: transaction ID: %s","messagePattern":"(.+?) failed: transaction ID: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/handler.go","lineNumber":299,"sourceCode":"\t}\n\n\tvar txContext *TransactionContext\n\tvar err error\n\tif msg.Type == pb.ChaincodeMessage_INVOKE_CHAINCODE {\n\t\ttxContext, err = h.getTxContextForInvoke(msg.ChannelId, msg.Txid, msg.Payload, \"\")\n\t} else {\n\t\ttxContext, err = h.isValidTxSim(msg.ChannelId, msg.Txid, \"no ledger context\")\n\t}\n\n\th.Metrics.ShimRequestsReceived.With(meterLabels...).Add(1)\n\n\tvar resp *pb.ChaincodeMessage\n\tif err == nil {\n\t\tresp, err = delegate(msg, txContext)\n\t}\n\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"%s failed: transaction ID: %s\", msg.Type, msg.Txid)\n\t\tchaincodeLogger.Errorf(\"[%s] Failed to handle %s. error: %+v\", shorttxid(msg.Txid), msg.Type, err)\n\t\tresp = &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_ERROR, Payload: []byte(err.Error()), Txid: msg.Txid, ChannelId: msg.ChannelId}\n\t}\n\n\tchaincodeLogger.Debugf(\"[%s] Completed %s. Sending %s\", shorttxid(msg.Txid), msg.Type, resp.Type)\n\th.ActiveTransactions.Remove(msg.ChannelId, msg.Txid)\n\th.serialSendAsync(resp)\n\n\tmeterLabels = append(meterLabels, \"success\", strconv.FormatBool(resp.Type != pb.ChaincodeMessage_ERROR))\n\th.Metrics.ShimRequestDuration.With(meterLabels...).Observe(time.Since(startTime).Seconds())\n\th.Metrics.ShimRequestsCompleted.With(meterLabels...).Add(1)\n}\n\nfunc shorttxid(txid string) string {\n\tif len(txid) < 8 {\n\t\treturn txid\n\t}\n\treturn txid[0:8]","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/handler.go#L281-L317","documentation":"Generic wrap applied in HandleTransaction when a delegated chaincode request handler (get state, query, invoke, etc.) fails; the message identifies which request type and transaction failed, with the real cause in the wrapped error.","triggerScenarios":"Thrown at core/chaincode/handler.go:299 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error and the peer log line for the underlying cause","Fix the chaincode request (state access, query syntax, ledger context) and resubmit the transaction"],"exampleFix":null,"handlingStrategy":"try-catch","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"}