{"record":{"id":"83827749a6fc8e9a","repo":"atuinsh/atuin","slug":"too-many-entries-in-v0-dotfiles-var-delete-record","errorCode":null,"errorMessage":"too many entries in v0 dotfiles var delete record","messagePattern":"too many entries in v0 dotfiles var delete record","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin-dotfiles/src/store/var.rs","lineNumber":70,"sourceCode":"        }\n\n        match version {\n            RecordVersion::V0 => {\n                let mut bytes = decode::Bytes::new(&data.0);\n\n                let record_type = decode::read_u8(&mut bytes).map_err(error_report)?;\n\n                match record_type {\n                    // create\n                    0 => {\n                        let env = Var::deserialize(&mut bytes)?;\n                        Ok(Self::Create(env))\n                    }\n\n                    // delete\n                    1 => {\n                        let nfields = decode::read_array_len(&mut bytes).map_err(error_report)?;\n                        ensure!(nfields == 1, \"too many entries in v0 dotfiles var delete record\");\n\n                        let bytes = bytes.remaining_slice();\n\n                        let (key, bytes) =\n                            decode::read_str_from_slice(bytes).map_err(error_report)?;\n\n                        if !bytes.is_empty() {\n                            bail!(\"trailing bytes in encoded dotfiles var record. malformed\");\n                        }\n\n                        Ok(Self::Delete(key.to_owned()))\n                    }\n\n                    n => {\n                        bail!(\"unknown Dotfiles var record type {n}\");\n                    }\n                }\n            }","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/atuinsh/atuin/blob/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin-dotfiles/src/store/var.rs#L52-L88","documentation":"A v0 dotfiles var 'delete' record must be a msgpack array containing exactly 1 field (the variable name). During deserialization, an array length other than 1 causes this error, as the payload does not conform to the v0 var-delete schema. It protects the record store from corrupt or future-format data.","triggerScenarios":"Deserializing a v0 var delete record (record_type 1) whose decoded msgpack array length differs from 1.","commonSituations":"Version skew between synced atuin clients; corrupted sync payloads; records written by non-atuin tools into the store.","solutions":["Upgrade atuin everywhere the record store syncs to the same version","Remove the malformed record and re-run the var deletion on a current client","Re-sync dotfiles from a machine with intact data","Inspect/repair the record store database if corruption is repeated"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let n = rmp::decode::read_array_len(&mut bytes)?;\nif n != 1 { return Err(\"malformed v0 var delete record\".into()); }","typeGuard":null,"tryCatchPattern":"match VarRecord::deserialize(&data) {\n    Ok(rec) => apply(rec),\n    Err(e) => log::warn!(\"skipping bad var delete record: {e}\"),\n}","preventionTips":["Upgrade all synced clients to the same version","Avoid external writes to the record store","Re-create deleted vars from a current client if a record is corrupt","Keep backups of the record store DB"],"tags":["msgpack","deserialization","dotfiles","record-store","versioning"],"backgroundTag":"schema-validation-failed","analyzedSha":"c0c717ab04c881764bcad4b3d169a507e2432643","analyzedAt":"2026-09-12T07:40:01.341Z","contentChangedAt":"2026-09-12T07:40:01.341Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}