{"record":{"id":"8737afe98f150ddc","repo":"Kuberwastaken/claurst","slug":"account-not-found-for","errorCode":null,"errorMessage":"Account '{}' not found for {}","messagePattern":"Account '(.+?)' not found for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-rust/crates/core/src/accounts.rs","lineNumber":189,"sourceCode":"        section.profiles.insert(profile.id.clone(), profile.clone());\n        if make_active {\n            section.active = Some(profile.id.clone());\n            if let Some(stored) = section.profiles.get_mut(&profile.id) {\n                stored.last_selected_at = Some(now_iso());\n            }\n        }\n        self.save()\n    }\n\n    /// Switch the active profile for a provider. Returns `Err` if the id does\n    /// not exist.\n    pub fn switch_to(&mut self, provider: &str, id: &str) -> anyhow::Result<()> {\n        let section = self\n            .providers\n            .get_mut(provider)\n            .ok_or_else(|| anyhow::anyhow!(\"No accounts stored for {provider}\"))?;\n        if !section.profiles.contains_key(id) {\n            anyhow::bail!(\"Account '{}' not found for {}\", id, provider);\n        }\n        section.active = Some(id.to_string());\n        if let Some(p) = section.profiles.get_mut(id) {\n            p.last_selected_at = Some(now_iso());\n        }\n        self.save()\n    }\n\n    /// Remove a profile (and its credential directory). If it was active,\n    /// clears the active pointer.\n    pub fn remove(&mut self, provider: &str, id: &str) -> anyhow::Result<()> {\n        if let Some(section) = self.providers.get_mut(provider) {\n            section.profiles.remove(id);\n            if section.active.as_deref() == Some(id) {\n                section.active = None;\n            }\n        }\n        // Remove the per-account credential dir.","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/core/src/accounts.rs#L171-L207","documentation":"Profile lookup failure in AccountStore::switch_to: the caller asked to make a profile active for a provider, but no profile with that id exists under that provider's section. The formatted values are the missing profile id and the provider name — a stale id (e.g. after accounts.json edits) is the input at fault.","triggerScenarios":"Thrown at src-rust/crates/core/src/accounts.rs:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List available profiles for the provider and switch to a valid id","If the profile was expected, check accounts.json for corruption or manual edits that removed it","Re-add the account to regenerate a profile entry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}