{"record":{"id":"22cd7f3a8bb955a7","repo":"aaif-goose/goose","slug":"failed-to-create-provider-for-oauth","errorCode":null,"errorMessage":"Failed to create provider for OAuth: {}","messagePattern":"Failed to create provider for OAuth: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose-cli/src/commands/configure.rs","lineNumber":468,"sourceCode":"    // Create a temporary provider instance to handle OAuth\n    match create(provider_name, Vec::new()).await {\n        Ok(provider) => match provider.configure_oauth().await {\n            Ok(_) => {\n                let _ = cliclack::log::success(\"OAuth authentication completed successfully!\");\n                Ok(())\n            }\n            Err(e) => {\n                let _ = cliclack::log::error(format!(\"Failed to authenticate: {}\", e));\n                Err(anyhow::anyhow!(\n                    \"OAuth authentication failed for {}: {}\",\n                    key_name,\n                    e\n                ))\n            }\n        },\n        Err(e) => {\n            let _ = cliclack::log::error(format!(\"Failed to create provider for OAuth: {}\", e));\n            Err(anyhow::anyhow!(\n                \"Failed to create provider for OAuth: {}\",\n                e\n            ))\n        }\n    }\n}\n\nconst UNLISTED_MODEL_KEY: &str = \"__unlisted__\";\n\nfn interactive_model_search(\n    models: &[String],\n    provider_meta: &goose::providers::base::ProviderMetadata,\n) -> anyhow::Result<String> {\n    const MAX_VISIBLE: usize = 30;\n    let mut query = String::new();\n\n    loop {\n        let _ = cliclack::clear_screen();","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose-cli/src/commands/configure.rs#L450-L486","documentation":"Before running the OAuth flow, goose instantiates the provider with `create(provider_name, Vec::new())`. If the provider cannot be constructed — unknown name, unsatisfied construction requirements, or a failure while fetching provider metadata — that construction error is wrapped with this message, so the OAuth flow is never even attempted.","triggerScenarios":"`goose configure` -> OAuth for a provider whose factory call fails: provider id not recognized in this build, or the provider constructor erroring during initialization (e.g. fetching remote model metadata).","commonSituations":"Typos or renamed provider ids; custom builds with some providers compiled out; constructors that call the network failing behind proxies; version drift between saved config and the binary.","solutions":["Check the embedded error text for the construction failure reason","Verify the provider id against the list offered by `goose configure`/docs","Fix network egress/proxy if the constructor fetches remote metadata, then retry","Update goose — provider registration regressions are typically fixed quickly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Rust: prove the provider is constructible before offering OAuth\nlet provider = create(provider_name, Vec::new())\n    .await\n    .map_err(|e| anyhow::anyhow!(\"provider unavailable before OAuth: {e}\"))?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use provider ids exactly as goose lists them","Pin goose versions in automation to avoid factory drift","Smoke-test provider creation in setup scripts before OAuth"],"tags":["oauth","provider","factory","configuration","cli"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}