{"record":{"id":"1f5b7dae634f497a","repo":"nautechsystems/nautilus_trader","slug":"order-client-order-id-not-found-in-cache-1f5b7d","errorCode":null,"errorMessage":"Order {client_order_id} not found in cache","messagePattern":"Order (.+?) not found in cache","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/execution/src/matching_engine/mod.rs","lineNumber":5234,"sourceCode":"            self.remove_queue_position(order.client_order_id());\n\n            // MarketToLimit reads `cached_filled_qty` in its caller to compute leaves;\n            // its own cleanup happens there after the read.\n            if order.order_type() != OrderType::MarketToLimit {\n                self.purge_cached_filled_qty_if_closed(order.client_order_id());\n            }\n        }\n\n        if self.config.support_contingent_orders\n            && let Some(contingency_type) = order.contingency_type()\n        {\n            match contingency_type {\n                ContingencyType::Oto => {\n                    if let Some(linked_orders_ids) = order.linked_order_ids() {\n                        for client_order_id in linked_orders_ids {\n                            let mut child_order = match self.order_snapshot(*client_order_id) {\n                                Some(child_order) => child_order,\n                                None => anyhow::bail!(\"Order {client_order_id} not found in cache\"),\n                            };\n\n                            if child_order.is_closed() || child_order.is_active_local() {\n                                continue;\n                            }\n\n                            // Check if we need to index position id\n                            if let (None, Some(position_id)) =\n                                (child_order.position_id(), order.position_id())\n                            {\n                                self.cache\n                                    .borrow_mut()\n                                    .add_position_id(\n                                        &position_id,\n                                        &self.venue,\n                                        client_order_id,\n                                        &child_order.strategy_id(),\n                                    )","sourceCodeStart":5216,"sourceCodeEnd":5252,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/execution/src/matching_engine/mod.rs#L5216-L5252","documentation":"Lookup failure inside the matching engine: an order referenced by client_order_id is no longer present in the cache (e.g. purged after closure or evicted), so the engine cannot continue processing for it.","triggerScenarios":"Thrown at crates/execution/src/matching_engine/mod.rs:5234 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the order was not already closed and purged from the cache","Re-add or re-query the order before retrying the operation that referenced it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}