risingwavelabs/risingwave · error · ErrorCode::StreamError
Stream error
Error message
Stream error: {0} What it means
`ErrorCode::StreamError` wraps a type-erased `BoxedError` from the streaming engine. Runtime failures inside stream executors (source, aggregate, join, sink executors) are surfaced to the user under this prefix with the real cause chained via `#[source]`.
Solutions
- Inspect the chained `#[source]` error and the affected fragment's logs (MV name maps to fragments via `rw_fragment`)
- Fix the offending upstream data or add cast/filtering in the source definition
- Check sink/connector health for downstream failures
- If a worker crash caused it, RisingWave recovery should resume; verify cluster health
- Scale or adjust parallelism if resource exhaustion is the root cause
Example fix
-- before: source column int32 receiving 'abc' CREATE SOURCE s (v INT) WITH (connector='kafka', ...); -- after: tolerant parsing CREATE SOURCE s (v VARCHAR) WITH (...); CREATE MATERIALIZED VIEW mv AS SELECT try_cast(v AS INT) AS v FROM s;
Defensive patterns
Strategy: retry
Validate before calling
null
Type guard
fn is_stream_error(e: &RwError) -> bool { matches!(e.get_code(), ErrorCode::StreamError(_)) } Try / catch
if matches!(err.get_code(), ErrorCode::StreamError(_)) { check_fragment_logs(); if transient(&err) { wait_for_recovery(); } else { fix_data_or_sink(&err); } } Prevention
- Validate upstream data types against source schemas (use try_cast for dirty data)
- Monitor sink/connector health continuously
- Set up alerts on MV backfill/stream failures
- Design sources with tolerant parsing (VARCHAR + try_cast)
When it happens
Trigger: A materialized view or CDC pipeline hits a runtime failure: upstream data violating an executor's expectation, deserialization failure in a protobuf/json stream source, or downstream sink write errors.
Common situations: Dirty data in a Kafka topic that fails schema parsing, out-of-range values for column types, network issues to external sinks, worker node failures during streaming execution.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- below watermark check condition eval must return bool array
- bigquery insert error: end of resp stream
- Cannot find ' ',please set it.
- CompactionExecutor error
- dynamic filter condition eval must return bool array
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/f4209427a004c72e.
Report an issue: GitHub.
Appendix: source
Thrown at src/frontend/src/error.rs:101
#[source]
#[backtrace]
// `BatchError`
BoxedError,
),
#[error("Array error: {0}")]
ArrayError(
#[from]
#[backtrace]
ArrayError,
),
#[cfg(feature = "datafusion")]
#[error("DataFusion error: {0}")]
DataFusionError(
#[from]
#[backtrace]
datafusion_common::DataFusionError,
),
#[error("Stream error: {0}")]
StreamError(
#[backtrace]
#[source]
BoxedError,
),
// TODO(error-handling): there's a limitation that `#[transparent]` can't be used with `#[backtrace]` if no `#[from]`
// So we emulate a transparent error with "{0}" display here.
#[error("{0}")]
RpcError(
#[source]
#[backtrace]
// `tonic::transport::Error`, `TonicStatusWrapper`, or `RpcError`
BoxedError,
),
// TODO: use a new type for bind error
// TODO(error-handling): should prefer use error types than strings.
#[error("Bind error: {0}")]
BindError(#[message] String),View on GitHub (pinned to 6469eb736d)