{"record":{"id":"78d18423437253b2","repo":"atuinsh/atuin","slug":"unknown-aliasrecord-type-n","errorCode":null,"errorMessage":"unknown AliasRecord type {n}","messagePattern":"unknown AliasRecord type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin-dotfiles/src/store.rs","lineNumber":107,"sourceCode":"                    // 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 shell alias 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 shell alias record. malformed\");\n                        }\n\n                        Ok(Self::Delete(key.to_owned()))\n                    }\n\n                    n => {\n                        bail!(\"unknown AliasRecord type {n}\");\n                    }\n                }\n            }\n            other => {\n                bail!(\"unknown alias record version {other:?}\");\n            }\n        }\n    }\n}\n\n#[derive(Debug, Clone)]\npub struct AliasStore {\n    pub store: SqliteStore,\n    pub host_id: HostId,\n    pub encryption_key: paseto_v4::Key,\n}\n\nimpl AliasStore {","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin-dotfiles/src/store.rs#L89-L125","documentation":"atuin-dotfiles' AliasRecord::deserialize reads a version byte followed by a record-type byte from the encrypted record payload. When the type byte is not one of the known variants (Set/Delete), it throws this error. It means the payload's record type byte is unrecognized by this version of the decoder.","triggerScenarios":"Calling deserialize (or syncing/pulling records) with an AliasRecord payload whose type byte is neither the Set nor Delete variant — typically a record written by a newer atuin version with a new record type.","commonSituations":"Running an older atuin client against record data produced by a newer version that added an alias record type; corrupted or hand-crafted record payloads during sync.","solutions":["Upgrade atuin (the atuin-dotfiles crate) to a version that knows the new record type","Skip/ignore records that fail to deserialize instead of failing the whole sync","Inspect the offending record's tag/version in the record store and delete or re-encrypt it with a supported encoder"],"exampleFix":"// before: whole sync aborts\nfor r in records { store.decrypt(r)?; }\n// after: skip unknown record types\nfor r in records {\n    match store.decrypt(r) {\n        Ok(rec) => apply(rec),\n        Err(e) if e.to_string().contains(\"unknown AliasRecord type\") => continue,\n        Err(e) => return Err(e),\n    }\n}","handlingStrategy":"try-catch","validationCode":"// Peek the type byte before decoding (payload after decryption)\n// fn is_known_alias_type(payload: &[u8]) -> bool {\n//     matches!(payload.get(1), Some(0) | Some(1)) // version at 0, type at 1\n// }","typeGuard":"fn is_known_alias_type(payload: &[u8]) -> bool {\n    matches!(payload.get(1), Some(0) | Some(1))\n}","tryCatchPattern":"match AliasRecord::deserialize(&mut bytes) {\n    Ok(rec) => apply(rec),\n    Err(e) if e.to_string().contains(\"unknown AliasRecord type\") => {\n        log::warn!(\"skipping alias record with unknown type\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep all synced machines on the same atuin version","Upgrade atuin before syncing records written by newer clients","Treat per-record decode failures as skippable, not fatal"],"tags":["deserialization","record-store","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"}