{"record":{"id":"477b3054f07aba27","repo":"tinyhumansai/openhuman","slug":"auth-profile-not-found-profile-id-477b30","errorCode":null,"errorMessage":"Auth profile not found: {profile_id}","messagePattern":"Auth profile not found: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/security/credentials/core.rs","lineNumber":59,"sourceCode":"        token: &str,\n        metadata: HashMap<String, String>,\n        set_active: bool,\n    ) -> Result<AuthProfile> {\n        let mut profile = AuthProfile::new_token(provider, profile_name, token.to_string());\n        profile.metadata.extend(metadata);\n        self.store.upsert_profile(profile.clone(), set_active)?;\n        Ok(profile)\n    }\n\n    pub fn set_active_profile(&self, provider: &str, requested_profile: &str) -> Result<String> {\n        let provider = normalize_provider(provider)?;\n        let data = self.store.load()?;\n        let profile_id = resolve_requested_profile_id(&provider, requested_profile);\n\n        let profile = data\n            .profiles\n            .get(&profile_id)\n            .ok_or_else(|| anyhow::anyhow!(\"Auth profile not found: {profile_id}\"))?;\n\n        if profile.provider != provider {\n            anyhow::bail!(\n                \"Profile {profile_id} belongs to provider {}, not {}\",\n                profile.provider,\n                provider\n            );\n        }\n\n        self.store.set_active_profile(&provider, &profile_id)?;\n        Ok(profile_id)\n    }\n\n    pub fn remove_profile(&self, provider: &str, requested_profile: &str) -> Result<bool> {\n        let provider = normalize_provider(provider)?;\n        let profile_id = resolve_requested_profile_id(&provider, requested_profile);\n        self.store.remove_profile(&profile_id)\n    }","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/security/credentials/core.rs#L41-L77","documentation":"`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.","triggerScenarios":"Thrown at src/openhuman/security/credentials/core.rs:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List available auth profiles for the provider and use an existing name/id","Re-create the profile if it was deleted","Check for store corruption or a stale active-profile pointer in config","Verify the provider string is normalized correctly (case/aliases)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}