{"record":{"id":"b8ec9a686308a5a7","repo":"nautechsystems/nautilus_trader","slug":"no-lighter-market-index-for-order-report-instrumen","errorCode":null,"errorMessage":"no Lighter market_index for order report instrument {id}","messagePattern":"no Lighter market_index for order report instrument (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":4667,"sourceCode":"        // position frames; if startup reconciliation reaches this path before\n        // any market is known, one unscoped inactive-order page walk seeds it\n        // from historical account activity.\n        if cmd.instrument_id.is_none() && self.dispatch.active_markets_snapshot().is_empty() {\n            seed_active_markets_from_inactive_orders(\n                &self.http_client,\n                &self.dispatch,\n                credential,\n                &auth,\n                format_between_timestamps(cmd.start, cmd.end, ts_init),\n            )\n            .await?;\n        }\n\n        let market_indices = match cmd.instrument_id {\n            Some(id) => match self.registry.market_index(&id) {\n                Some(idx) => vec![idx],\n                None => {\n                    anyhow::bail!(\"no Lighter market_index for order report instrument {id}\",);\n                }\n            },\n            None => self.dispatch.active_markets_snapshot(),\n        };\n\n        if market_indices.is_empty() {\n            log::debug!(\n                \"Lighter generate_order_status_reports: no active markets yet; returning empty\",\n            );\n            Self::log_report_receipt(0, \"OrderStatusReport\", cmd.log_receipt_level);\n            return Ok(Vec::new());\n        }\n\n        let mut reports: Vec<OrderStatusReport> = Vec::new();\n        let mut active_errors = Vec::new();\n\n        // Active orders are by definition still open. Returning them\n        // unconditionally even when `cmd.start` is set: an open order's","sourceCodeStart":4649,"sourceCodeEnd":4685,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L4649-L4685","documentation":"Raised when an order status/report request targets a specific instrument_id that has no market_index registered in the adapter's instrument registry. The adapter can only translate instrument IDs it has previously registered (via instrument discovery/subscription) into Lighter venue market indices.","triggerScenarios":"Calling an order-report query with an instrument_id that was never subscribed/discovered on this client — a typo'd or foreign instrument ID, or querying before instruments were loaded.","commonSituations":"Copy-pasting an instrument ID from another venue or account, querying orders for a market the client never subscribed to, or racing instrument initialization at startup.","solutions":["Use an instrument_id the client has registered (check the instruments loaded at startup)","Wait for instrument initialization/subscription to complete before issuing report queries","Correct the instrument ID spelling/venue prefix","Subscribe to the market first so its market_index is added to the registry"],"exampleFix":"// before: query without verifying registration\nclient.order_report(Some(instrument_id)).await?;\n// after: guard on registry membership first\nif client.registry.market_index(&instrument_id).is_some() {\n    client.order_report(Some(instrument_id)).await?;\n} else {\n    // fall back to querying all active markets\n    client.order_report(None).await?;\n}","handlingStrategy":"validation","validationCode":"// Rust: check registry membership before querying\nif execution.registry.market_index(&instrument_id).is_none() {\n    // omit instrument_id to query all active markets instead\n    return execution.order_report(None).await;\n}","typeGuard":null,"tryCatchPattern":"match execution.order_report(Some(instrument_id)).await {\n    Err(e) if e.to_string().contains(\"no Lighter market_index\") => {\n        execution.order_report(None).await? // fallback: all active markets\n    }\n    r => r,\n}","preventionTips":["Only query instruments that were loaded/registered at startup","Complete instrument initialization before issuing order-report queries","Validate instrument IDs against the registry instead of hardcoding strings"],"tags":["instrument-registry","order-report","rust","not-found","market-index"],"backgroundTag":"resource-not-found","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"}