nautechsystems/nautilus_trader · error · anyhow::Error
Unsupported IBOrderTags field: {field}
Error message
Unsupported IBOrderTags field: {field} What it means
IBOrderTags overlays only allow fields that already exist on the serialized IBOrder (order_obj.contains_key(field)). Setting a field IBOrder does not define is rejected so the tag map cannot inject unknown fields into the order.
Source
Thrown at crates/adapters/interactive_brokers/src/execution/transform/tags.rs:106
apply_order_field_update(ib_order, &mut order_value, &field, value)?;
}
}
Ok(())
}
fn apply_order_field_update(
ib_order: &mut IBOrder,
order_value: &mut Value,
field: &str,
value: Value,
) -> anyhow::Result<()> {
let Some(order_obj) = order_value.as_object_mut() else {
anyhow::bail!("Failed to apply IBOrderTags because IB order JSON is not an object");
};
if !order_obj.contains_key(field) {
anyhow::bail!("Unsupported IBOrderTags field: {field}");
}
let previous = order_obj.insert(field.to_string(), value);
match serde_json::from_value::<IBOrder>(order_value.clone()) {
Ok(updated_order) => {
*ib_order = updated_order;
Ok(())
}
Err(e) => {
let Some(order_obj) = order_value.as_object_mut() else {
anyhow::bail!(
"Failed to restore IB order JSON after invalid IBOrderTags field: {field}"
);
};
match previous {
Some(previous) => order_obj.insert(field.to_string(), previous),View on GitHub (pinned to 18893faf8b)
Solutions
- Use only fields the crate's IBOrder struct actually serializes (inspect a serialized IBOrder or its serde definitions)
- Request/patch support for the missing field on IBOrder, then rebuild
- Remove the unsupported tag and configure the equivalent behavior through the adapter's own config or policy functions
Example fix
// before
{"min_trade_qty": 1}
// after
// remove the tag or implement the field on IBOrder first Defensive patterns
Strategy: validation
Validate before calling
let serialized = serde_json::to_value(&ib_order)?;
for field in tags.keys() {
if !serialized.as_object().map_or(false, |o| o.contains_key(field)) {
return Err(anyhow::anyhow!("tag field not on IBOrder: {field}"));
}
} Prevention
- Only use tag fields that exist on the compiled version of IBOrder
- After adapter upgrades, re-validate any persisted tag configurations
- Serialize a sample IBOrder and keep it as a reference schema
When it happens
Trigger: apply_ib_order_tag_overlay -> apply_order_field_update with a tag key that normalize_order_tag_update accepted but which is not a key in the serialized IBOrder JSON — typically a field present in IB's API but not modeled on this crate's IBOrder struct.
Common situations: Trying to set newer IB API fields (e.g. fields added in later TWS API versions) that the adapter's IBOrder struct doesn't serialize; using deprecated/renamed field names.
Related errors
- Invalid IBOrderTags payload: expected a JSON object
- Invalid IBOrderTags field {field}: {value}
- instrument_ratios list needs to have at least 2 legs
- ratio cannot be zero
- Timeout must be greater than 0
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/05b7276b64ba4bfe.
Report an issue: GitHub.