risingwavelabs/risingwave · error · MetadataModelError
Pb decode error: {0}
Error message
Pb decode error: {0} What it means
`MetadataModelError::PbDecode` wraps a `prost::DecodeError` raised while decoding a protobuf-encoded metadata model (e.g. actor, fragment, sink, or database objects stored in the meta backend). It means bytes persisted in the metadata store cannot be parsed with the current protobuf schema — typically version skew or store corruption.
Source
Thrown at src/meta/src/model/error.rs:24
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use anyhow::anyhow;
use risingwave_pb::PbFieldNotFound;
use risingwave_rpc_client::error::ToTonicStatus;
use thiserror::Error;
pub type MetadataModelResult<T> = std::result::Result<T, MetadataModelError>;
#[derive(Error, Debug)]
pub enum MetadataModelError {
#[error("Pb decode error: {0}")]
PbDecode(#[from] prost::DecodeError),
#[error(transparent)]
InternalError(
#[from]
#[backtrace]
anyhow::Error,
),
}
impl From<PbFieldNotFound> for MetadataModelError {
fn from(p: PbFieldNotFound) -> Self {
MetadataModelError::InternalError(anyhow::anyhow!(
"Failed to decode prost: field not found `{}`",
p.0
))
}
}View on GitHub (pinned to 6469eb736d)
Solutions
- Pin all components (meta, frontend, compute) to the same RisingWave version so the schema matches the stored data.
- Identify the specific object being decoded from the surrounding error context and delete/recreate it if it's safely rebuildable (e.g. a stale sink or materialized view).
- If corruption is systemic, restore the metadata store from backup or re-bootstrap the cluster.
- Never downgrade below the version that wrote the metadata; run schema-compatible upgrades.
Defensive patterns
Strategy: try-catch
Validate before calling
// Validate stored bytes can be decoded before use
let mut buf = bytes.as_slice();
let decoded = T::decode(&mut buf)
.map_err(MetadataModelError::PbDecode)?; Try / catch
match load_metadata_model(key).await {
Err(MetadataModelError::PbDecode(de)) => {
tracing::error!("corrupt/incompatible metadata at {key}: {de}; recreate or restore from backup");
}
other => { /* normal handling */ }
} Prevention
- Never downgrade below the version that wrote the metadata store
- Keep all cluster components on the same version
- Back up the metadata store before upgrades; test restore procedures
When it happens
Trigger: Any meta service call that loads a persisted metadata model whose stored bytes fail prost decoding (schema changed between versions, truncated/corrupt row, wrong key type read).
Common situations: RisingWave upgrade/downgrade with changed protobuf definitions; manual tampering or corruption of the metadata store; writing with a newer version and reading with an older binary.
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.
Related errors
- Failed to decode prost: field not found `{}`
- None msg in request
- empty commit metadata
- empty vnode bitmap
- Failed to decode prost: field not found `{}`
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/7998f2bec80fcd02.
Report an issue: GitHub.