{"record":{"id":"8b4f552e4ed45cda","repo":"nautechsystems/nautilus_trader","slug":"failed-to-create-coinbase-http-client-e","errorCode":null,"errorMessage":"Failed to create Coinbase HTTP client: {e}","messagePattern":"Failed to create Coinbase HTTP client: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/coinbase/src/execution.rs","lineNumber":175,"sourceCode":"        let retry_config = RetryConfig {\n            max_retries: config.max_retries,\n            initial_delay_ms: config.retry_delay_initial_ms,\n            max_delay_ms: config.retry_delay_max_ms,\n            backoff_factor: 2.0,\n            jitter_ms: 250,\n            operation_timeout_ms: Some(60_000),\n            immediate_first: false,\n            max_elapsed_ms: Some(180_000),\n        };\n\n        let http_client = CoinbaseHttpClient::with_credentials(\n            credential.clone(),\n            config.environment,\n            config.http_timeout_secs,\n            proxy_url.clone(),\n            Some(retry_config),\n        )\n        .map_err(|e| anyhow::anyhow!(\"Failed to create Coinbase HTTP client: {e}\"))?;\n\n        if let Some(ref url) = config.base_url_rest {\n            http_client.set_base_url(url.clone());\n        }\n\n        let ws_url = config.ws_url();\n        let ws_user = CoinbaseWebSocketClient::with_credential(\n            &ws_url,\n            credential,\n            config.transport_backend,\n            proxy_url,\n        )\n        .with_socket_control(SocketControl::new(\n            core.client_id,\n            Some(*COINBASE_VENUE),\n            \"coinbase-user-streams\",\n        ));\n","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/coinbase/src/execution.rs#L157-L193","documentation":"The execution client's `new` builds an authenticated CoinbaseHttpClient with the resolved credentials, environment, timeout, proxy, and retry settings. If the client builder fails, the error is wrapped as 'Failed to create Coinbase HTTP client'.","triggerScenarios":"Constructing the execution client with credentials that cause the authenticated HTTP client build to fail — e.g. malformed proxy_url, invalid environment, invalid timeout/retry configuration, or credential format rejected during client setup.","commonSituations":"Wrong environment enum for the credential type (e.g. production keys with a sandbox environment), invalid proxy URL, misconfigured retry policy.","solutions":["Read the wrapped `{e}` for the concrete cause","Match config.environment to the environment the credentials were issued for","Validate proxy_url format or unset it","Check api_key/api_secret are correctly formatted (no whitespace/newlines)","Use default timeout/retry settings to rule out bad config values"],"exampleFix":"// before\nconfig.environment = CoinbaseEnvironment::Sandbox; // keys are production\n// after\nconfig.environment = CoinbaseEnvironment::Live;","handlingStrategy":"validation","validationCode":"if config.api_key.as_deref().map_or(false, |k| k.trim() != k) {\n    return Err(\"api_key has surrounding whitespace\");\n}\nif let Some(p) = &config.proxy_url {\n    url::Url::parse(p).map_err(|e| format!(\"bad proxy: {e}\"))?;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Trim and validate credentials before configuring the client","Match environment (live/sandbox) to the credential type","Keep timeout/retry settings at tested defaults unless needed"],"tags":["rust","http-client","authentication","config","coinbase"],"backgroundTag":"http-request-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}