{"record":{"id":"97e185f9434aeaa6","repo":"nautechsystems/nautilus_trader","slug":"all-requests-failed","errorCode":null,"errorMessage":"All {} requests failed: {:?}","messagePattern":"All (.+?) requests failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/adapters/bitmex/src/broadcast/submitter.rs","lineNumber":658,"sourceCode":"            anyhow::bail!(\"IDEMPOTENT_DUPLICATE: Order likely exists but confirmation was lost\");\n        }\n\n        if all_definitive_refusals && !errors.is_empty() {\n            log::error!(\n                \"All {} requests were refused by BitMEX: {errors:?} {params}\",\n                operation.to_lowercase(),\n            );\n            anyhow::bail!(\n                \"{DEFINITIVE_SUBMIT_REJECTION}: All {} requests were refused by BitMEX: {errors:?}\",\n                operation.to_lowercase(),\n            );\n        }\n\n        log::error!(\n            \"All {} requests failed: {errors:?} {params}\",\n            operation.to_lowercase(),\n        );\n        Err(anyhow::anyhow!(\n            \"All {} requests failed: {:?}\",\n            operation.to_lowercase(),\n            errors\n        ))\n    }\n\n    /// Broadcasts a submit request to all healthy clients in parallel.\n    ///\n    /// # Returns\n    ///\n    /// - `Ok(report)` if successfully submitted with a report.\n    /// - `Err` if all requests failed.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if all submit requests fail or no healthy clients are available.\n    #[expect(clippy::too_many_arguments)]\n    pub async fn broadcast_submit(","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bitmex/src/broadcast/submitter.rs#L640-L676","documentation":"The BitMEX order submitter's broadcast_submit fan-out sent the submit request to the WebSocket broadcast pool, and every request in the batch returned an error. process_submit_results aggregates all per-request errors into a single anyhow error so the caller (broadcast_submit, which feeds Nautilus order emulators) sees one failure with the full error list.","triggerScenarios":"Calling submit/submit_order_list when the BitMEX WebSocket connection is down or the request pool times out; every in-flight request in the batch fails (auth rejection, disconnect, exchange error) so the errors vec has no successes to report.","commonSituations":"Network outage or BitMEX WS disconnect mid-session; invalid API credentials causing every request to be rejected; sending during exchange maintenance; all pooled broadcast channels saturated or closed.","solutions":["Inspect the {:?} errors list in the message to see the per-request root cause (auth, timeout, exchange error) and fix that first","Verify the WebSocket connection is healthy and credentials are valid before broadcasting","Retry the submit once the connection is re-established; the failed batch was not applied if all requests errored","Check BitMEX status/maintenance windows if errors are uniform connection failures"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Rust: pre-flight checks before broadcast_submit\nassert!(ws_client.is_connected(), \"BitMEX WS not connected\");\nassert!(credentials_valid, \"BitMEX credentials rejected\");","typeGuard":null,"tryCatchPattern":"match client.submit_order(order) {\n    Ok(_) => {},\n    Err(e) if e.to_string().contains(\"All\") && e.to_string().contains(\"requests failed\") => {\n        log::error!(\"BitMEX submit batch failed entirely, check WS/auth: {e}\");\n        // reconnect and re-submit after confirming order was not applied\n    }\n    Err(e) => log::error!(\"submit error: {e}\"),\n}","preventionTips":["Monitor WS connection health and reconnect before trading","Validate API credentials at startup with a lightweight authenticated call","Log and inspect the errors list; treat a total batch failure as a connection/auth incident","Check BitMEX status page during maintenance windows"],"tags":["websocket","order-submission","network","batch-failure"],"backgroundTag":"api-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"}