{"record":{"id":"f4209427a004c72e","repo":"risingwavelabs/risingwave","slug":"stream-error-0","errorCode":null,"errorMessage":"Stream error: {0}","messagePattern":"Stream error: (.+?)","errorType":"error_code","errorClass":"ErrorCode::StreamError","httpStatus":null,"severity":"error","filePath":"src/frontend/src/error.rs","lineNumber":101,"sourceCode":"        #[source]\n        #[backtrace]\n        // `BatchError`\n        BoxedError,\n    ),\n    #[error(\"Array error: {0}\")]\n    ArrayError(\n        #[from]\n        #[backtrace]\n        ArrayError,\n    ),\n    #[cfg(feature = \"datafusion\")]\n    #[error(\"DataFusion error: {0}\")]\n    DataFusionError(\n        #[from]\n        #[backtrace]\n        datafusion_common::DataFusionError,\n    ),\n    #[error(\"Stream error: {0}\")]\n    StreamError(\n        #[backtrace]\n        #[source]\n        BoxedError,\n    ),\n    // TODO(error-handling): there's a limitation that `#[transparent]` can't be used with `#[backtrace]` if no `#[from]`\n    // So we emulate a transparent error with \"{0}\" display here.\n    #[error(\"{0}\")]\n    RpcError(\n        #[source]\n        #[backtrace]\n        // `tonic::transport::Error`, `TonicStatusWrapper`, or `RpcError`\n        BoxedError,\n    ),\n    // TODO: use a new type for bind error\n    // TODO(error-handling): should prefer use error types than strings.\n    #[error(\"Bind error: {0}\")]\n    BindError(#[message] String),","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/error.rs#L83-L119","documentation":"`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]`.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"-- before: source column int32 receiving 'abc'\nCREATE SOURCE s (v INT) WITH (connector='kafka', ...);\n-- after: tolerant parsing\nCREATE SOURCE s (v VARCHAR) WITH (...);\nCREATE MATERIALIZED VIEW mv AS SELECT try_cast(v AS INT) AS v FROM s;","handlingStrategy":"retry","validationCode":"null","typeGuard":"fn is_stream_error(e: &RwError) -> bool { matches!(e.get_code(), ErrorCode::StreamError(_)) }","tryCatchPattern":"if matches!(err.get_code(), ErrorCode::StreamError(_)) { check_fragment_logs(); if transient(&err) { wait_for_recovery(); } else { fix_data_or_sink(&err); } }","preventionTips":["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)"],"tags":["stream","executor","runtime"],"backgroundTag":"database-query-failed","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"}