nautechsystems/nautilus_trader · error

Execution intent has unknown purpose

Error message

Execution intent {} has unknown purpose {}

What it means

Reconciliation guard in reconcile_unresolved_execution: the persisted execution intent's purpose string does not parse into a known TransactionPurpose, so the intent cannot be classified and recovered.

Solutions

  1. Inspect the intent row's purpose value and correct it to a valid TransactionPurpose string
  2. Discard/complete the stale intent with the writer version that produced it
  3. Re-run any schema migrations that normalize purpose values
  4. Verify no external tooling writes to the execution intents table

Example fix

// before (bad row)
intent.purpose = "transfer_funds";
// after
intent.purpose = "transfer"; // a value TransactionPurpose::parse accepts
Defensive patterns

Strategy: validation

Validate before calling

if TransactionPurpose::parse(&intent.purpose).is_none() {
    // repair or discard the intent row before connecting
}

Prevention

When it happens

Trigger: connect() -> reconcile_unresolved_execution() calls TransactionPurpose::parse(&intent.purpose) which returns None for an active intent loaded from the database.

Common situations: Manual DB edits; partial migration writing new/renamed purpose values; corrupted rows; version mismatch producing an unrecognized purpose string.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at crates/adapters/blockchain/src/execution/client.rs:1163

            return Ok(());
        };
        anyhow::ensure!(
            intent.schema_version == crate::execution::transaction::EXECUTION_SCHEMA_VERSION,
            "Execution intent {} uses unsupported schema version {}",
            intent.id,
            intent.schema_version
        );

        if intent.status == "prepared" {
            database
                .mark_execution_intent_recoverable(intent.id)
                .await?;
            release_preparing_slot(&self.in_flight);
            return Ok(());
        }

        let purpose = TransactionPurpose::parse(&intent.purpose).ok_or_else(|| {
            anyhow::anyhow!(
                "Execution intent {} has unknown purpose {}",
                intent.id,
                intent.purpose
            )
        })?;
        let nonce = intent
            .nonce
            .ok_or_else(|| anyhow::anyhow!("Active execution intent {} has no nonce", intent.id))?;
        *self.in_flight.lock() = Some(InFlightSlot::Recovering(RecoveryTransaction {
            intent_id: intent.id,
            nonce,
            purpose,
        }));
        let hashes = database.get_execution_transaction_hashes(intent.id).await?;
        let current = current_execution_hash(intent.id, &hashes)?;
        let tx_hash = B256::from_str(&current.transaction_hash).with_context(|| {
            format!(
                "Execution intent {} has invalid transaction hash {}",

View on GitHub (pinned to 18893faf8b)