{"record":{"id":"840a808d6a836f7d","repo":"nautechsystems/nautilus_trader","slug":"invalid-marketstatusaction-value-action","errorCode":null,"errorMessage":"Invalid `MarketStatusAction` value: {action}","messagePattern":"Invalid `MarketStatusAction` value: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/decode/market_data.rs","lineNumber":759,"sourceCode":"\n    Ok(bar)\n}\n\n/// Decodes a Databento status message into an `InstrumentStatus` event.\n///\n/// # Errors\n///\n/// Returns an error if decoding the status message fails or if `msg.action` is not a valid `MarketStatusAction`.\npub fn decode_status_msg(\n    msg: &dbn::StatusMsg,\n    instrument_id: InstrumentId,\n    ts_init: Option<UnixNanos>,\n) -> anyhow::Result<InstrumentStatus> {\n    let ts_event = msg.hd.ts_event.into();\n    let ts_init = ts_init.unwrap_or(ts_event);\n\n    let action = MarketStatusAction::from_u16(msg.action)\n        .ok_or_else(|| anyhow::anyhow!(\"Invalid `MarketStatusAction` value: {}\", msg.action))?;\n\n    let status = InstrumentStatus::new(\n        instrument_id,\n        action,\n        ts_event,\n        ts_init,\n        parse_status_reason(msg.reason)?,\n        parse_status_trading_event(msg.trading_event)?,\n        parse_optional_bool(msg.is_trading),\n        parse_optional_bool(msg.is_quoting),\n        parse_optional_bool(msg.is_short_sell_restricted),\n    );\n\n    Ok(status)\n}\n\n/// # Errors\n///","sourceCodeStart":741,"sourceCodeEnd":777,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/decode/market_data.rs#L741-L777","documentation":"decode_status_msg maps the raw u16 msg.action of a Databento status record to the domain MarketStatusAction enum. If the value has no mapping, the decode fails with this error rather than emitting an InstrumentStatus event.","triggerScenarios":"Decoding a StatusMsg whose msg.action u16 is not covered by MarketStatusAction::from_u16 — e.g. a venue-specific or newly added status action code in a newer DBN schema or exchange dataset.","commonSituations":"Loading status records from datasets with extra market-status codes (halts, auctions, new action types); replaying data recorded with newer databento libraries than the adapter supports.","solutions":["Upgrade nautilus-trader to a version whose MarketStatusAction covers the new action code","Identify the failing action value and map it manually to a supported enum variant in a preprocessing step","Skip unmapped status records instead of failing the whole load","Check the dataset's status action codes against the enum's supported values"],"exampleFix":"// before\nlet status = decode_status_msg(&msg, instrument_id, None)?; // panics pipeline on new code\n// after\nmatch MarketStatusAction::from_u16(msg.action) {\n    Some(_) => { let status = decode_status_msg(&msg, instrument_id, None)?; /* handle */ }\n    None => log::warn(\"Skipping status action {}\", msg.action),\n}","handlingStrategy":"validation","validationCode":"// Rust\nlet ok = MarketStatusAction::from_u16(msg.action).is_some();","typeGuard":null,"tryCatchPattern":"// Rust\nErr(e) => log::warn(\"skip: {e:#}\"),","preventionTips":["Compare action codes","Upgrade adapter","Pre-filter records","Log raw values"],"tags":["rust","databento","status","decode"],"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"}