{"record":{"id":"ac6cf0980a2d57f2","repo":"atuinsh/atuin","slug":"could-not-deserialize-config","errorCode":null,"errorMessage":"Could not deserialize config","messagePattern":"Could not deserialize config","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/atuin-client/src/settings.rs","lineNumber":1160,"sourceCode":"\n    #[serde(default)]\n    pub meta: meta::Settings,\n\n    #[serde(default)]\n    pub ai: Ai,\n}\n\nimpl Settings {\n    #[must_use]\n    pub fn utc() -> Self {\n        Self::builder()\n            .expect(\"Could not build default\")\n            .set_override(\"timezone\", \"0\")\n            .expect(\"failed to override timezone with UTC\")\n            .build()\n            .expect(\"Could not build config\")\n            .try_deserialize()\n            .expect(\"Could not deserialize config\")\n    }\n\n    #[must_use]\n    pub fn search_mode(&self) -> SearchMode {\n        self.requested_search_mode.into()\n    }\n\n    pub fn search_mode_shell_up_key_binding(&self) -> Option<SearchMode> {\n        self.requested_search_mode_shell_up_key_binding.map(Into::into)\n    }\n\n    /// Return the active search mode depending on whether Atuin was invoked from the \"up\"\n    /// keybinding.\n    ///\n    /// If Atuin was invoked from the \"up\" keybinding, this returns\n    /// [`Self::search_mode_shell_up_key_binding`], falling back to [`Self::search_mode`] if that\n    /// binding isn't defined. Otherwise, [`Self::search_mode`] is returned.\n    #[must_use]","sourceCodeStart":1142,"sourceCodeEnd":1178,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin-client/src/settings.rs#L1142-L1178","documentation":"`Settings::utc()` finishes with `.try_deserialize().expect(\"Could not deserialize config\")`, panicking if the built config cannot be deserialized into the `Settings` struct. Since the config was built purely from defaults plus the timezone override, this fires only if the default values themselves violate Settings' field types/validation.","triggerScenarios":"Calling `Settings::utc()` when a default field value fails deserialization into its target type (e.g. an enum default missing a serde variant, or the \"0\" timezone override failing to parse into the timezone type).","commonSituations":"Version drift where Settings' serde model changed but defaults did not; overriding timezone \"0\" against a field now typed as a named offset rather than a numeric string.","solutions":["Check the `timezone` field type in Settings; if it no longer accepts \"0\", update the override (e.g. \"UTC\").","Verify defaults and the Settings struct are from the same version — rebuild with a consistent checkout.","Look for recently changed serde attributes (deny_unknown_fields, enum variants) that broke default deserialization.","Report upstream; defaults must always deserialize."],"exampleFix":"// before\n.set_override(\"timezone\", \"0\")\n\n// after (if timezone field became an enum/offset type)\n.set_override(\"timezone\", \"UTC\")","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// expect() panic — match via catch_unwind and fall back:\nlet settings = std::panic::catch_unwind(Settings::utc)\n    .map_err(|_| anyhow::anyhow!(\"utc() deserialization failed; Settings schema/defaults mismatch\"))?;","preventionTips":["Keep the \"timezone\" override value compatible with the Settings field type (numeric string vs named offset).","After changing any serde attribute or enum on Settings, test Settings::utc() and Settings::default().","Keep defaults and struct definitions in the same commit/version."],"tags":["config","panic","deserialization"],"backgroundTag":"schema-validation-failed","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"}