atuinsh/atuin · error

unknown AliasRecord type

Error message

unknown AliasRecord type {n}

What it means

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.

Solutions

  1. Upgrade atuin (the atuin-dotfiles crate) to a version that knows the new record type
  2. Skip/ignore records that fail to deserialize instead of failing the whole sync
  3. Inspect the offending record's tag/version in the record store and delete or re-encrypt it with a supported encoder

Example fix

// before: whole sync aborts
for r in records { store.decrypt(r)?; }
// after: skip unknown record types
for r in records {
    match store.decrypt(r) {
        Ok(rec) => apply(rec),
        Err(e) if e.to_string().contains("unknown AliasRecord type") => continue,
        Err(e) => return Err(e),
    }
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Peek the type byte before decoding (payload after decryption)
// fn is_known_alias_type(payload: &[u8]) -> bool {
//     matches!(payload.get(1), Some(0) | Some(1)) // version at 0, type at 1
// }

Type guard

fn is_known_alias_type(payload: &[u8]) -> bool {
    matches!(payload.get(1), Some(0) | Some(1))
}

Try / catch

match AliasRecord::deserialize(&mut bytes) {
    Ok(rec) => apply(rec),
    Err(e) if e.to_string().contains("unknown AliasRecord type") => {
        log::warn!("skipping alias record with unknown type");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of atuinsh/atuin@900007c480 (2026-09-19). Data as JSON: /api/errors/78d18423437253b2. Report an issue: GitHub.

Appendix: source

Thrown at crates/atuin-dotfiles/src/store.rs:107

                    // delete
                    1 => {
                        let nfields = decode::read_array_len(&mut bytes).map_err(error_report)?;
                        ensure!(nfields == 1, "too many entries in v0 shell alias delete record");

                        let bytes = bytes.remaining_slice();

                        let (key, bytes) =
                            decode::read_str_from_slice(bytes).map_err(error_report)?;

                        if !bytes.is_empty() {
                            bail!("trailing bytes in encoded shell alias record. malformed");
                        }

                        Ok(Self::Delete(key.to_owned()))
                    }

                    n => {
                        bail!("unknown AliasRecord type {n}");
                    }
                }
            }
            other => {
                bail!("unknown alias record version {other:?}");
            }
        }
    }
}

#[derive(Debug, Clone)]
pub struct AliasStore {
    pub store: SqliteStore,
    pub host_id: HostId,
    pub encryption_key: paseto_v4::Key,
}

impl AliasStore {

View on GitHub (pinned to 900007c480)