{"record":{"id":"bbb95a1e49b9c525","repo":"nautechsystems/nautilus_trader","slug":"no-durable-store-configured-refusing-to-load-exec","errorCode":null,"errorMessage":"No durable store configured; refusing to load execution transaction","messagePattern":"No durable store configured; refusing to load execution transaction","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/cache/mod.rs","lineNumber":243,"sourceCode":"\n        database\n            .update_execution_transaction_status(chain_id, transaction_hash, status)\n            .await\n    }\n\n    /// Loads an execution transaction record by chain ID and transaction hash, failing closed\n    /// when no database is attached.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if no database is configured or the database operation fails.\n    pub async fn get_execution_transaction(\n        &self,\n        chain_id: u32,\n        transaction_hash: &str,\n    ) -> anyhow::Result<Option<ExecutionTransactionRow>> {\n        let database = self.database.as_ref().ok_or_else(|| {\n            anyhow::anyhow!(\"No durable store configured; refusing to load execution transaction\")\n        })?;\n\n        database\n            .get_execution_transaction(chain_id, transaction_hash)\n            .await\n    }\n\n    /// Toggles performance optimization settings in the database.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the database is not initialized or the operation fails.\n    pub async fn toggle_performance_settings(&self, enable: bool) -> anyhow::Result<()> {\n        if let Some(database) = &self.database {\n            database.toggle_perf_sync_settings(enable).await\n        } else {\n            log::warn!(\"Database not initialized, skipping performance settings toggle\");\n            Ok(())","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/mod.rs#L225-L261","documentation":"get_execution_transaction reads an execution transaction row by chain id and hash, but requires a configured durable database. When the cache has no database, it returns this error rather than returning None, since a missing store is a configuration problem, not an absent record.","triggerScenarios":"Calling get_execution_transaction(chain_id, tx_hash) on a BlockchainCache constructed without a database handle.","commonSituations":"Querying transaction history on a memory-only cache; deployments missing the database configuration; code paths shared between database-backed and non-database setups where the caller assumes a store exists.","solutions":["Configure the database on the cache before querying transactions","Check self.database presence (or an equivalent accessor) before calling and handle the no-store case explicitly","Fix the deployment/config so the database URL is provided","If no store is expected, change the caller to skip the lookup instead of hitting the cache"],"exampleFix":"// before\nlet row = cache.get_execution_transaction(chain_id, &tx_hash).await?; // panics into error if no DB\n// after\nlet row = match cache.database() {\n    Some(_) => cache.get_execution_transaction(chain_id, &tx_hash).await?,\n    None => None,\n};","handlingStrategy":"validation","validationCode":"if cache.database.is_none() {\n    eprintln!(\"cannot load execution transaction: no durable store configured\");\n}","typeGuard":"fn can_query(cache: &BlockchainCache) -> bool {\n    cache.database.is_some()\n}","tryCatchPattern":"match cache.get_execution_transaction(chain_id, &tx_hash).await {\n    Err(e) if e.to_string().contains(\"No durable store configured\") => {\n        // treat as config error, not record-not-found\n    }\n    other => other?,\n}","preventionTips":["Distinguish 'no store' from 'no record' at call sites","Provide the database URL in every environment that reads transactions","Construct caches with a database wherever history lookups occur","Test lookup paths with a configured store in CI"],"tags":["database","configuration","lookup","transactions"],"backgroundTag":"missing-required-config","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"}