tinyhumansai/openhuman · error · anyhow::Error

Auth profile not found: {profile_id}

Error message

Auth profile not found: {profile_id}

What it means

`set_active_profile` resolved the requested profile name to a profile id but that id does not exist in the credential store's loaded data. The lookup path (default vs explicitly requested profile) produced an id the store cannot find — typically a stale reference after the profile was deleted, renamed, or the store file changed under an older id.

Source

Thrown at src/openhuman/security/credentials/core.rs:59

        token: &str,
        metadata: HashMap<String, String>,
        set_active: bool,
    ) -> Result<AuthProfile> {
        let mut profile = AuthProfile::new_token(provider, profile_name, token.to_string());
        profile.metadata.extend(metadata);
        self.store.upsert_profile(profile.clone(), set_active)?;
        Ok(profile)
    }

    pub fn set_active_profile(&self, provider: &str, requested_profile: &str) -> Result<String> {
        let provider = normalize_provider(provider)?;
        let data = self.store.load()?;
        let profile_id = resolve_requested_profile_id(&provider, requested_profile);

        let profile = data
            .profiles
            .get(&profile_id)
            .ok_or_else(|| anyhow::anyhow!("Auth profile not found: {profile_id}"))?;

        if profile.provider != provider {
            anyhow::bail!(
                "Profile {profile_id} belongs to provider {}, not {}",
                profile.provider,
                provider
            );
        }

        self.store.set_active_profile(&provider, &profile_id)?;
        Ok(profile_id)
    }

    pub fn remove_profile(&self, provider: &str, requested_profile: &str) -> Result<bool> {
        let provider = normalize_provider(provider)?;
        let profile_id = resolve_requested_profile_id(&provider, requested_profile);
        self.store.remove_profile(&profile_id)
    }

View on GitHub (pinned to 7491200858)

Solutions

  1. List available auth profiles for the provider and use an existing name/id
  2. Re-create the profile if it was deleted
  3. Check for store corruption or a stale active-profile pointer in config
  4. Verify the provider string is normalized correctly (case/aliases)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/security/credentials/core.rs:59 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/477b3054f07aba27. Report an issue: GitHub.