{"record":{"id":"367d8636e45c3f34","repo":"nautechsystems/nautilus_trader","slug":"failed-to-submit-lighter-integrator-approval-nonce","errorCode":null,"errorMessage":"failed to submit Lighter integrator approval nonce={} api_key_index={}{hint}","messagePattern":"failed to submit Lighter integrator approval nonce=(.+?) api_key_index=(.+?)(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":808,"sourceCode":"\n        let response = match self.http_client.send_tx(&request).await {\n            Ok(response) => response,\n            Err(e) => {\n                if lighter_http_error_is_definite_api_rejection(&e) {\n                    let _ = self.dispatch.nonce_manager.ack_failure_if_latest(\n                        credential.account_index(),\n                        approval.api_key_index,\n                        approval.nonce,\n                    );\n                }\n                approval.send_reservation.release();\n                let hint = if maker_only_check_failed {\n                    \" (maker-only pre-flight check failed earlier; venue may reject with 62007 \\\n                     if this key is maker-only)\"\n                } else {\n                    \"\"\n                };\n                return Err(anyhow::Error::new(e).context(format!(\n                    \"failed to submit Lighter integrator approval nonce={} api_key_index={}{hint}\",\n                    approval.nonce, approval.api_key_index,\n                )));\n            }\n        };\n\n        let _ = self.dispatch.nonce_manager.ack_success(\n            credential.account_index(),\n            approval.api_key_index,\n            approval.nonce,\n        );\n        approval.send_reservation.release();\n\n        log::debug!(\n            \"Submitted Lighter integrator approval: integrator={}, nonce={}, \\\n             api_key_index={}, approval_expiry={}, tx_hash={}\",\n            integrator_account_index,\n            approval.nonce,","sourceCodeStart":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L790-L826","documentation":"During Lighter execution client connect, submit_integrator_auto_approval signs and sends an ApproveIntegrator on-chain transaction via send_tx. If the submission fails, the error is wrapped with the nonce and api_key_index; when the earlier maker-only pre-flight check could not complete, a hint warns that a maker-only key may be rejected by the venue with error 62007.","triggerScenarios":"connect() on an execution client configured with an integrator account, where http_client.send_tx(ApproveIntegrator) returns Err — API rejection (e.g. 62007 for maker-only keys, nonce conflict), network failure, or invalid signature/credentials.","commonSituations":"Using a maker-only API key that cannot approve integrators (venue error 62007), stale/incorrect L1/L2 signing keys, nonce desync after retries, or Lighter API downtime during startup.","solutions":["Check the inner error for API code 62007 and, if so, use a non-maker-only API key or have the account pre-approved by one.","Verify credentials (api_key_index, private key) match the Lighter account.","Retry connect after backoff if the inner error is a network/5xx failure; the nonce manager acks failures for definite rejections so nonce state stays consistent.","Ensure only one approval flow runs concurrently; nonce reservations must complete before reuse."],"exampleFix":"// before\n// key index 0 is maker-only\nLighterExecClientConfig { api_key_index: 0, ... } // 62007 rejection at connect\n// after\nLighterExecClientConfig { api_key_index: 1, ... } // non-maker-only key","handlingStrategy":"try-catch","validationCode":"// before connect: verify the API key is not maker-only\nlet maker_only = client.is_maker_only_api_key(&credential).await.unwrap_or(false);\nif maker_only { /* use another key or skip auto-approval */ }","typeGuard":null,"tryCatchPattern":"match client.connect().await {\n    Err(e) if format!(\"{e:#}\").contains(\"integrator approval\") => {\n        if format!(\"{e:#}\").contains(\"62007\") {\n            // switch to a non-maker-only api_key_index and retry\n        }\n    }\n    r => r?,\n}","preventionTips":["Use a non-maker-only API key for accounts needing integrator approval","Verify signing credentials (api_key_index, private key) before connect","Avoid concurrent approval flows that desync nonces","Retry transient network/5xx failures with backoff"],"tags":["rust","lighter","authentication","onchain"],"backgroundTag":"authentication-required","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}