Kuberwastaken/claurst · error

Account ' ' not found for

Error message

Account '{}' not found for {}

What it means

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.

Solutions

  1. List available profiles for the provider and switch to a valid id
  2. If the profile was expected, check accounts.json for corruption or manual edits that removed it
  3. Re-add the account to regenerate a profile entry
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src-rust/crates/core/src/accounts.rs:189 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10). Data as JSON: /api/errors/8737afe98f150ddc. Report an issue: GitHub.

Appendix: source

Thrown at src-rust/crates/core/src/accounts.rs:189

        section.profiles.insert(profile.id.clone(), profile.clone());
        if make_active {
            section.active = Some(profile.id.clone());
            if let Some(stored) = section.profiles.get_mut(&profile.id) {
                stored.last_selected_at = Some(now_iso());
            }
        }
        self.save()
    }

    /// Switch the active profile for a provider. Returns `Err` if the id does
    /// not exist.
    pub fn switch_to(&mut self, provider: &str, id: &str) -> anyhow::Result<()> {
        let section = self
            .providers
            .get_mut(provider)
            .ok_or_else(|| anyhow::anyhow!("No accounts stored for {provider}"))?;
        if !section.profiles.contains_key(id) {
            anyhow::bail!("Account '{}' not found for {}", id, provider);
        }
        section.active = Some(id.to_string());
        if let Some(p) = section.profiles.get_mut(id) {
            p.last_selected_at = Some(now_iso());
        }
        self.save()
    }

    /// Remove a profile (and its credential directory). If it was active,
    /// clears the active pointer.
    pub fn remove(&mut self, provider: &str, id: &str) -> anyhow::Result<()> {
        if let Some(section) = self.providers.get_mut(provider) {
            section.profiles.remove(id);
            if section.active.as_deref() == Some(id) {
                section.active = None;
            }
        }
        // Remove the per-account credential dir.

View on GitHub (pinned to b0637c97ec)