nautechsystems/nautilus_trader · error · anyhow::Error

No durable store configured; refusing to migrate execution…

Error message

No durable store configured; refusing to migrate execution transaction

What it means

ensure_execution_transaction_schema runs the schema migration for execution transactions but requires a configured durable database. With no database configured on the cache, it refuses to migrate rather than performing a no-op, so callers do not assume a schema exists when nothing was provisioned.

Solutions

  1. Provide the database to the BlockchainCache constructor before invoking schema migration
  2. Skip the migration call when no database is configured (guard the init path)
  3. Fix the config so the database URL is present in the environment that runs migrations
  4. Ensure migrations run against the same database instance the cache will use

Example fix

// before
cache.ensure_execution_transaction_schema().await?; // database is None
// after
if let Some(db) = &cache.database {
    db.ensure_execution_transaction_schema().await?;
}
Defensive patterns

Strategy: validation

Validate before calling

if cache.database.is_none() {
    eprintln!("skipping execution transaction migration: no durable store");
}

Type guard

fn can_migrate(cache: &BlockchainCache) -> bool {
    cache.database.is_some()
}

Try / catch

match cache.ensure_execution_transaction_schema().await {
    Err(e) if e.to_string().contains("No durable store configured") => {
        // fail startup fast with a clear config message
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling ensure_execution_transaction_schema() on a BlockchainCache whose database field is None — typically during startup initialization on a cache built without a database handle.

Common situations: Startup bootstrap code unconditionally calling migrations while the cache was constructed without a database; config missing the database connection; environment-specific deployments (local dev) disabling the durable store but keeping the same init path.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/ba8ada96cf21c4eb. Report an issue: GitHub.

Appendix: source

Thrown at crates/adapters/blockchain/src/cache/mod.rs:202

                wallet_address,
                nonce,
                transaction_hash,
                purpose,
                status,
                client_order_id,
            )
            .await
    }

    /// Migrates the execution transaction table and installs its signer and order uniqueness
    /// constraints, failing closed when no database is attached.
    ///
    /// # Errors
    ///
    /// Returns an error if no database is configured or the database operation fails.
    pub async fn ensure_execution_transaction_schema(&self) -> anyhow::Result<()> {
        let database = self.database.as_ref().ok_or_else(|| {
            anyhow::anyhow!(
                "No durable store configured; refusing to migrate execution transaction"
            )
        })?;

        database.ensure_execution_transaction_schema().await
    }

    /// Updates the status of a persisted execution transaction record, failing closed when no
    /// database is attached.
    ///
    /// # Errors
    ///
    /// Returns an error if no database is configured or the database operation fails.
    pub async fn update_execution_transaction_status(
        &self,
        chain_id: u32,
        transaction_hash: &str,
        status: &str,

View on GitHub (pinned to 18893faf8b)