{"record":{"id":"e2a3602def46199f","repo":"risingwavelabs/risingwave","slug":"checksum-mismatch-expected-expected-found-fo","errorCode":null,"errorMessage":"Checksum mismatch: expected {expected}, found: {found}","messagePattern":"Checksum mismatch: expected (.+?), found: (.+?)","errorType":"error_code","errorClass":"BackupError","httpStatus":null,"severity":"critical","filePath":"src/storage/backup/src/error.rs","lineNumber":52,"sourceCode":"    #[error(\"StateStorage error: {0}\")]\n    StateStorage(\n        #[backtrace]\n        #[source]\n        BoxedError,\n    ),\n    #[error(\"Encoding error: {0}\")]\n    Encoding(\n        #[backtrace]\n        #[source]\n        BoxedError,\n    ),\n    #[error(\"Decoding error: {0}\")]\n    Decoding(\n        #[backtrace]\n        #[source]\n        BoxedError,\n    ),\n    #[error(\"Checksum mismatch: expected {expected}, found: {found}\")]\n    ChecksumMismatch { expected: u64, found: u64 },\n    #[error(\"Meta storage is not empty before being restored\")]\n    NonemptyMetaStorage,\n    #[error(transparent)]\n    Other(\n        #[from]\n        #[backtrace]\n        anyhow::Error,\n    ),\n}\n\nimpl From<std::io::Error> for BackupError {\n    fn from(err: std::io::Error) -> Self {\n        if err.kind() == std::io::ErrorKind::UnexpectedEof {\n            Self::Decoding(anyhow::anyhow!(\"unexpected EOF while decoding meta snapshot\").into())\n        } else {\n            Self::BackupStorage(err.into())\n        }","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/storage/backup/src/error.rs#L34-L70","documentation":"`BackupError::ChecksumMismatch` signals that data read from a backup did not match its stored checksum: the computed checksum (`found`) differs from the recorded one (`expected`). This guards against silent corruption of backup artifacts in storage.","triggerScenarios":"During restore or verification, a backup file/manifest's computed checksum differs from the value recorded when the backup was written, e.g. `ChecksumMismatch { expected: 123, found: 456 }`.","commonSituations":"Bit-rot or corruption in the object store; truncated/partial uploads or downloads; manual modification of backup files; copying artifacts with a lossy tool.","solutions":["Treat the backup artifact as corrupt; do not restore from it.","Re-download/copy the backup from the original location and verify again.","Re-create the backup from the source cluster if the artifact is unavailable elsewhere."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify checksums of all backup artifacts before restore\nfn verify(expected: u64, actual: u64) -> Result<(), String> {\n    (expected == actual).then(|| ()).ok_or_else(|| format!(\"checksum mismatch: expected {expected}, found {actual}\"))\n}","typeGuard":null,"tryCatchPattern":"match restore().await {\n    Err(e @ BackupError::ChecksumMismatch { .. }) => {\n        tracing::error!(error = ?e, \"backup corrupted — abort restore, do NOT proceed\");\n        return Err(anyhow::anyhow!(\"backup artifact corrupt; obtain a fresh backup\"));\n    }\n    other => other?,\n}","preventionTips":["Verify checksums immediately after upload and after any transfer.","Enable object-store integrity features (S3 ETag/SHA checks).","Keep at least two independent copies of backups in different locations."],"tags":["backup","checksum","corruption","rust"],"backgroundTag":"checksum-mismatch","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"}