{"record":{"id":"4214f094d404e60c","repo":"nautechsystems/nautilus_trader","slug":"all-requests-failed-errors","errorCode":null,"errorMessage":"All {} requests failed: {errors:?}","messagePattern":"All (.+?) requests failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/bitmex/src/broadcast/canceller.rs","lineNumber":605,"sourceCode":"                            \"{operation} request failed [{client_id}]: {error_msg} {params}\"\n                        );\n                        errors.push(error_msg);\n                    }\n                }\n                Err(e) => {\n                    log::warn!(\"{operation} task join error: {e:?}\");\n                    errors.push(format!(\"Task panicked: {e:?}\"));\n                }\n            }\n        }\n\n        // All tasks failed\n        self.failed_cancels.fetch_add(1, Ordering::Relaxed);\n        log::error!(\n            \"All {} requests failed: {errors:?} {params}\",\n            operation.to_lowercase(),\n        );\n        Err(anyhow::anyhow!(\n            \"All {} requests failed: {errors:?}\",\n            operation.to_lowercase(),\n        ))\n    }\n\n    /// Broadcasts a single cancel request to all healthy clients in parallel.\n    ///\n    /// # Returns\n    ///\n    /// - `Ok(Some(report))` if successfully cancelled with a report.\n    /// - `Ok(None)` if the order was already cancelled (idempotent success).\n    /// - `Err` if all requests failed.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if all cancel requests fail or no healthy clients are available.\n    pub async fn broadcast_cancel(\n        &self,","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bitmex/src/broadcast/canceller.rs#L587-L623","documentation":"Every parallel BitMEX cancel request issued by the broadcast canceller failed, so `process_cancel_results` returns an aggregate error listing all individual failures (`{errors:?}`). The canceller fans each cancel out to all healthy transport clients; when none succeeds, the operation cannot be completed.","triggerScenarios":"`broadcast_cancel`, `broadcast_batch_cancel`, or `broadcast_cancel_all` dispatch requests to all transports and every response is an error — e.g. auth signature rejected, API key lacks order permission, invalid symbol/order IDs, network outage, or IP rate-limited/banned.","commonSituations":"Expired or wrong API credentials; BitMEX geo-block or API maintenance; cancelling order IDs that already closed; sending to testnet with mainnet keys (or vice versa); all transports unhealthy after a network partition.","solutions":["Read the `{errors:?}` list in the log — the per-request errors identify the shared root cause (401 auth, 429 rate limit, 400 bad order id).","Verify BitMEX API key/secret and that the key has order permissions for the target network (mainnet vs testnet).","Check the order IDs / symbol exist and are still open; already-filled or canceled orders return errors.","Check network/proxy connectivity from all transport clients and whether BitMEX API is up; retry after backoff."],"exampleFix":"// before: blanket cancel of possibly-closed orders\nbroadcast_cancel(instrument_id, client_order_id)?;\n// after: check order state first or tolerate already-closed\nif let Some(order) = cache.order(&client_order_id) { if order.is_open() { broadcast_cancel(...)?; } }","handlingStrategy":"retry","validationCode":"if !bitmex_client.api_key_valid() || !bitmex_client.key_has_order_permission() {\n    return Err(anyhow::anyhow!(\"bitmex credentials lack order-cancel permission\"));\n}\n// also confirm the order is still open before cancelling","typeGuard":null,"tryCatchPattern":"match process_cancel_results(results).await {\n    Ok(()) => Ok(()),\n    Err(e) if all_errors_are_auth(&e) => {\n        log::error!(\"auth failure on all cancel attempts; not retrying\");\n        Err(e)\n    }\n    Err(e) if all_errors_are_rate_limit(&e) => {\n        tokio::time::sleep(backoff).await;\n        retry_cancel().await\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Log the per-request error list ({errors:?}) to find the shared root cause before retrying.","Verify API key network (mainnet/testnet) and order permissions at startup.","Check order state before cancelling; skip orders already closed.","Monitor BitMEX API status and respect Retry-After on rate limits."],"tags":["network","cancel-order","bitmex","broadcast","rust"],"backgroundTag":"http-error-response","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"}