{"record":{"id":"653d29b42cd7f03c","repo":"nautechsystems/nautilus_trader","slug":"failed-to-get-open-positions-error-msg","errorCode":null,"errorMessage":"Failed to get open positions: {error_msg}","messagePattern":"Failed to get open positions: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/http/futures/client.rs","lineNumber":1883,"sourceCode":"        }\n\n        Ok(all_reports)\n    }\n\n    pub async fn request_position_status_reports(\n        &self,\n        account_id: AccountId,\n        instrument_id: Option<InstrumentId>,\n    ) -> anyhow::Result<Vec<PositionStatusReport>> {\n        let ts_init = self.generate_ts_init();\n        let mut all_reports = Vec::new();\n\n        let response = self.inner.get_open_positions().await?;\n        if response.result != KrakenApiResult::Success {\n            let error_msg = response\n                .error\n                .unwrap_or_else(|| \"Unknown error\".to_string());\n            anyhow::bail!(\"Failed to get open positions: {error_msg}\");\n        }\n\n        for position in response.open_positions {\n            if let Some(ref target_id) = instrument_id {\n                let instrument = self.get_cached_instrument(&target_id.symbol.inner());\n                if let Some(inst) = instrument\n                    && inst.raw_symbol().as_str() != position.symbol\n                {\n                    continue;\n                }\n            }\n\n            if let Some(instrument) = self.get_instrument_by_raw_symbol(&position.symbol) {\n                match parse_futures_position_status_report(\n                    &position,\n                    &instrument,\n                    account_id,\n                    ts_init,","sourceCodeStart":1865,"sourceCodeEnd":1901,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/http/futures/client.rs#L1865-L1901","documentation":"request_position_status_reports calls get_open_positions and bails when the API result is not Success, forwarding the exchange error message. Position status reports cannot be generated from a failed response.","triggerScenarios":"Calling request_position_status_reports when get_open_positions returns result != Success — invalid credentials, missing permissions, or exchange-side failure.","commonSituations":"Using a spot API key against the futures endpoint; account without positions API access; Kraken maintenance periods.","solutions":["Check the embedded {error_msg} for the underlying exchange reason.","Confirm the key is a futures-enabled key with positions read access.","Retry after backoff for transient errors."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match adapter.request_position_status_reports(None).await {\n    Ok(positions) => update(positions),\n    Err(e) => log::error!(\"positions fetch failed: {e}\"),\n}","preventionTips":["Use a futures-enabled API key (not a spot key).","Check key permissions for positions read access.","Handle maintenance-window failures with retry logic."],"tags":["kraken","futures","positions","api"],"backgroundTag":"api-error-response","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}