{"record":{"id":"c0abb236c1236718","repo":"nautechsystems/nautilus_trader","slug":"no-symbols-provided-c0abb2","errorCode":null,"errorMessage":"No symbols provided","messagePattern":"No symbols provided","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/live.rs","lineNumber":204,"sourceCode":"        stype_in: Option<String>,\n    ) -> anyhow::Result<()> {\n        if let Some(precisions) = &price_precisions\n            && precisions.len() != instrument_ids.len()\n        {\n            anyhow::bail!(\n                \"`price_precisions` length ({}) must match `instrument_ids` length ({})\",\n                precisions.len(),\n                instrument_ids.len()\n            );\n        }\n\n        let symbols: Vec<String> = instrument_ids\n            .iter()\n            .map(|id| id.symbol.to_string())\n            .collect();\n        let first_symbol = symbols\n            .first()\n            .ok_or_else(|| anyhow::anyhow!(\"No symbols provided\"))?;\n        let stype_in = match stype_in {\n            Some(stype_in) => dbn::SType::from_str(&stype_in)?,\n            None => infer_symbology_type(first_symbol),\n        };\n        let symbols: Vec<&str> = symbols.iter().map(String::as_str).collect();\n        check_consistent_symbology(symbols.as_slice())?;\n        let mut sub = Subscription::builder()\n            .symbols(symbols)\n            .schema(dbn::Schema::from_str(&schema)?)\n            .stype_in(stype_in)\n            .build();\n\n        if let Some(start) = start {\n            sub.start = Some(OffsetDateTime::from_unix_timestamp_nanos(i128::from(\n                start,\n            ))?);\n        }\n        sub.use_snapshot = snapshot.unwrap_or(false);","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/live.rs#L186-L222","documentation":"The Databento live client's `subscribe` method requires at least one instrument ID. It maps instrument IDs to symbols and calls `symbols.first()`, returning this error if the resulting list is empty, because `stype_in` inference (when not explicitly provided) needs a symbol. This is a local guard before sending the subscription command to the live feed.","triggerScenarios":"Calling `subscribe` (or `py_subscribe`) with an empty `instrument_ids` collection — e.g. `subscribe(&[], ...)` or a Python call with an empty list `[]`.","commonSituations":"Python callers passing `[]` because instruments were not yet loaded or were filtered out; a strategy subscribing before its instrument definitions arrive; wiring bugs passing an empty list variable.","solutions":["Pass at least one InstrumentId to `subscribe`","Guard the call site (Rust or Python) against an empty instrument list before subscribing","In Python, validate `instrument_ids` length before `py_subscribe`","Fix upstream logic that produces an empty instrument list (e.g. load instruments before subscribing)"],"exampleFix":"// Python, before\nclient.py_subscribe([])\n\n// Python, after\nif not instrument_ids:\n    raise ValueError(\"subscribe requires at least one instrument_id\")\nclient.py_subscribe(instrument_ids)","handlingStrategy":"validation","validationCode":"# Python caller\nif not instrument_ids:\n    raise ValueError(\"subscribe requires at least one instrument_id\")","typeGuard":"def has_instruments(ids: list) -> bool:\n    return len(ids) > 0 and all(hasattr(i, \"symbol\") for i in ids)","tryCatchPattern":"try:\n    client.py_subscribe(instrument_ids)\nexcept RuntimeError as e:\n    if \"No symbols provided\" in str(e):\n        log.error(\"subscribe called with empty instrument list\")\n    else:\n        raise","preventionTips":["Never call subscribe with an empty list; branch or skip instead","Load instrument definitions before subscribing","Assert instrument_ids non-empty in wrapper/helper functions"],"tags":["rust","databento","live-streaming","argument-validation","empty-collection"],"backgroundTag":"missing-required-argument","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"}