{"record":{"id":"b32c295e02e9b292","repo":"nautechsystems/nautilus_trader","slug":"invalid-entry-order-type-was-other","errorCode":null,"errorMessage":"invalid `entry_order_type`, was {other}","messagePattern":"invalid `entry_order_type`, was (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/common/src/factories/order.rs","lineNumber":1459,"sourceCode":"                expire_time,\n                entry_post_only,\n                false, // reduce_only\n                quote_quantity,\n                None, // display_qty\n                emulation_trigger,\n                trigger_instrument_id,\n                entry_contingency_type,\n                entry_order_list_id,\n                entry_linked_order_ids,\n                entry_parent_order_id,\n                entry_exec_algorithm_id,\n                entry_exec_algorithm_params,\n                entry_exec_spawn_id,\n                entry_tags,\n                UUID4::new(),\n                ts_init,\n            )?),\n            other => anyhow::bail!(\"invalid `entry_order_type`, was {other}\"),\n        };\n\n        let sl_tp_side = match order_side {\n            OrderSide::Buy => OrderSide::Sell,\n            OrderSide::Sell => OrderSide::Buy,\n        };\n\n        let tp_contingency_type = Some(contingency_type);\n        let tp_order_list_id = Some(order_list_id);\n        let tp_linked_order_ids = Some(vec![sl_client_order_id]);\n        let tp_parent_order_id = Some(entry_client_order_id);\n\n        let tp_order = match tp_order_type {\n            OrderType::Limit => OrderAny::Limit(LimitOrder::new_checked(\n                self.trader_id,\n                self.strategy_id,\n                instrument_id,\n                tp_client_order_id,","sourceCodeStart":1441,"sourceCodeEnd":1477,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/common/src/factories/order.rs#L1441-L1477","documentation":"Inside the bracket-order factory (`try_bracket`), the entry order is built by matching on the requested `entry_order_type`; only entry order types that produce a valid bracket entry (stop-limit, limit, market, stop-market style entries) are handled. Any other OrderAny/OrderType variant falls into the catch-all arm and bails with this error, meaning the requested order type cannot be used as the entry leg of a bracket order.","triggerScenarios":"Calling `factory.bracket(...)` (which calls try_bracket) with an `entry_order_type` value that is not one of the supported entry types — e.g. passing TRAILING_STOP_MARKET, TRAILING_STOP_LIMIT, or another exotic order type as the entry leg.","commonSituations":"Configuring a strategy from YAML/TOML where the entry order type string maps to an unsupported variant; generic strategy code forwarding a user-selected order type straight into bracket() without whitelisting; enum variant renamed/added in a version upgrade so a previously accepted value now hits the catch-all.","solutions":["Use a supported entry order type (market, limit, stop-market, stop-limit) for the bracket's entry leg.","Validate entry_order_type against the supported set before calling bracket().","Place trailing-stop orders directly instead of via bracket(); pair them with manual TP/SL if needed.","If a previously valid type now fails, check the changelog for OrderType changes and update the caller."],"exampleFix":"// before\nlet order_list = factory.bracket(entry_order_type, OrderSide::Buy, ...)?;\n\n// after\nassert!(matches!(\n    entry_order_type,\n    OrderType::Market | OrderType::Limit | OrderType::StopMarket | OrderType::StopLimit\n), \"unsupported bracket entry type\");\nlet order_list = factory.bracket(entry_order_type, OrderSide::Buy, ...)?;","handlingStrategy":"validation","validationCode":"const SUPPORTED_ENTRY: &[OrderType] = &[\n    OrderType::Market, OrderType::Limit,\n    OrderType::StopMarket, OrderType::StopLimit,\n];\nif !SUPPORTED_ENTRY.contains(&entry_order_type) {\n    return Err(anyhow::anyhow!(\n        \"unsupported bracket entry_order_type: {entry_order_type:?}\"\n    ));\n}","typeGuard":"fn is_valid_bracket_entry(t: OrderType) -> bool {\n    matches!(\n        t,\n        OrderType::Market\n            | OrderType::Limit\n            | OrderType::StopMarket\n            | OrderType::StopLimit\n    )\n}","tryCatchPattern":"match factory.bracket(entry_order_type, side, price, ...) {\n    Ok(orders) => orders,\n    Err(e) if e.to_string().contains(\"invalid `entry_order_type`\") => {\n        bail!(\"bracket entry type {entry_order_type:?} unsupported; use Market/Limit/StopMarket/StopLimit\")\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Restrict strategy config parsing to whitelisted entry order types for brackets.","Write a unit test asserting bracket() is only called with supported entry types.","Check release notes when upgrading for new/renamed OrderType variants."],"tags":["rust","orders","enum","validation"],"backgroundTag":"invalid-enum-value","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"}