nautechsystems/nautilus_trader · error
Lighter execution client cannot cancel without credentials
Error message
Lighter execution client cannot cancel without credentials
What it means
cancel_order was invoked while the Lighter execution client holds no API credential; cancellation requires signing with account credentials, and without them the command cannot be dispatched, so the handler errors immediately.
Source
Thrown at crates/adapters/lighter/src/execution.rs:4369
}
}
Ok(())
});
Ok(())
}
fn modify_order(&self, cmd: ModifyOrder) -> anyhow::Result<()> {
let credential = self.credential.as_ref().ok_or_else(|| {
anyhow::anyhow!("Lighter execution client cannot modify without credentials")
})?;
self.dispatch_signed_modify_order(&cmd, credential);
Ok(())
}
fn cancel_order(&self, cmd: CancelOrder) -> anyhow::Result<()> {
let credential = self.credential.as_ref().ok_or_else(|| {
anyhow::anyhow!("Lighter execution client cannot cancel without credentials")
})?;
self.dispatch_signed_cancel_order(&cmd, credential);
Ok(())
}
fn cancel_all_orders(&self, cmd: CancelAllOrders) -> anyhow::Result<()> {
// Iterate over open orders for the instrument and cancel each. The
// venue offers a `CancelAllOrders` tx but it spans the whole account
// rather than a single market; doing per-order cancels keeps scope
// tight and avoids cancelling positions in unrelated markets.
let cache = self.core.cache();
let open_orders: Vec<ClientOrderId> = cache
.orders_open(None, Some(&cmd.instrument_id), None, None, None)
.into_iter()
.map(|o| o.client_order_id())
.collect();
for client_order_id in open_orders {View on GitHub (pinned to 18893faf8b)
Solutions
- Configure credentials on the client that performs cancels
- Verify the credential field is populated before order management calls
- Use the same credentialed client that submitted the order to cancel it
Defensive patterns
Strategy: validation
Validate before calling
if client.credential().is_none() {
return Err(anyhow!("cannot cancel order: credentials missing"));
} Type guard
fn has_credential(c: &LighterExecutionClient) -> bool {
c.credential().is_some()
} Try / catch
match client.cancel_order(cmd) {
Err(e) if e.to_string().contains("cannot cancel without credentials") => { /* configure credentials */ }
other => other?,
} Prevention
- Use the submitting client (credentialed) for cancels
- Check credential presence in health checks before the trading session
- Keep key config in one place so staging/CI don't silently omit it
When it happens
Trigger: Calling cancel_order on a credential-less Lighter execution client — e.g. trying to cancel an order from a read-only client instance.
Common situations: Missing API key config; forgetting credentials when instantiating the adapter in tests or staging; credentials removed after auth failure.
Related errors
- Lighter execution client cannot submit without credentials
- Lighter execution client cannot modify without credentials
- Lighter query_order requires credentials
- Redis config error: username supplied without password. Eith
- Binance Spot market data mode SBE requires Ed25519 API crede
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/e9a944044f817204.
Report an issue: GitHub.