{"record":{"id":"c5940cc98b6f9d14","repo":"nautechsystems/nautilus_trader","slug":"unknown-typed-payload-type-name","errorCode":null,"errorMessage":"Unknown typed payload '{type_name}'","messagePattern":"Unknown typed payload '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/infrastructure/src/redis/msgbus.rs","lineNumber":886,"sourceCode":"            b\"payload\" => {\n                let redis::Value::BulkString(bytes) = &pair[1] else {\n                    anyhow::bail!(\"Invalid payload format: {stream_msg:?}\");\n                };\n                payload = Some(Bytes::copy_from_slice(bytes));\n            }\n            _ => {}\n        }\n    }\n\n    let Some(topic) = topic else {\n        anyhow::bail!(\"Stream message missing topic: {stream_msg:?}\");\n    };\n    let Some(payload) = payload else {\n        anyhow::bail!(\"Stream message missing payload: {stream_msg:?}\");\n    };\n    let payload_type = match type_name {\n        Some(type_name) if typed_payload => BusPayloadType::from_typed_name(&type_name)\n            .ok_or_else(|| anyhow::anyhow!(\"Unknown typed payload '{type_name}'\"))?,\n        Some(type_name) => BusPayloadType::from_name(&type_name),\n        None if typed_payload => {\n            anyhow::bail!(\"Typed stream message missing type: {stream_msg:?}\")\n        }\n        None => BusPayloadType::Custom(Ustr::default()),\n    };\n\n    Ok(BusMessage::with_str_topic(\n        topic,\n        payload_type,\n        payload,\n        encoding,\n    ))\n}\n\nasync fn run_heartbeat(\n    heartbeat_interval_secs: u16,\n    signal: Arc<AtomicBool>,","sourceCodeStart":868,"sourceCodeEnd":904,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/infrastructure/src/redis/msgbus.rs#L868-L904","documentation":"For typed messages (payload_kind set to the typed marker), the `type` header is resolved through BusPayloadType::from_typed_name, which returns None for names that do not correspond to a known typed payload. This error is raised so consumers fail fast rather than silently treating an unknown type as custom. Untyped messages with unknown names are instead wrapped as BusPayloadType::Custom.","triggerScenarios":"stream_messages -> decode_bus_message processes a message with typed payload kind whose `type` name has no match in BusPayloadType::from_typed_name.","commonSituations":"Publisher upgraded with new message types while the consumer runs an older crate version; a custom producer emits a made-up typed name; cross-instance deployments where type registries differ.","solutions":["Identify the unknown type_name in the error and add/upgrade the corresponding payload type in the consumer's BusPayloadType registry.","Align publisher and consumer crate versions so both know the typed payload names.","If the payload is genuinely custom, publish without the typed payload_kind marker so it maps to BusPayloadType::Custom."],"exampleFix":"// before: consumer without the new type\n// publisher sends type \"Data.v2.CustomTick\"\n// after: upgrade both sides to a crate version where\n// BusPayloadType::from_typed_name(\"Data.v2.CustomTick\") resolves, or\n// publish with legacy (untyped) headers.","handlingStrategy":"validation","validationCode":"// verify typed names resolve before publishing\nassert!(BusPayloadType::from_typed_name(&type_name).is_some(),\n        \"unknown typed payload: {type_name}\");","typeGuard":null,"tryCatchPattern":"match decode_bus_message(entry) {\n    Ok(m) => handle(m),\n    Err(e) if e.to_string().starts_with(\"Unknown typed payload\") => {\n        log::error!(\"publisher knows a type this consumer does not: {e}\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Deploy producer and consumer from the same crate version.","Publish custom payloads as untyped (no payload_kind marker) so they map to BusPayloadType::Custom.","Add a smoke test publishing every registered typed payload name."],"tags":["redis","messaging","versioning","typed-payload"],"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"}