{"record":{"id":"cd21a81052a86977","repo":"nautechsystems/nautilus_trader","slug":"invalid-ibordertags-field-field-value","errorCode":null,"errorMessage":"Invalid IBOrderTags field {field}: {value}","messagePattern":"Invalid IBOrderTags field (.+?): (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/execution/transform/tags.rs","lineNumber":84,"sourceCode":"    tags_map: &Map<String, Value>,\n) -> anyhow::Result<()> {\n    let mut order_value = serde_json::to_value(&*ib_order)\n        .context(\"Failed to serialize IB order before applying IBOrderTags\")?;\n\n    for (key, value) in tags_map {\n        let field = canonical_order_tag_key(key);\n        if should_skip_generic_overlay(&field) {\n            continue;\n        }\n\n        if field == \"non_guaranteed\" {\n            apply_non_guaranteed_combo_tag(ib_order, value)?;\n            sync_order_field(&mut order_value, \"smart_combo_routing_params\", ib_order)?;\n            continue;\n        }\n\n        let Some(mut updates) = normalize_order_tag_update(&field, value) else {\n            anyhow::bail!(\"Invalid IBOrderTags field {field}: {value}\");\n        };\n\n        for (field, value) in updates.drain(..) {\n            apply_order_field_update(ib_order, &mut order_value, &field, value)?;\n        }\n    }\n\n    Ok(())\n}\n\nfn apply_order_field_update(\n    ib_order: &mut IBOrder,\n    order_value: &mut Value,\n    field: &str,\n    value: Value,\n) -> anyhow::Result<()> {\n    let Some(order_obj) = order_value.as_object_mut() else {\n        anyhow::bail!(\"Failed to apply IBOrderTags because IB order JSON is not an object\");","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/execution/transform/tags.rs#L66-L102","documentation":"Each key in the IBOrderTags JSON object must correspond to a known IBOrder field that normalize_order_tag_update recognizes. An unrecognized or malformed field name/value combination cannot be normalized, so the overlay aborts with the offending field and value in the message.","triggerScenarios":"apply_ib_order_tag_json -> apply_ib_order_tag_overlay encountering a key not in the IBOrder schema (typo like 'timeinforce' variants it doesn't normalize, or fields like 'client_id') or a value of the wrong JSON type for a known field (e.g. string where number is expected).","commonSituations":"Typos in tag names ('outsidrth'), casing the adapter doesn't recognize, copy-pasting field names from IB's Java API that differ from this crate's serde field names, or passing numeric fields as strings.","solutions":["Use only field names that exist on the IBOrder struct (check the struct's serde field names in the crate)","Fix the value type to match the field (numbers unquoted, booleans as true/false, enums as valid IB strings)\nFor combos, use the dedicated NonGuaranteed / smart_combo_routing_params keys instead of raw field names"],"exampleFix":"// before\n{\"OutsideRth\": \"yes\"}\n// after\n{\"outside_rth\": true}","handlingStrategy":"validation","validationCode":"for field in tags_obj.as_object().unwrap().keys() {\n    assert!(KNOWN_IB_ORDER_FIELDS.contains(&field.as_str()), \"unknown tag field: {field}\");\n}","typeGuard":null,"tryCatchPattern":"match apply_ib_order_tags(&mut ib_order, &tags) {\n    Err(e) if e.to_string().contains(\"Invalid IBOrderTags field\") => {\n        tracing::warn!(\"dropping malformed order tags: {e}\");\n    }\n    other => other?,\n}","preventionTips":["Copy field names exactly from the crate's IBOrder serde definitions","Keep a checked-in list of allowed tag fields and lint config against it","Type-check values against the field's expected JSON type before submission"],"tags":["interactive-brokers","json","validation","rust"],"backgroundTag":"schema-validation-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"}