{"record":{"id":"67e20ed09830524f","repo":"hyperledger/fabric","slug":"service-stream-returned-with-invalid-response-type","errorCode":null,"errorMessage":"service stream returned with invalid response type","messagePattern":"service stream returned with invalid response type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/common/cluster/commauth.go","lineNumber":342,"sourceCode":"\treturn nil, errors.New(\"service message type not valid\")\n}\n\nfunc BuildStepRespone(stepResponse *orderer.ClusterNodeServiceStepResponse) (*orderer.StepResponse, error) {\n\tif stepResponse == nil {\n\t\treturn nil, errors.New(\"input response object is nil\")\n\t}\n\tif respPayload := stepResponse.GetTranorderRes(); respPayload != nil {\n\t\tstepResponse := &orderer.StepResponse{\n\t\t\tPayload: &orderer.StepResponse_SubmitRes{\n\t\t\t\tSubmitRes: &orderer.SubmitResponse{\n\t\t\t\t\tChannel: respPayload.Channel,\n\t\t\t\t\tStatus:  respPayload.Status,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\treturn stepResponse, nil\n\t}\n\treturn nil, errors.New(\"service stream returned with invalid response type\")\n}\n","sourceCodeStart":324,"sourceCodeEnd":344,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/common/cluster/commauth.go#L324-L344","documentation":"BuildStepRespone only knows how to map a response whose payload is TranorderRes. If the ClusterNodeServiceStepResponse carries none of the recognized payload types, the conversion is impossible and this error is returned.","triggerScenarios":"Calling BuildStepRespone with a response whose GetTranorderRes() returns nil — e.g. the peer sent a status-only or unrecognized response variant on the cluster Step stream.","commonSituations":"Mixed-version fabric nodes where the remote orderer responds with a payload type this node doesn't understand; a misrouted request hitting a node that answers with a non-TranorderRes message.","solutions":["Ensure all cluster nodes run a compatible fabric version so responses use the TranorderRes payload","Log/inspect the raw response type to identify which variant was returned","Return a typed error upstream so Recv can retry against a different node"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if stepResponse != nil && stepResponse.GetTranorderRes() == nil {\n    return fmt.Errorf(\"unsupported step response payload type\")\n}","typeGuard":"func isTranorderRes(r *orderer.ClusterNodeServiceStepResponse) bool {\n    return r != nil && r.GetTranorderRes() != nil\n}","tryCatchPattern":"resp, err := BuildStepRespone(stepResponse)\nif err != nil {\n    return fmt.Errorf(\"cannot convert node response: %w\", err)\n}","preventionTips":["Keep fabric versions uniform across orderer cluster nodes","Switch on the response oneof explicitly and log unknown variants","Add integration tests for every response payload variant"],"tags":["grpc","protocol","orderer","cluster","version-mismatch"],"backgroundTag":"unexpected-response-type","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"}