{"record":{"id":"35354aa2ed4bd625","repo":"nautechsystems/nautilus_trader","slug":"connection-error-e","errorCode":null,"errorMessage":"Connection error: {e}","messagePattern":"Connection error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/live.rs","lineNumber":773,"sourceCode":"                },\n                result = client.next_record() => result,\n            };\n\n            let record = match record_opt {\n                Ok(Some(record)) => record,\n                Ok(None) => {\n                    if session_start.elapsed() >= self.success_threshold {\n                        log::debug!(\"Session ended after successful run\");\n                        return Ok(true);\n                    }\n                    anyhow::bail!(\"Session ended by gateway\");\n                }\n                Err(e) => {\n                    if session_start.elapsed() >= self.success_threshold {\n                        log::debug!(\"Connection error after successful run: {e}\");\n                        return Ok(true);\n                    }\n                    anyhow::bail!(\"Connection error: {e}\");\n                }\n            };\n\n            let ts_init = clock.get_time_ns();\n\n            // Decode record\n            if let Some(msg) = record.get::<dbn::ErrorMsg>() {\n                handle_error_msg(msg);\n            } else if let Some(msg) = record.get::<dbn::SystemMsg>() {\n                if let Some(ack) = handle_system_msg(msg, ts_init) {\n                    self.send_msg(DatabentoMessage::SubscriptionAck(ack));\n                }\n            } else if let Some(msg) = record.get::<dbn::SymbolMappingMsg>() {\n                // Remove instrument ID index as the raw symbol may have changed\n                instrument_id_map.remove(&msg.hd.instrument_id);\n                instrument_def_price_precision_map.remove(&msg.hd.instrument_id);\n                update_price_precision_map_with_symbol_mapping_msg(\n                    msg,","sourceCodeStart":755,"sourceCodeEnd":791,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/live.rs#L755-L791","documentation":"The record channel returned Err(e) — a connection error while streaming from the Databento gateway — before the session had been running for success_threshold. The error is wrapped and propagated so the session restarts.","triggerScenarios":"dbn Live client's next_record returns Err during run_session (transport failure, TLS error, gateway reset) before the success threshold elapsed.","commonSituations":"Transient network drops, TCP resets, TLS handshake failures mid-stream, Databento gateway restarts.","solutions":["Allow the adapter's retry loop to re-establish the session","Increase retry/backoff budget if errors are frequent","Check local network/proxy stability for long-lived streams","Read inner {e} to distinguish auth vs transport issues"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match session.run_session().await {\n    Err(e) if e.to_string().contains(\"Connection error\") => {\n        warn!(\"transient connection error: {e}; retrying with backoff\");\n    }\n    other => other?,\n}","preventionTips":["Use stable network connections / watchdogs for long-lived streams","Configure bounded retry with exponential backoff","Log inner errors to distinguish auth vs transport failures"],"tags":["network","databento","disconnection","live-streaming"],"backgroundTag":"network-request-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}