{"record":{"id":"29eeea7d13d5268c","repo":"hyperledger/fabric","slug":"receive-from-chaincode-support-stream-failed","errorCode":null,"errorMessage":"receive from chaincode support stream failed","messagePattern":"receive from chaincode support stream failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/handler.go","lineNumber":446,"sourceCode":"\t}\n\tmsgAvail := make(chan *recvMsg, 1)\n\n\treceiveMessage := func() {\n\t\tin, err := h.chatStream.Recv()\n\t\tmsgAvail <- &recvMsg{in, err}\n\t}\n\n\tgo receiveMessage()\n\tfor {\n\t\tselect {\n\t\tcase rmsg := <-msgAvail:\n\t\t\tswitch {\n\t\t\t// Defer the deregistering of the this handler.\n\t\t\tcase rmsg.err == io.EOF:\n\t\t\t\tchaincodeLogger.Debugf(\"received EOF, ending chaincode support stream: %s\", rmsg.err)\n\t\t\t\treturn rmsg.err\n\t\t\tcase rmsg.err != nil:\n\t\t\t\terr := errors.Wrap(rmsg.err, \"receive from chaincode support stream failed\")\n\t\t\t\tchaincodeLogger.Debugf(\"%+v\", err)\n\t\t\t\treturn err\n\t\t\tcase rmsg.msg == nil:\n\t\t\t\terr := errors.New(\"received nil message, ending chaincode support stream\")\n\t\t\t\tchaincodeLogger.Debugf(\"%+v\", err)\n\t\t\t\treturn err\n\t\t\tdefault:\n\t\t\t\terr := h.handleMessage(rmsg.msg)\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = errors.WithMessage(err, \"error handling message, ending stream\")\n\t\t\t\t\tchaincodeLogger.Errorf(\"[%s] %+v\", shorttxid(rmsg.msg.Txid), err)\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tgo receiveMessage()\n\t\t\t}\n\n\t\tcase sendErr := <-h.errChan:","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/handler.go#L428-L464","documentation":"Returned by Handler.ProcessStream when the gRPC chat stream Recv returns an error other than EOF while reading from the chaincode runtime. It wraps the transport-level failure (connection reset, stream broken) that ends the chaincode support stream.","triggerScenarios":"Thrown at core/chaincode/handler.go:446 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the chaincode container/process logs for a crash and restart it","Verify network/timeout settings between peer and chaincode if it recurs"],"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"}