{"record":{"id":"c3724533cca30c13","repo":"risingwavelabs/risingwave","slug":"decode-error-0","errorCode":null,"errorMessage":"Decode error: {0}","messagePattern":"Decode error: (.+?)","errorType":"error_code","errorClass":"HummockError","httpStatus":null,"severity":"error","filePath":"src/storage/src/hummock/error.rs","lineNumber":35,"sourceCode":"use thiserror::Error;\nuse thiserror_ext::AsReport;\nuse tokio::sync::oneshot::error::RecvError;\n\n// TODO(error-handling): should prefer use error types than strings.\n#[derive(Error, thiserror_ext::ReportDebug, thiserror_ext::Arc)]\n#[thiserror_ext(newtype(name = HummockError, backtrace))]\npub enum HummockErrorInner {\n    #[error(\"Magic number mismatch: expected {expected}, found: {found}\")]\n    MagicMismatch { expected: u32, found: u32 },\n    #[error(\"Invalid format version: {0}\")]\n    InvalidFormatVersion(u32),\n    #[error(\"Checksum mismatch: expected {expected}, found: {found}\")]\n    ChecksumMismatch { expected: u64, found: u64 },\n    #[error(\"Invalid block\")]\n    InvalidBlock,\n    #[error(\"Encode error: {0}\")]\n    EncodeError(String),\n    #[error(\"Decode error: {0}\")]\n    DecodeError(String),\n    #[error(\"ObjectStore failed with IO error: {0}\")]\n    ObjectIoError(\n        #[from]\n        #[backtrace]\n        ObjectError,\n    ),\n    #[error(\"Meta error: {0}\")]\n    MetaError(String),\n    #[error(\"SharedBuffer error: {0}\")]\n    SharedBufferError(String),\n    #[error(\"Wait epoch error: {0}\")]\n    WaitEpoch(String),\n    #[error(\"Next epoch error: {0}\")]\n    NextEpoch(String),\n    #[error(\"Change log retention miss: table {table_id}, epoch {epoch}\")]\n    ChangeLogRetentionMiss { table_id: TableId, epoch: u64 },\n    #[error(\"Time-travel version expired: table {table_id}, epoch {epoch}\")]","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/storage/src/hummock/error.rs#L17-L53","documentation":"A value read by Hummock failed to deserialize (decode) from its stored byte representation; the inner decoder's message is carried in the String payload. It is thrown when stored bytes cannot be converted back into the expected in-memory structure. This usually means the bytes on disk do not match what the current code expects.","triggerScenarios":"Reading/iterating SSTs or shared buffers where prost/row decoding of a value fails.","commonSituations":"Schema/type changes (ALTER TABLE, data type redefinition) after data was written; version upgrades changing wire format without migration; corrupted stored bytes.","solutions":["Check whether the table schema or data types changed since the data was written; restore compatibility or rebuild the table.","Pin all nodes to the same RisingWave version; avoid rolling upgrades across incompatible releases.","If bytes are corrupt, delete the affected object and recover from replica/backup.","Capture the wrapped decode message and report to maintainers if it reproduces on unchanged data."],"exampleFix":"// before: altering column type then reading old data\nALTER TABLE t ALTER COLUMN c TYPE incompatible_new_type;\n// after\nCREATE TABLE t_new AS SELECT c::compatible_type AS c FROM t;  -- rebuild with migration","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Rust\nmatch hummock_read(...) {\n    Err(e) if e.to_string().starts_with(\"Decode error\") => {\n        // check schema drift; rebuild affected table, do not retry same data\n    }\n    r => r?,\n}","preventionTips":["Plan schema changes with data migration (rebuild tables) rather than in-place incompatible changes.","Avoid rolling upgrades across format-incompatible releases.","Backup hummock data before schema migrations."],"tags":["storage","hummock","serialization","decode"],"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"}