{"record":{"id":"0268c916b28d7370","repo":"risingwavelabs/risingwave","slug":"expect-initresponse-but-get","errorCode":null,"errorMessage":"expect InitResponse but get {:?}","messagePattern":"expect InitResponse but get (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/rpc_client/src/stream_client.rs","lineNumber":109,"sourceCode":"                init_request,\n            )),\n        };\n        let mut client = self.0.clone();\n        let (handle, first_rsp) =\n            UnboundedBidiStreamHandle::initialize(first_request, |rx| async move {\n                client\n                    .streaming_control_stream(UnboundedReceiverStream::new(rx))\n                    .await\n                    .map(|response| response.into_inner().map_err(RpcError::from_stream_status))\n                    .map_err(RpcError::from_stream_status)\n            })\n            .await?;\n        match first_rsp {\n            StreamingControlStreamResponse {\n                response: Some(streaming_control_stream_response::Response::Init(InitResponse {})),\n            } => {}\n            other => {\n                return Err(anyhow!(\"expect InitResponse but get {:?}\", other).into());\n            }\n        };\n        Ok(handle)\n    }\n}\n","sourceCodeStart":91,"sourceCodeEnd":115,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/rpc_client/src/stream_client.rs#L91-L115","documentation":"StreamClient::start_streaming_control opens a streaming control stream and expects the very first StreamingControlStreamResponse to be an Init response. Anything else means the stream engine did not initialize the control stream correctly, so the client refuses to hand back the control handle.","triggerScenarios":"Calling start_streaming_control when the first response from the compute node is not Response::Init — e.g. the server pushed an error/completion message first, stream engine is unhealthy, or component versions are skewed.","commonSituations":"Compute node crashed or is shutting down while the client connects; version mismatch between frontend/meta and stream engine; network proxy mangling the gRPC stream; stale stream reused from a failed actor.","solutions":["Check the target compute node's logs for stream-creation errors around this time","Verify all components run the same RisingWave version; restart mismatched nodes","Retry start_streaming_control; if persistent, check node health and connectivity (proxies, load balancers)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Rust\nmatch stream_client.start_streaming_control(...).await {\n    Ok(handle) => handle,\n    Err(e) if e.to_string().contains(\"expect InitResponse\") => {\n        tracing::warn!(\"control stream not initialized: {e:#}; retrying\");\n        stream_client.start_streaming_control(...).await?\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Check compute node health before starting control streams","Use a fresh client/stream per start attempt — never reuse a failed stream","Keep frontend/meta/stream-engine versions in lockstep","Bypass or correctly configure proxies for gRPC streaming"],"tags":["grpc","streaming","protocol","stream-engine"],"backgroundTag":"unexpected-response-shape","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}