nautechsystems/nautilus_trader · error · anyhow::Error

Cannot resolve PERM-{target_perm_id}: no matching open order

Error message

Cannot resolve PERM-{target_perm_id}: no matching open order found

What it means

Order-resolution failure in the IB execution client: after scanning open orders (optionally filtered by account) no entry matched the requested perm_id, so the IB order_id needed for a subsequent action cannot be determined.

Source

Thrown at crates/adapters/interactive_brokers/src/execution/core.rs:2253

            if !data.order.account.is_empty() && data.order.account != raw_account_id {
                continue;
            }

            if data.order.perm_id != target_perm_id {
                continue;
            }

            if data.order_id == 0 {
                anyhow::bail!(
                    "Cannot resolve PERM-{target_perm_id}: matching open order has no IB order_id"
                );
            }

            return Ok(data.order_id);
        }

        anyhow::bail!("Cannot resolve PERM-{target_perm_id}: no matching open order found")
    }

    fn is_active_open_order(order: &ibapi::orders::Order) -> bool {
        !order.deactivate
    }

    fn is_definitive_order_submit_error(error: &ibapi::Error) -> bool {
        matches!(
            error,
            ibapi::Error::InvalidArgument(_) | ibapi::Error::ServerVersion(_, _, _)
        )
    }

    fn classify_order_submit_error(error: &ibapi::Error) -> CommandFailure {
        let reason = error.to_string();

        if Self::is_definitive_order_submit_error(error) {
            CommandFailure::not_sent(reason)

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Verify the perm_id is correct and the order is still open
  2. Check that the account filter does not exclude the order's account
  3. Trigger an open-orders refresh and retry resolution
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/adapters/interactive_brokers/src/execution/core.rs:2253 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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