atuinsh/atuin · warning

failed to override timezone with UTC

Error message

failed to override timezone with UTC

What it means

`Settings::utc()` builds default settings and overrides the `timezone` key to "0" (UTC). The `.expect("failed to override timezone with UTC")` panics if `config::Config::set_override` returns an error. This is an internal invariant: the override of a known string key with a plain string value should never fail, so a panic here indicates the config builder itself is broken.

Solutions

  1. Verify the `config` crate version has not changed `set_override` semantics (update/lock the dependency).
  2. Check that the `timezone` field in Settings still exists and accepts string overrides; update the key if the field was renamed.
  3. If you hit this in a fork, compare your builder chain against upstream `Settings::builder()` for changes.
  4. Report upstream — panic messages in `utc()` are internal invariant violations.
Defensive patterns

Strategy: try-catch

Try / catch

// utc() panics via expect; it cannot be caught with Result handling.
// Guard by calling it only with stock atuin-client + config crate versions,
// or wrap in catch_unwind if you must isolate it:
let settings = std::panic::catch_unwind(Settings::utc)
    .unwrap_or_else(|_| Settings::builder().expect("default").build().expect("config").try_deserialize().expect("settings"));

Prevention

When it happens

Trigger: Calling `Settings::utc()` when the config builder produced a Config whose source does not accept overrides (e.g. frozen config, or the `timezone` key collides with a non-overridable typed value in a misconfigured build).

Common situations: Effectively never in normal use — this is defensive code; it can only fire if the `config` crate semantics change or the builder chain is modified so set_override receives an invalid key path.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at crates/atuin-client/src/settings.rs:1156

    pub tmux: Tmux,

    #[serde(default)]
    pub logs: Logs,

    #[serde(default)]
    pub meta: meta::Settings,

    #[serde(default)]
    pub ai: Ai,
}

impl Settings {
    #[must_use]
    pub fn utc() -> Self {
        Self::builder()
            .expect("Could not build default")
            .set_override("timezone", "0")
            .expect("failed to override timezone with UTC")
            .build()
            .expect("Could not build config")
            .try_deserialize()
            .expect("Could not deserialize config")
    }

    #[must_use]
    pub fn search_mode(&self) -> SearchMode {
        self.requested_search_mode.into()
    }

    pub fn search_mode_shell_up_key_binding(&self) -> Option<SearchMode> {
        self.requested_search_mode_shell_up_key_binding.map(Into::into)
    }

    /// Return the active search mode depending on whether Atuin was invoked from the "up"
    /// keybinding.
    ///

View on GitHub (pinned to 900007c480)