{"record":{"id":"0f3974682e9f570d","repo":"nautechsystems/nautilus_trader","slug":"recovery-reconcile-failed-both-rest-queries-retur","errorCode":null,"errorMessage":"recovery reconcile failed: both REST queries returned errors","messagePattern":"recovery reconcile failed: both REST queries returned errors","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/websocket/streams/recovery.rs","lineNumber":347,"sourceCode":"                    }\n                    Err(e) => {\n                        log::warn!(\n                            \"Failed to build OrderStatusReport for algo {} during recovery reconcile: {e}\",\n                            algo_order.symbol,\n                        );\n                    }\n                }\n            }\n            true\n        }\n        Err(e) => {\n            log::warn!(\"Failed to query open algo orders for recovery reconcile: {e}\");\n            false\n        }\n    };\n\n    if !open_ok && !algo_ok {\n        anyhow::bail!(\"recovery reconcile failed: both REST queries returned errors\");\n    }\n\n    log::info!(\"Recovery reconcile emitted {emitted} OrderStatusReport(s)\");\n    Ok(())\n}\n\nfn resolve_precision(\n    instruments: &dashmap::DashMap<\n        ustr::Ustr,\n        crate::futures::http::client::BinanceFuturesInstrument,\n    >,\n    symbol_ustr: &ustr::Ustr,\n    product_type: BinanceProductType,\n) -> (InstrumentId, u8, u8) {\n    if let Some(instrument) = instruments.get(symbol_ustr) {\n        (\n            instrument.id(),\n            instrument.price_precision() as u8,","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/websocket/streams/recovery.rs#L329-L365","documentation":"After a private-stream reconnect or listenKey rotation, recovery reconciles open state with two REST queries: query_open_orders (regular) and query_open_algo_orders (conditional). Each individual failure is only logged as a warning; recovery aborts with this error only when BOTH fail, and recover_with_retry schedules another attempt, so open-order state may lag until at least one query succeeds.","triggerScenarios":"Both query_open_orders(params) and query_open_algo_orders(None) fail on the same recovery attempt: network outage, 401 (invalid key / no Futures permission / IP ban), 429 or 418 rate limiting, or Binance 5xx errors.","commonSituations":"Connectivity blip during listenKey rotation; API key permissions changed while the node was running; request pressure triggering rate limits; a Binance-side incident taking both REST endpoints down.","solutions":["Read the two preceding warn logs ('Failed to query open orders...' / 'Failed to query open algo orders...') which carry the actual REST errors","Fix whatever they show: credentials/permissions (Futures enabled, IP whitelist), network/proxy, or system clock drift affecting signed requests","If rate-limited (429/418), reduce request pressure and wait out the ban window; recovery retries automatically","If persistent, manually verify GET /fapi/v1/openOrders works from this host with the same key, then restart the node"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Rely on the built-in retry-on-failure recovery; capture the two warn-level per-query errors that precede it to classify causes (auth vs rate limit vs network) and alert if 'both REST queries returned errors' persists beyond a few attempts.","preventionTips":["Keep API key permissions and IP whitelist valid for Futures REST","Watch rate-limit headers and reduce polling pressure to avoid 429/418 during rotations","Alert on repeated reconcile failures so open-order state gaps do not go unnoticed"],"tags":["binance","futures","rest","recovery","reconciliation","rate-limit"],"backgroundTag":"rest-api-request-failed","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}