{"record":{"id":"5c5f0dcd6e49038c","repo":"tinyhumansai/openhuman","slug":"composio-v3-auth-config-lookup-failed-err","errorCode":null,"errorMessage":"Composio v3 auth config lookup failed: {err}","messagePattern":"Composio v3 auth config lookup failed: (.+?)","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/integrations/composio/tools/direct.rs","lineNumber":680,"sourceCode":"\n    async fn resolve_auth_config_id(&self, app_name: &str) -> anyhow::Result<String> {\n        let url = format!(\"{}/auth_configs\", self.base_v3);\n\n        let resp = self\n            .client()\n            .get(&url)\n            .header(\"x-api-key\", &self.api_key)\n            .query(&[\n                (\"toolkit_slug\", app_name),\n                (\"show_disabled\", \"true\"),\n                (\"limit\", \"25\"),\n            ])\n            .send()\n            .await?;\n\n        if !resp.status().is_success() {\n            let err = response_error(resp).await;\n            anyhow::bail!(\"Composio v3 auth config lookup failed: {err}\");\n        }\n\n        let body: ComposioAuthConfigsResponse = resp\n            .json()\n            .await\n            .context(\"Failed to decode Composio v3 auth configs response\")?;\n\n        if body.items.is_empty() {\n            anyhow::bail!(\n                \"No auth config found for toolkit '{app_name}'. Create one in Composio first.\"\n            );\n        }\n\n        let preferred = body\n            .items\n            .iter()\n            .find(|cfg| cfg.is_enabled())\n            .or_else(|| body.items.first())","sourceCodeStart":662,"sourceCodeEnd":698,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/composio/tools/direct.rs#L662-L698","documentation":"Non-2xx from the v3 auth-config lookup: GET with toolkit_slug=<app>&show_disabled=true&limit=25. This runs inside the connect flow when only an app name is given (to resolve it to an auth_config_id); response_error folds status + body into {err}. It is the transport-level failure — an empty-but-200 result is the separate 'No auth config found' error.","triggerScenarios":"401 invalid API key; 400 from a malformed toolkit_slug (empty after trim, or invalid characters); 429; 5xx. Example: get_connection_url(Some(\"slack\"), None, entity) while the key is revoked fails here before the empty-items check can even run.","commonSituations":"Connect attempted right after the key expired; toolkit slug with whitespace or odd casing injected from user input; Composio 5xx during the connect attempt.","solutions":["Inspect {err} for status and body","401: fix the API key first — the lookup cannot succeed without it","Normalize the app slug (trim, lowercase) before triggering connect","429/5xx: retry the connect attempt after a short backoff"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let app_slug = app.map(str::trim).filter(|a| !a.is_empty());\nif app_slug.is_none() && auth_config_id.is_none() {\n    anyhow::bail!(\"connect needs an app slug or auth_config_id before the auth-config lookup\");\n}","typeGuard":null,"tryCatchPattern":"match tool.get_connection_url(app, None, &entity).await {\n    Ok(url) => Ok(url),\n    Err(e) => {\n        let msg = format!(\"{e:#}\");\n        if msg.contains(\"auth config lookup failed: 401\") {\n            ui.prompt_reenter_composio_key(); // key dead before the lookup could run\n        } else {\n            tracing::warn!(\"[composio] auth config lookup: {msg}\");\n        }\n        Err(e)\n    }\n}","preventionTips":["Normalize (trim/lowercase) toolkit slugs before triggering the lookup","Fix API-key health first — every connect sub-call depends on it","Prefer passing an explicit auth_config_id to skip the lookup path entirely"],"tags":["composio","auth-config","http-error","v3","connect"],"backgroundTag":"upstream-api-error-status","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}