{"record":{"id":"200c4b6a19184766","repo":"nautechsystems/nautilus_trader","slug":"failed-to-bootstrap-instruments-e","errorCode":null,"errorMessage":"Failed to bootstrap instruments: {e}","messagePattern":"Failed to bootstrap instruments: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/tardis/src/data.rs","lineNumber":562,"sourceCode":"            self.config\n                .stream_options\n                .iter()\n                .map(|opt| opt.exchange)\n                .collect()\n        } else {\n            self.config.options.iter().map(|opt| opt.exchange).collect()\n        };\n\n        let base_url = resolve_ws_base_url(\n            self.config\n                .tardis_ws_url\n                .as_ref()\n                .map(|value| value.expose_secret()),\n        )?;\n        let (instrument_map, instruments) = http_client\n            .bootstrap_instruments(&exchanges)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to bootstrap instruments: {e}\"))?;\n\n        for instrument in instruments {\n            if let Err(e) = self.data_sender.send(DataEvent::Instrument(instrument)) {\n                log::error!(\"Failed to send instrument event: {e}\");\n            }\n        }\n\n        let url = self.build_ws_url(&base_url)?;\n\n        let mode_label = if is_stream_mode { \"stream\" } else { \"replay\" };\n        log::info!(\"Connecting to Tardis Machine {mode_label}\");\n        log::debug!(\"URL: {url}\");\n\n        let (ws_stream, _) = connect_async(&url)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to connect to Tardis Machine: {e}\"))?;\n\n        log::info!(\"Connected to Tardis Machine\");","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/tardis/src/data.rs#L544-L580","documentation":"Raised in connect when the HTTP client fails to bootstrap instruments (fetch and parse the instrument definitions for the configured exchanges) from the Tardis API. Without instruments the client cannot map streams, so connect fails fast.","triggerScenarios":"bootstrap_instruments(&exchanges) returns Err: HTTP request failure, non-2xx response, unexpected payload, or unknown/misspelled exchange name in config.","commonSituations":"Wrong Tardis API key (missing entitlement), invalid exchange identifier in TardisDataClientConfig, network outage, Tardis API downtime or rate limiting.","solutions":["Verify the exchange names in the config match Tardis's exchange identifiers exactly.","Check the API key is set and entitled for the requested exchanges/instruments.","Test network connectivity to api.tardis.dev and check Tardis status/outages.","Inspect `{e}` for HTTP status; back off and retry if rate-limited (429)."],"exampleFix":"// before\nexchanges: vec![\"binance-futures\".into()],\n// after: use the exact Tardis exchange id expected by the API\nexchanges: vec![\"binance-futures\".into()], // confirm id at tardis.dev docs; e.g. not \"binance_usd_m\"","handlingStrategy":"retry","validationCode":"// Validate config before connect\nassert!(!config.exchanges.is_empty(), \"exchanges must be set\");\nfor ex in &config.exchanges {\n    assert!(TARDIS_KNOWN_EXCHANGES.contains(&ex.as_str()), \"unknown Tardis exchange: {ex}\");\n}","typeGuard":null,"tryCatchPattern":"for attempt in 0..3 {\n    match client.connect().await {\n        Ok(()) => break,\n        Err(e) if e.to_string().contains(\"Failed to bootstrap instruments\") && attempt < 2 => {\n            tokio::time::sleep(Duration::from_secs(2u64 << attempt)).await; // backoff\n        }\n        Err(e) => return Err(e),\n    }\n}","preventionTips":["Verify exchange identifiers against Tardis docs before deploying.","Check API key entitlements for the exchanges you request.","Monitor Tardis API status; retry with exponential backoff on 5xx/429."],"tags":["http","instruments","bootstrap"],"backgroundTag":"api-request-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"}