risingwavelabs/risingwave · error · ArrayError
Failed to decode prost: field not found `{}`
Error message
Failed to decode prost: field not found `{}` What it means
This error is thrown when converting a `PbFieldNotFound` protobuf decoding error into an `ArrayError`. It means a serialized array's protobuf representation is missing a field the Rust array type requires during deserialization (e.g. a null bitmap or data buffer). It indicates the incoming protobuf bytes do not match the expected array schema.
Source
Thrown at src/common/src/array/error.rs:56
#[error("Convert from arrow error: {0}")]
FromArrow(
#[source]
#[backtrace]
BoxedError,
),
#[error("Convert to arrow error: {0}")]
ToArrow(
#[source]
#[backtrace]
BoxedError,
),
}
impl From<PbFieldNotFound> for ArrayError {
fn from(err: PbFieldNotFound) -> Self {
anyhow!("Failed to decode prost: field not found `{}`", err.0).into()
}
}
impl From<Infallible> for ArrayError {
fn from(err: Infallible) -> Self {
unreachable!("Infallible error: {:?}", err)
}
}
impl ArrayError {
pub fn internal(msg: impl ToString) -> Self {
ArrayError::Internal(anyhow!(msg.to_string()))
}
}
View on GitHub (pinned to 6469eb736d)
Solutions
- Verify the protobuf payload was produced by a matching RisingWave version / schema (check `prost` generated definitions).
- Inspect the `PbArray` before decoding: ensure `null_bitmap` and required `values`/`body` fields are populated.
- Check for version skew between the component that serialized the array (e.g. meta/storage) and the one deserializing it.
- If decoding optional legacy data, handle the `PbFieldNotFound` case explicitly instead of relying on the blanket From impl.
Example fix
// before: decoding may panic/error on missing field let arr = ArrayImpl::from_protobuf(&pb_array, cardinality)?; // after: pre-validate required fields ensure!(!pb_array.values.is_empty(), "array must have body buffer"); ensure!(pb_array.null_bitmap.is_some(), "array must have null bitmap"); let arr = ArrayImpl::from_protobuf(&pb_array, cardinality)?;
Defensive patterns
Strategy: try-catch
Validate before calling
fn valid_pb_array(a: &PbArray) -> bool {
a.null_bitmap.is_some() && !a.values.is_empty()
} Type guard
fn is_decodable(a: &PbArray) -> bool { a.null_bitmap.is_some() } Try / catch
match ArrayImpl::from_protobuf(&pb, card) {
Ok(arr) => arr,
Err(e) if e.to_string().contains("field not found") => fallback_decode_legacy(&pb)?,
Err(e) => return Err(e.into()),
} Prevention
- Pin RisingWave version across all components to avoid protobuf schema skew
- Validate PbArray required fields before decoding
- Add round-trip encode/decode tests for array types
When it happens
Trigger: Calling `ArrayImpl::from_protobuf` (or any array-type-specific `from_protobuf`) on a `PbArray` where a required field such as `null_bitmap` or `body` is absent, so `get_null_bitmap()`/`get_*` returns `PbFieldNotFound`, which is converted via `From<PbFieldNotFound> for ArrayError`.
Common situations: Version skew between writer and reader where the protobuf schema changed; hand-crafted or corrupted protobuf payloads; deserializing an array written by a different array type or an old RisingWave version.
Understand the failure class
Background: "cannot parse invalid wire-format data", "cannot unmarshal", "failed unmarshalling": protobuf unmarshal errors explained — this error's family across 10 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Must have exactly 1 buffer in a jsonb array
- Must have no buffer in a list array
- Must have at least one element in offsets
- Invalid list encoding: {0}
- unspecified type of `WindowFrame`
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/169ba54a95445ad9.
Report an issue: GitHub.