{"record":{"id":"559d15fa9bb91d39","repo":"nautechsystems/nautilus_trader","slug":"no-durable-store-configured-refusing-to-persist-e","errorCode":null,"errorMessage":"No durable store configured; refusing to persist execution transaction","messagePattern":"No durable store configured; refusing to persist execution transaction","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/cache/mod.rs","lineNumber":176,"sourceCode":"    /// # Errors\n    ///\n    /// Returns an error if no database is configured or the database operation fails.\n    #[expect(\n        clippy::too_many_arguments,\n        reason = \"the parameters mirror the persisted execution transaction fields\"\n    )]\n    pub async fn add_execution_transaction(\n        &self,\n        chain_id: u32,\n        wallet_address: &str,\n        nonce: u64,\n        transaction_hash: &str,\n        purpose: &str,\n        status: &str,\n        client_order_id: Option<&str>,\n    ) -> anyhow::Result<()> {\n        let database = self.database.as_ref().ok_or_else(|| {\n            anyhow::anyhow!(\n                \"No durable store configured; refusing to persist execution transaction\"\n            )\n        })?;\n\n        database\n            .add_execution_transaction(\n                chain_id,\n                wallet_address,\n                nonce,\n                transaction_hash,\n                purpose,\n                status,\n                client_order_id,\n            )\n            .await\n    }\n\n    /// Migrates the execution transaction table and installs its signer and order uniqueness","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/mod.rs#L158-L194","documentation":"BlockchainCache.add_execution_transaction requires a configured durable database before persisting execution transaction records. When no database was provided to the cache, it refuses the write rather than silently dropping the record, since execution transactions are expected to be durable.","triggerScenarios":"Calling add_execution_transaction(...) on a BlockchainCache constructed without a database (self.database is None), e.g. an in-memory cache configured without the database option.","commonSituations":"Deploying without the database connection string / database option set; a config file omitting the cache database section; intentionally running cache in memory-only mode but code paths still call persistence methods.","solutions":["Configure a database on the BlockchainCache at construction so self.database is Some","If memory-only mode is intended, guard the caller: skip persistence calls when the cache has no database","Check the deployment config/env for the missing database URL and supply it","Verify initialization code actually passes the database handle into the cache constructor"],"exampleFix":"// before\nlet cache = BlockchainCache::new(chain, None);\ncache.add_execution_transaction(&hash, \"swap\", \"pending\", None).await?;\n// after\nlet cache = BlockchainCache::new(chain, Some(database)); // durable store configured\ncache.add_execution_transaction(&hash, \"swap\", \"pending\", None).await?;","handlingStrategy":"validation","validationCode":"if cache.database.is_none() {\n    eprintln!(\"cannot persist execution transaction: no durable store configured\");\n}","typeGuard":"fn has_durable_store(cache: &BlockchainCache) -> bool {\n    cache.database.is_some()\n}","tryCatchPattern":"match cache.add_execution_transaction(&hash, \"swap\", \"pending\", None).await {\n    Err(e) if e.to_string().contains(\"No durable store configured\") => {\n        // buffer the record or surface a configuration error\n    }\n    other => other?,\n}","preventionTips":["Assert at startup that a database is configured when persistence is required","Keep memory-only mode behind an explicit feature/flag","Add config validation before the cache is constructed","Log once at init when no store is set so downstream errors are expected"],"tags":["database","configuration","persistence","blockchain"],"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-23T08:17:48.524Z"}