{"record":{"id":"169ba54a95445ad9","repo":"risingwavelabs/risingwave","slug":"failed-to-decode-prost-field-not-found","errorCode":null,"errorMessage":"Failed to decode prost: field not found `{}`","messagePattern":"Failed to decode prost: field not found `(.+?)`","errorType":"error_code","errorClass":"ArrayError","httpStatus":null,"severity":"error","filePath":"src/common/src/array/error.rs","lineNumber":56,"sourceCode":"\n    #[error(\"Convert from arrow error: {0}\")]\n    FromArrow(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n\n    #[error(\"Convert to arrow error: {0}\")]\n    ToArrow(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n}\n\nimpl From<PbFieldNotFound> for ArrayError {\n    fn from(err: PbFieldNotFound) -> Self {\n        anyhow!(\"Failed to decode prost: field not found `{}`\", err.0).into()\n    }\n}\n\nimpl From<Infallible> for ArrayError {\n    fn from(err: Infallible) -> Self {\n        unreachable!(\"Infallible error: {:?}\", err)\n    }\n}\n\nimpl ArrayError {\n    pub fn internal(msg: impl ToString) -> Self {\n        ArrayError::Internal(anyhow!(msg.to_string()))\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":71,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/common/src/array/error.rs#L38-L71","documentation":"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.","triggerScenarios":"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`.","commonSituations":"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.","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."],"exampleFix":"// before: decoding may panic/error on missing field\nlet arr = ArrayImpl::from_protobuf(&pb_array, cardinality)?;\n// after: pre-validate required fields\nensure!(!pb_array.values.is_empty(), \"array must have body buffer\");\nensure!(pb_array.null_bitmap.is_some(), \"array must have null bitmap\");\nlet arr = ArrayImpl::from_protobuf(&pb_array, cardinality)?;","handlingStrategy":"try-catch","validationCode":"fn valid_pb_array(a: &PbArray) -> bool {\n    a.null_bitmap.is_some() && !a.values.is_empty()\n}","typeGuard":"fn is_decodable(a: &PbArray) -> bool { a.null_bitmap.is_some() }","tryCatchPattern":"match ArrayImpl::from_protobuf(&pb, card) {\n    Ok(arr) => arr,\n    Err(e) if e.to_string().contains(\"field not found\") => fallback_decode_legacy(&pb)?,\n    Err(e) => return Err(e.into()),\n}","preventionTips":["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"],"tags":["rust","protobuf","array","deserialization"],"backgroundTag":"protobuf-unmarshal-failed","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}