{"record":{"id":"d89a8d86984aea0f","repo":"nautechsystems/nautilus_trader","slug":"execution-mass-status-client-id-did-not-match-s","errorCode":null,"errorMessage":"Execution mass status client ID {} did not match source client {}","messagePattern":"Execution mass status client ID (.+?) did not match source client (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/execution/src/client/mod.rs","lineNumber":171,"sourceCode":"        &self,\n        cmd: &GeneratePositionStatusReports,\n    ) -> anyhow::Result<Vec<PositionStatusReport>> {\n        self.client.generate_position_status_reports(cmd).await\n    }\n\n    /// Generates mass status for executions.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if status generation fails.\n    pub async fn generate_mass_status(\n        &self,\n        lookback_mins: Option<u64>,\n    ) -> anyhow::Result<Option<ExecutionMassStatus>> {\n        let mass_status = self.client.generate_mass_status(lookback_mins).await?;\n\n        if let Some(mass_status) = &mass_status {\n            anyhow::ensure!(\n                mass_status.client_id == self.client_id,\n                \"Execution mass status client ID {} did not match source client {}\",\n                mass_status.client_id,\n                self.client_id,\n            );\n            anyhow::ensure!(\n                mass_status.account_id == self.account_id,\n                \"Execution mass status account ID {} did not match source account {}\",\n                mass_status.account_id,\n                self.account_id,\n            );\n            anyhow::ensure!(\n                mass_status.venue == self.venue,\n                \"Execution mass status venue {} did not match source venue {}\",\n                mass_status.venue,\n                self.venue,\n            );\n        }","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/execution/src/client/mod.rs#L153-L189","documentation":"After the execution client adapter receives a ExecutionMassStatus from its underlying client, it verifies the report's client_id equals the adapter's own client_id. A mismatch means the client returned a reconciliation report that does not belong to this client connection, so the adapter refuses it via anyhow::ensure!.","triggerScenarios":"Calling generate_mass_status(lookback_mins) when the client's returned mass_status.client_id differs from self.client_id.","commonSituations":"Adapter wired with the wrong ClientId at construction; broker adapter returning a default or stale client id in its mass status; connecting the same client implementation to a different account/venue without updating the adapter config.","solutions":["Check the ClientId configured on the execution client adapter matches the one the broker adapter embeds in its mass status.","Inspect the adapter's generate_mass_status implementation to confirm it stamps the correct client_id.","Recreate the adapter with the correct client_id for the connected venue/account.","Log both ids on mismatch to identify which side is stale."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before reconciliation, confirm ids line up\nassert_eq!(client.client_id(), expected_client_id, \"adapter client id mismatch\");","typeGuard":null,"tryCatchPattern":"match client.generate_mass_status(lookback).await {\n    Err(e) if e.to_string().contains(\"did not match source client\") => {\n        // reconfigure adapter client_id, then retry\n    }\n    other => other?,\n}","preventionTips":["Derive the adapter ClientId from the same config used by the broker adapter.","Audit adapter construction against venue/account/client configuration on deployment.","Log returned mass-status ids at debug level to catch drift early."],"tags":["execution","reconciliation","client-id","rust"],"backgroundTag":"internal-invariant-violation","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"}