risingwavelabs/risingwave · error · BackupError

Decoding error: {0}

Error message

Decoding error: {0}

What it means

`BackupError::Decoding` wraps an underlying error raised when deserializing/decoding backup data read from backup storage. The original decoder error is boxed as source with backtrace, indicating the bytes on storage could not be parsed into the expected structure.

Source

Thrown at src/storage/backup/src/error.rs:46

    #[error("MetaStorage error: {0}")]
    MetaStorage(
        #[backtrace]
        #[source]
        BoxedError,
    ),
    #[error("StateStorage error: {0}")]
    StateStorage(
        #[backtrace]
        #[source]
        BoxedError,
    ),
    #[error("Encoding error: {0}")]
    Encoding(
        #[backtrace]
        #[source]
        BoxedError,
    ),
    #[error("Decoding error: {0}")]
    Decoding(
        #[backtrace]
        #[source]
        BoxedError,
    ),
    #[error("Checksum mismatch: expected {expected}, found: {found}")]
    ChecksumMismatch { expected: u64, found: u64 },
    #[error("Meta storage is not empty before being restored")]
    NonemptyMetaStorage,
    #[error(transparent)]
    Other(
        #[from]
        #[backtrace]
        anyhow::Error,
    ),
}

impl From<std::io::Error> for BackupError {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Check the wrapped source error to identify the malformed artifact.
  2. Verify the backup was created by a compatible version and was fully uploaded (checksum/size).
  3. Re-create the backup from a healthy cluster and retry the restore with the new artifact.
Defensive patterns

Strategy: validation

Validate before calling

// Validate backup artifact before attempting decode
fn artifact_complete(meta: &ObjectMeta) -> bool {
    meta.content_length == meta.expected_size
}

Try / catch

match load_backup_manifest(bytes).await {
    Err(e @ BackupError::Decoding(_)) => {
        tracing::error!(source = ?e.source(), "backup artifact undecodable");
        // verify artifact version/size, obtain fresh backup
    }
    other => other?,
}

Prevention

When it happens

Trigger: Restore/recovery paths that read a backup manifest or snapshot blob from backup storage and fail to decode it (prost decode failure, unexpected format, truncated file).

Common situations: Restoring a backup produced by an incompatible RisingWave version; partially uploaded/corrupted backup files; manual edits or truncated downloads of backup artifacts.

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


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/9c041b1eefd880da. Report an issue: GitHub.