{"record":{"id":"36ea95dc5fc1a4a6","repo":"nautechsystems/nautilus_trader","slug":"unknown-broker-client-order-id-signal-byte","errorCode":null,"errorMessage":"unknown broker client order ID signal byte '{}'","messagePattern":"unknown broker client order ID signal byte '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/common/encoder.rs","lineNumber":263,"sourceCode":"            Ok(unpack_o_format(packed, signal == SIGNAL_O_HYPHENS))\n        }\n        SIGNAL_UUID_HYPHENS | SIGNAL_UUID_NO_HYPHENS => {\n            anyhow::ensure!(\n                data.len() == UUID_B62_LEN,\n                \"invalid UUID broker client order ID payload length\"\n            );\n            let value = decode_base62(data).context(\"invalid UUID broker client order ID\")?;\n            Ok(format_uuid(value, signal == SIGNAL_UUID_HYPHENS))\n        }\n        SIGNAL_RAW => {\n            let raw = std::str::from_utf8(data).context(\"invalid raw broker client order ID\")?;\n            anyhow::ensure!(\n                !raw.is_empty(),\n                \"missing raw broker client order ID payload\"\n            );\n            Ok(raw.to_string())\n        }\n        _ => anyhow::bail!(\n            \"unknown broker client order ID signal byte '{}'\",\n            signal as char\n        ),\n    }\n}\n\nfn build_encoded(prefix: &str, signal: u8, b62: &[u8]) -> String {\n    let mut result = String::with_capacity(prefix.len() + 1 + b62.len());\n    result.push_str(prefix);\n    result.push(signal as char);\n    // base62 output is always valid ASCII\n    result.push_str(std::str::from_utf8(b62).expect(\"base62 is valid UTF-8\"));\n    result\n}\n\nfn encode_base62<const N: usize>(mut value: u128) -> [u8; N] {\n    let mut buf = [b'0'; N];\n    for i in (0..N).rev() {","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/common/encoder.rs#L245-L281","documentation":"During decoding of a Binance broker client order ID, the first byte after the broker prefix (the 'signal' byte) did not match any known format tag (e.g. SIGNAL_O_HYPHENS, SIGNAL_O_NO_HYPHENS, raw payload). The decoder bails, reporting the offending byte as a char. This means the ID was not produced (or not produced intact) by this adapter's encoder.","triggerScenarios":"Calling decode_broker_id / decode_client_order_id on an ID whose payload's first byte is unrecognized — IDs created by a different encoder version, manually constructed IDs with the broker prefix prepended, or bit-corrupted payloads.","commonSituations":"Mixing client order IDs across adapter versions after an encoder format change; manually prefixing a plain UUID with the broker prefix expecting the decoder to accept it; copy/paste or transport corruption of the ID string.","solutions":["Do not decode IDs not produced by this encoder — pass the exchange ID through unchanged or treat it as an opaque string.","Align encoder/decoder versions: regenerate the ID with the current adapter version and resubmit.","If constructing IDs manually, use the adapter's encode function rather than prepending the prefix yourself.","Log the full offending ID and compare against encoder output to identify where the signal byte was lost or altered."],"exampleFix":"// before\nlet decoded = decode_client_order_id(raw_id)?; // bails on foreign-format IDs\n// after\nlet decoded = match decode_client_order_id(raw_id) {\n    Ok(id) => id,\n    Err(_) => raw_id.to_string(), // treat as opaque passthrough\n};","handlingStrategy":"fallback","validationCode":"fn looks_like_encoded_broker_id(id: &str, prefix: &str) -> bool {\n    id.strip_prefix(prefix)\n        .map_or(false, |p| p.as_bytes().first().is_some_and(|b| is_known_signal(*b)))\n}","typeGuard":null,"tryCatchPattern":"let client_id = match decode_client_order_id(exchange_id) {\n    Ok(id) => id,\n    Err(e) if e.to_string().contains(\"unknown broker client order ID signal\") =>\n        exchange_id.to_string(), // opaque passthrough\n    Err(e) => return Err(e),\n};","preventionTips":["Only attempt to decode IDs emitted by the matching encoder version.","Treat exchange-supplied IDs as opaque strings unless you know your adapter encoded them.","When changing the encoding format, bump/branch the signal byte set and handle old values."],"tags":["binance","order-id","encoding","decoding","rust"],"backgroundTag":"invalid-identifier-format","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}