{"record":{"id":"135795db96924d0e","repo":"nautechsystems/nautilus_trader","slug":"lighter-execution-client-cannot-submit-without-cre","errorCode":null,"errorMessage":"Lighter execution client cannot submit without credentials","messagePattern":"Lighter execution client cannot submit without credentials","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":4210,"sourceCode":"        }\n\n        log::info!(\n            \"Disconnecting Lighter execution client {}\",\n            self.core.client_id\n        );\n\n        self.begin_session_shutdown();\n        let tasks_result = self.finish_session_shutdown().await;\n\n        self.core.set_disconnected();\n\n        log::info!(\"Disconnected: client_id={}\", self.core.client_id);\n        tasks_result\n    }\n\n    fn submit_order(&self, cmd: SubmitOrder) -> anyhow::Result<()> {\n        let credential = self.credential.as_ref().ok_or_else(|| {\n            anyhow::anyhow!(\"Lighter execution client cannot submit without credentials\")\n        })?;\n\n        let order = self.core.cache().try_order_owned(&cmd.client_order_id)?;\n\n        if order.is_closed() {\n            log::warn!(\"Cannot submit closed order {}\", order.client_order_id());\n            return Ok(());\n        }\n\n        let cached_instrument = self\n            .core\n            .cache()\n            .instrument(&order.instrument_id())\n            .cloned();\n\n        if let Some(reason) = local_submit_denial_reason(&order, cached_instrument.as_ref()) {\n            self.emitter.emit_order_denied(&order, &reason);\n            return Ok(());","sourceCodeStart":4192,"sourceCodeEnd":4228,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L4192-L4228","documentation":"submit_order requires a Lighter credential (API key material used for signing transactions). If self.credential is None the client cannot sign or submit, so it returns this error instead of attempting an unsigned submission. It is a guard against submitting orders with an execution client configured without trading credentials.","triggerScenarios":"Calling submit_order on a LighterExecutionClient constructed without credentials — e.g. read-only/market-data setup, or credentials failed to load at startup.","commonSituations":"Config omitting lighter_api_key/private_key or similar env vars; credentials provided to a different client instance; intentionally unauthenticated client used for trading.","solutions":["Configure the Lighter credentials (api key / private key / account_index / api_key_index) in the execution client config before submitting","Verify env vars or config file are actually read and passed into the client constructor","Use a dedicated trading client instance with credentials instead of the data-only client"],"exampleFix":"// before\nlet client = LighterExecutionClient::new(config_without_credential);\nclient.submit_order(cmd)?;\n// after\nlet client = LighterExecutionClient::new(config.with_credential(api_key, private_key));\nclient.submit_order(cmd)?;","handlingStrategy":"validation","validationCode":"if client.credential().is_none() {\n    return Err(anyhow!(\"configure Lighter credentials before submitting orders\"));\n}","typeGuard":"fn has_credential(c: &LighterExecutionClient) -> bool {\n    c.credential().is_some()\n}","tryCatchPattern":"match client.submit_order(cmd) {\n    Err(e) if e.to_string().contains(\"cannot submit without credentials\") => {\n        // load credentials and retry or reject order\n    }\n    other => other?,\n}","preventionTips":["Validate credential presence at startup, fail fast before trading","Set and verify the Lighter API key env/config in every deployment","Keep a single credentialed client for all order actions"],"tags":["rust","lighter","credentials","orders"],"backgroundTag":"missing-credentials","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}