{"record":{"id":"c4fa552d44a1e4bb","repo":"atuinsh/atuin","slug":"unknown-kv-record-version-other","errorCode":null,"errorMessage":"unknown kv record version {other:?}","messagePattern":"unknown kv record version (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin-kv/src/store/record.rs","lineNumber":97,"sourceCode":"                    let (value, bytes) =\n                        decode::read_str_from_slice(bytes).map_err(error_report)?;\n                    (Some(value.to_owned()), bytes)\n                } else {\n                    (None, bytes)\n                };\n\n                if !bytes.is_empty() {\n                    bail!(\"trailing bytes in encoded kvrecord. malformed\");\n                }\n\n                Ok(Self {\n                    namespace: namespace.to_owned(),\n                    key: key.to_owned(),\n                    value,\n                })\n            }\n            other => {\n                bail!(\"unknown kv record version {other:?}\");\n            }\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use atuin_domain::record::RecordVersion;\n    use rstest::rstest;\n\n    use super::{DecryptedData, KvRecord};\n\n    #[rstest]\n    #[case::some(\n        Some(\"baz\".to_owned()),\n        &[0x94, 0xa3, b'f', b'o', b'o', 0xa3, b'b', b'a', b'r', 0xc3, 0xa3, b'b', b'a', b'z']\n    )]\n    #[case::none(None, &[0x94, 0xa3, b'f', b'o', b'o', 0xa3, b'b', b'a', b'r', 0xc2])]","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin-kv/src/store/record.rs#L79-L115","documentation":"The KV record decoder reads a leading version byte and implements only known versions. Any other version triggers 'unknown kv record version'. This protects against decoding payloads whose binary format changed between releases.","triggerScenarios":"Deserializing a KV record whose version byte is not one compiled into this build — commonly newer-format records synced down to an older client.","commonSituations":"Version skew between synced machines; restoring old records into a newer store or vice versa.","solutions":["Upgrade atuin-kv / atuin to a version supporting the record's version byte","Skip unknown-version records instead of failing the entire sync","Re-create the KV data with the current client"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check the KV record version byte before decoding\n// fn is_supported_kv_version(payload: &[u8]) -> bool {\n//     payload.first() == Some(&KV_KNOWN_VERSION)\n// }","typeGuard":"fn is_supported_kv_version(payload: &[u8]) -> bool {\n    payload.first() == Some(&KV_KNOWN_VERSION)\n}","tryCatchPattern":"match KvRecord::deserialize(&mut bytes) {\n    Ok(rec) => apply(rec),\n    Err(e) if e.to_string().contains(\"unknown kv record version\") => {\n        log::warn!(\"kv record from newer atuin; skipping until upgrade\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Upgrade atuin before consuming records written by newer clients","Keep all synced hosts on compatible versions","Back up and re-create KV data across major format changes"],"tags":["deserialization","kv","versioning"],"backgroundTag":"unsupported-enum-value","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}