{"record":{"id":"ac595e1143d4f4fa","repo":"nautechsystems/nautilus_trader","slug":"binance-futures-account-state-request-failed-e","errorCode":null,"errorMessage":"Binance Futures account state request failed: {e}","messagePattern":"Binance Futures account state request failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":453,"sourceCode":"            account_id,\n            account_type,\n            balances,\n            margins,\n            true, // reported\n            UUID4::new(),\n            ts_now,\n            ts_now,\n            None, // base currency\n        )\n        .with_info(info)\n    }\n\n    async fn refresh_account_state(&self) -> anyhow::Result<AccountState> {\n        let account_info = match self.http_client.query_account().await {\n            Ok(info) => info,\n            Err(e) => {\n                log::error!(\"Binance Futures account state request failed: {e}\");\n                anyhow::bail!(\"Binance Futures account state request failed: {e}\");\n            }\n        };\n\n        Ok(self.create_account_state(&account_info))\n    }\n\n    fn update_account_state(&self) {\n        let http_client = self.http_client.clone();\n        let account_id = self.core.account_id;\n        let account_type = self.core.account_type;\n        let bnfcr_currency = self.config.bnfcr_currency;\n        let emitter = self.emitter.clone();\n        let clock = self.clock;\n\n        self.spawn_task(\"query_account\", async move {\n            let account_info = http_client\n                .query_account()\n                .await","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L435-L471","documentation":"refresh_account_state calls the Binance Futures HTTP query_account endpoint; any transport/API error is logged and re-raised as 'Binance Futures account state request failed'. It is invoked during connect, so a failure here aborts client startup.","triggerScenarios":"query_account() returns an error: network failure, invalid/expired API keys, missing futures permissions, IP whitelist mismatch, rate limiting, or Binance maintenance.","commonSituations":"Wrong API key/secret in env vars; key lacks Futures permission; server clock drift causing timestamp/recvWindow errors; -2015/-2019 API errors; restricted-region blocks.","solutions":["Inspect the inner error (logged via log::error!) to identify the Binance error code and fix the root cause.","Verify API key/secret and that the key has Futures trading permissions enabled.","Check network connectivity/proxy and that your IP is on the key's whitelist.","Sync system clock (NTP) if the error indicates timestamp out of recvWindow."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if api_key.is_empty() || api_secret.is_empty() {\n    return Err(anyhow::anyhow!(\"missing Binance API credentials\"));\n}","typeGuard":null,"tryCatchPattern":"match client.refresh_account_state().await {\n    Ok(state) => state,\n    Err(e) if is_retryable(&e) => {\n        tokio::time::sleep(Duration::from_secs(2)).await;\n        client.refresh_account_state().await?\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Enable Futures permission on the API key before deploying.","Sync server clock with NTP to avoid recvWindow errors.","Whitelist the host IP on the API key.","Log the inner error code for diagnosability."],"tags":["binance","futures","http","account-state","api"],"backgroundTag":"http-request-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}