{"record":{"id":"ad5381decd753f49","repo":"influxdata/influxdb","slug":"header-crc32-mismatch-expected-expected-010x-actual-actual","errorCode":null,"errorMessage":"header CRC32 mismatch: expected {expected:#010x}, actual {actual:#010x}","messagePattern":"header CRC32 mismatch: expected (.+?), actual (.+?)","errorType":"error_code","errorClass":"FormatError","httpStatus":null,"severity":"critical","filePath":"influxdb3_catalog/src/format/mod.rs","lineNumber":183,"sourceCode":"pub enum FormatError {\n    /// A decoded record failed to apply to the catalog.\n    #[error(transparent)]\n    Apply(#[from] apply::ApplyError),\n\n    /// Invalid magic bytes at start of file.\n    #[error(\"invalid magic bytes: expected {expected:?}, got {actual:?}\")]\n    InvalidMagic { expected: [u8; 4], actual: [u8; 4] },\n\n    /// Unsupported format version.\n    #[error(\"unsupported format version: {version}\")]\n    UnsupportedVersion { version: u32 },\n\n    /// Buffer too short for required data.\n    #[error(\"buffer too short: expected at least {expected} bytes, got {actual}\")]\n    BufferTooShort { expected: usize, actual: usize },\n\n    /// Header CRC32 checksum mismatch.\n    #[error(\"header CRC32 mismatch: expected {expected:#010x}, actual {actual:#010x}\")]\n    HeaderCrc32Mismatch { expected: u32, actual: u32 },\n\n    /// Payload CRC32 checksum mismatch.\n    #[error(\"payload CRC32 mismatch: expected {expected:#010x}, computed {computed:#010x}\")]\n    Crc32Mismatch { expected: u32, computed: u32 },\n\n    /// Unknown record type without UPGRADE_SAFE flag — hard error.\n    #[error(\"unknown record id {record_id} without UPGRADE_SAFE flag\")]\n    UnknownNonUpgradeSafeRecord { record_id: u16 },\n\n    /// Invalid record length.\n    #[error(\"invalid record length: {length}\")]\n    InvalidRecordLength { length: u32 },\n\n    /// Record data exceeds remaining file.\n    #[error(\n        \"record data exceeds file bounds: offset {offset}, length {length}, file size {file_size}\"\n    )]","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/format/mod.rs#L165-L201","documentation":"`FormatError::HeaderCrc32Mismatch` is returned when the CRC32 checksum stored in a catalog file's header does not match the checksum computed over the header bytes read from disk. This detects header corruption — the file content has changed since it was written.","triggerScenarios":"Reading a catalog file whose header CRC field (expected) differs from the computed CRC over the actual header bytes.","commonSituations":"Bit rot or disk corruption; files modified/truncated after writing; bad restores or manual edits; failing storage hardware.","solutions":["Restore the catalog file from a verified backup","Check the storage device/filesystem for errors (SMART, fsck) before writing new data","Do not hand-edit catalog files; re-generate or repair via official tooling","Compare against a known-good copy to confirm the extent of corruption"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match result {\n    Err(FormatError::HeaderCrc32Mismatch { expected, actual }) => {\n        log::error!(\"catalog header corrupt: stored {expected:#010x}, computed {actual:#010x}\");\n        // restore from verified backup\n    }\n    r => r?,\n}","preventionTips":["Run periodic filesystem/device health checks (SMART, fsck)","Verify checksums on backups before trusting restores","Never hand-edit catalog files","Maintain off-host backups of catalog data"],"tags":["catalog","corruption","crc32","file-integrity"],"backgroundTag":"checksum-mismatch","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}