{"record":{"id":"031a4aef136585ea","repo":"nautechsystems/nautilus_trader","slug":"failed-to-create-clob-http-client","errorCode":null,"errorMessage":"failed to create CLOB HTTP client","messagePattern":"failed to create CLOB HTTP client","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/execution/mod.rs","lineNumber":149,"sourceCode":"            config.passphrase.clone(),\n            config.funder.clone(),\n        )\n        .context(\"failed to resolve Polymarket credentials\")?;\n\n        let signer_address = secrets.address.clone();\n        let maker_address = resolve_maker_address(\n            config.signature_type,\n            &signer_address,\n            secrets.funder.as_deref(),\n        )?;\n        let http_client = PolymarketClobHttpClient::new_with_proxy(\n            secrets.credential.clone(),\n            signer_address.clone(),\n            config.base_url_http.clone(),\n            config.http_timeout_secs,\n            proxy_url.clone(),\n        )\n        .map_err(|e| anyhow::anyhow!(\"{e}\"))\n        .context(\"failed to create CLOB HTTP client\")?;\n\n        let data_api_client = PolymarketDataApiHttpClient::new_with_proxy(\n            Some(config.data_api_url()),\n            config.http_timeout_secs,\n            proxy_url.clone(),\n        )\n        .map_err(|e| anyhow::anyhow!(\"{e}\"))\n        .context(\"failed to create Data API HTTP client\")?;\n\n        let order_signer =\n            OrderSigner::new(&secrets.private_key).context(\"failed to create order signer\")?;\n        let order_builder = Arc::new(PolymarketOrderBuilder::new(\n            order_signer,\n            signer_address,\n            maker_address,\n            config.signature_type,\n        ));","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/execution/mod.rs#L131-L167","documentation":"The Polymarket execution client constructor (`new`) builds a `PolymarketClobHttpClient` for the CLOB HTTP API using credentials, signer address, base URL, timeout, and optional proxy. Any failure from that client constructor is wrapped with this context. It indicates the CLOB HTTP client could not be constructed, so the execution client cannot be created.","triggerScenarios":"Invalid base_url_http (unparseable URL); invalid credentials/signer address format; invalid http_timeout_secs; proxy_url that cannot be parsed or an unsupported proxy scheme passed to new_with_proxy.","commonSituations":"Misconfigured POLYMARKET_HTTP_URL or proxy env var (typo, missing scheme like http://); corporate proxy requiring auth; bad timeout value (0 or negative); malformed API credentials in secrets config.","solutions":["Verify config.base_url_http is a valid absolute URL with scheme (e.g. https://clob.polymarket.com)","Check proxy_url is a valid HTTP(S) proxy URL or None — include scheme and port","Validate http_timeout_secs is a positive sane value","Confirm credentials and signer_address from secrets are well-formed (0x-prefixed addresses)","Read the inner `{e}` error for the exact constructor failure"],"exampleFix":"// before\nhttp_timeout_secs: 0,\nproxy_url: Some(\"proxy.corp:8080\".into()), // missing scheme\n// after\nhttp_timeout_secs: 30,\nproxy_url: Some(\"http://proxy.corp:8080\".into()),","handlingStrategy":"validation","validationCode":"fn validate_http_config(cfg: &PolymarketExecConfig) -> Result<(), String> {\n    if !cfg.base_url_http.starts_with(\"http\") { return Err(\"base_url_http must be an absolute URL\".into()); }\n    if cfg.http_timeout_secs == 0 { return Err(\"http_timeout_secs must be > 0\".into()); }\n    if let Some(p) = &cfg.proxy_url {\n        if !p.starts_with(\"http\") { return Err(\"proxy_url must include scheme\".into()); }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"let client = PolymarketExecutionClient::new(...)\n    .map_err(|e| { tracing::error!(\"init: {e:#}\"); e })?;","preventionTips":["Validate URLs include scheme and host before constructing clients","Test proxy connectivity in the deployment environment","Keep timeouts positive and sane","Log the full anyhow chain to see the inner parse error"],"tags":["rust","http","config","client-init"],"backgroundTag":"module-init-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}