{"record":{"id":"4bbe5aa659ac2300","repo":"nautechsystems/nautilus_trader","slug":"failed-to-resolve-ax-instrument-symbol-via-get","errorCode":null,"errorMessage":"Failed to resolve AX instrument {symbol} via GET /instrument: {e}","messagePattern":"Failed to resolve AX instrument (.+?) via GET /instrument: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/http/client.rs","lineNumber":2369,"sourceCode":"                Err(e) => {\n                    log::warn!(\"Failed to parse position for {}: {e}\", position.symbol);\n                }\n            }\n        }\n\n        Ok(reports)\n    }\n\n    async fn resolve_report_instrument(&self, symbol: Ustr) -> anyhow::Result<InstrumentAny> {\n        if let Some(instrument) = self.get_instrument(&symbol) {\n            return Ok(instrument);\n        }\n\n        let instrument = self\n            .request_instrument(symbol, None, None)\n            .await\n            .map_err(|e| {\n                anyhow::anyhow!(\"Failed to resolve AX instrument {symbol} via GET /instrument: {e}\")\n            })?;\n        self.cache_instrument(instrument.clone());\n        Ok(instrument)\n    }\n\n    /// Cancels all open orders for an instrument.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the request fails.\n    pub async fn cancel_all_orders(&self, instrument_id: InstrumentId) -> Result<(), AxHttpError> {\n        let request = CancelAllOrdersRequest::new().with_symbol(instrument_id.symbol.inner());\n        self.inner.cancel_all_orders(&request).await?;\n        Ok(())\n    }\n}\n","sourceCodeStart":2351,"sourceCodeEnd":2386,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/architect_ax/src/http/client.rs#L2351-L2386","documentation":"The Architect AX adapter could not resolve an instrument by symbol via the venue's GET /instrument endpoint. The underlying HTTP/transport error `e` is wrapped with anyhow to add context identifying the symbol. This adapter throws it because an instrument must be resolved (and cached) before any instrument-specific operations can proceed.","triggerScenarios":"Calling the client's instrument resolution method (the async wrapper around request_instrument(symbol, None, None)) when the symbol does not exist on the venue, the symbol string is malformed, the HTTP request fails (network error, non-2xx response, timeout), or the response cannot be parsed into an instrument definition.","commonSituations":"Typo in symbol (e.g. 'BTC-USDT' vs 'BTCUSDT-PERP'), venue outage or network interruption, expired/invalid API credentials causing HTTP errors, querying a delisted instrument, or a schema change in the AX API breaking parsing of the /instrument response.","solutions":["Verify the symbol exactly matches an instrument listed on the AX venue (query GET /instruments to list all valid symbols).","Inspect the chained cause (`e`) of the anyhow error to determine whether it is a network failure, HTTP error response, or parse failure and fix accordingly.","Check network connectivity, base URL configuration, and API credentials.","Retry with backoff if the failure is transient (timeout/5xx); the adapter caches successful resolutions so subsequent calls are cheap.","If the symbol was delisted, switch to the currently valid symbol or update configuration."],"exampleFix":"// before: propagating bare error without retry\nlet instrument = client.resolve_instrument(symbol).await?;\n// after: classify and retry transient failures\nlet instrument = match client.resolve_instrument(symbol).await {\n    Ok(i) => i,\n    Err(e) if is_transient(&e) => {\n        tokio::time::sleep(Duration::from_secs(2)).await;\n        client.resolve_instrument(symbol).await?\n    }\n    Err(e) => return Err(e),\n};","handlingStrategy":"try-catch","validationCode":"// before calling\nfn is_valid_symbol(symbol: &str) -> bool {\n    !symbol.is_empty() && symbol.chars().all(|c| c.is_ascii_alphanumeric() || c == '-')\n}\nif !is_valid_symbol(symbol) { return Err(anyhow::anyhow!(\"invalid AX symbol: {symbol}\")); }","typeGuard":"fn is_transient(err: &anyhow::Error) -> bool {\n    err.chain().any(|c| c.to_string().to_lowercase().contains(\"timeout\")\n        || c.to_string().contains(\"503\") || c.to_string().contains(\"502\"))\n}","tryCatchPattern":"match client.resolve_instrument(symbol).await {\n    Ok(i) => i,\n    Err(e) if is_transient(&e) => retry_with_backoff(symbol),\n    Err(e) => {\n        tracing::error!(%symbol, error = ?e, \"AX instrument resolution failed\");\n        return Err(e);\n    }\n}","preventionTips":["Validate symbol format before resolving","Warm the instrument cache at startup so resolution errors surface early","Monitor the chained cause to distinguish network vs data errors","Keep the adapter and AX API schema expectations in sync"],"tags":["rust","http","network","instrument-resolution","anyhow"],"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-23T08:17:48.524Z"}